mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 17:29:50 +08:00
initial org viewer
This commit is contained in:
@ -13,6 +13,7 @@ import 'package:gitjournal/editors/bottom_bar.dart';
|
||||
import 'package:gitjournal/editors/common.dart';
|
||||
import 'package:gitjournal/settings.dart';
|
||||
import 'package:gitjournal/widgets/note_viewer.dart';
|
||||
import 'package:org_flutter/org_flutter.dart';
|
||||
|
||||
class EditorScaffold extends StatefulWidget {
|
||||
final Editor editor;
|
||||
@ -127,12 +128,22 @@ class _EditorScaffoldState extends State<EditorScaffold> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var settings = Provider.of<Settings>(context);
|
||||
Widget body = editingMode
|
||||
? widget.body
|
||||
: NoteViewer(
|
||||
Widget body;
|
||||
if (editingMode) {
|
||||
body = widget.body;
|
||||
} else {
|
||||
switch (note.fileFormat) {
|
||||
case NoteFileFormat.OrgMode:
|
||||
body = Org(note.body);
|
||||
break;
|
||||
default:
|
||||
body = NoteViewer(
|
||||
note: note,
|
||||
parentFolder: widget.parentFolder,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
body: GestureDetector(
|
||||
|
35
pubspec.lock
35
pubspec.lock
@ -481,6 +481,13 @@ packages:
|
||||
url: "https://github.com/cek-cek/flutter-emoji"
|
||||
source: git
|
||||
version: "2.4.0"
|
||||
flutter_highlight:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_highlight
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
flutter_launcher_icons:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@ -533,6 +540,13 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_tex_js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_tex_js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
flutter_web_plugins:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -589,6 +603,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
highlight:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: highlight
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -787,6 +808,20 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0+1"
|
||||
org_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: org_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
org_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: org_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -57,6 +57,7 @@ dependencies:
|
||||
intl: ^0.17.0
|
||||
launch_review: ^3.0.1
|
||||
mutex: ^3.0.0
|
||||
org_flutter: ^1.3.0
|
||||
package_info: ^2.0.0
|
||||
path: ^1.8.0
|
||||
permission_handler: ^6.1.1
|
||||
|
Reference in New Issue
Block a user