fix msg
This commit is contained in:
@@ -10,46 +10,46 @@ import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:zefyr/zefyr.dart';
|
||||
// import 'package:zefyr/zefyr.dart';
|
||||
|
||||
typedef void ProfileCallback();
|
||||
|
||||
class TermPage extends StatefulWidget {
|
||||
const TermPage({
|
||||
Key key,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
@override
|
||||
_TermPageState createState() => _TermPageState();
|
||||
}
|
||||
|
||||
class _TermPageState extends State<TermPage> {
|
||||
ZefyrController _controller;
|
||||
FocusNode _focusNode;
|
||||
NotusDocument document = new NotusDocument();
|
||||
// ZefyrController _controller;
|
||||
// FocusNode _focusNode;
|
||||
// NotusDocument document = new NotusDocument();
|
||||
bool isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_focusNode = FocusNode();
|
||||
// _focusNode = FocusNode();
|
||||
}
|
||||
|
||||
NotusDocument _loadDocument(Setting setting) {
|
||||
bool isEng = Provider.of<LanguageModel>(context).isEng;
|
||||
String term = isEng ? setting.termsEng : setting.termsMm;
|
||||
NotusDocument doc;
|
||||
try {
|
||||
doc = NotusDocument.fromJson(jsonDecode(term));
|
||||
} catch (e) {}
|
||||
if (doc == null) {
|
||||
doc = NotusDocument();
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
// NotusDocument _loadDocument(Setting setting) {
|
||||
// bool isEng = Provider.of<LanguageModel>(context).isEng;
|
||||
// String term = isEng ? setting.termsEng : setting.termsMm;
|
||||
// NotusDocument doc;
|
||||
// try {
|
||||
// doc = NotusDocument.fromJson(jsonDecode(term));
|
||||
// } catch (e) {}
|
||||
// if (doc == null) {
|
||||
// doc = NotusDocument();
|
||||
// }
|
||||
// return doc;
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Setting setting = Provider.of<MainModel>(context).setting;
|
||||
Setting? setting = Provider.of<MainModel>(context).setting;
|
||||
bool isEditable = context.select((MainModel m) => m.termEditable());
|
||||
|
||||
return Scaffold(
|
||||
@@ -76,7 +76,7 @@ class _TermPageState extends State<TermPage> {
|
||||
onPressed: () =>
|
||||
Navigator.of(context).push<void>(CupertinoPageRoute(
|
||||
builder: (context) =>
|
||||
TermEdit(term: Term.fromSetting(setting)),
|
||||
TermEdit(term: Term.fromSetting(setting!)),
|
||||
)),
|
||||
icon: Icon(
|
||||
CupertinoIcons.pen,
|
||||
@@ -85,25 +85,25 @@ class _TermPageState extends State<TermPage> {
|
||||
]
|
||||
: [],
|
||||
),
|
||||
body: ZefyrTheme(
|
||||
data: ZefyrThemeData().copyWith(
|
||||
defaultLineTheme: LineTheme(
|
||||
padding: EdgeInsets.all(0),
|
||||
textStyle: TextStyle(fontFamily: "Myanmar3"),
|
||||
),
|
||||
),
|
||||
// data: ZefyrThemeData().copyWith(
|
||||
// defaultLineTheme: LineTheme(
|
||||
// textStyle: TextStyle(color: Colors.black),
|
||||
// padding: EdgeInsets.all(0))),
|
||||
child: ZefyrScaffold(
|
||||
child: ZefyrEditor(
|
||||
mode: ZefyrMode.view,
|
||||
padding: EdgeInsets.all(16),
|
||||
controller: ZefyrController(_loadDocument(setting)),
|
||||
focusNode: _focusNode,
|
||||
),
|
||||
)),
|
||||
// body: ZefyrTheme(
|
||||
// data: ZefyrThemeData().copyWith(
|
||||
// defaultLineTheme: LineTheme(
|
||||
// padding: EdgeInsets.all(0),
|
||||
// textStyle: TextStyle(fontFamily: "Myanmar3"),
|
||||
// ),
|
||||
// ),
|
||||
// // data: ZefyrThemeData().copyWith(
|
||||
// // defaultLineTheme: LineTheme(
|
||||
// // textStyle: TextStyle(color: Colors.black),
|
||||
// // padding: EdgeInsets.all(0))),
|
||||
// child: ZefyrScaffold(
|
||||
// child: ZefyrEditor(
|
||||
// mode: ZefyrMode.view,
|
||||
// padding: EdgeInsets.all(16),
|
||||
// controller: ZefyrController(_loadDocument(setting)),
|
||||
// focusNode: _focusNode,
|
||||
// ),
|
||||
// )),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user