Implement a basic Zen Mode

This can be enabled in all the editors.
This commit is contained in:
Vishesh Handa
2020-07-27 09:39:31 +02:00
parent 6d101ad5c4
commit e9cc050866
6 changed files with 111 additions and 19 deletions

View File

@ -48,7 +48,9 @@ class RawEditor extends StatefulWidget implements Editor {
}
}
class RawEditorState extends State<RawEditor> implements EditorState {
class RawEditorState extends State<RawEditor>
with ChangeNotifier
implements EditorState {
Note note;
bool _noteModified;
TextEditingController _textController = TextEditingController();
@ -106,6 +108,8 @@ class RawEditorState extends State<RawEditor> implements EditorState {
}
void _noteTextChanged() {
notifyListeners();
if (_noteModified) return;
setState(() {
_noteModified = true;