Do not show Tag Editing screen if the Note cannot have metadata

In the case of '.txt' notes or markdown notes without a yaml header.
This commit is contained in:
Vishesh Handa
2020-09-03 08:52:27 +02:00
parent d4463d8b60
commit e33857f8e9
2 changed files with 18 additions and 14 deletions

View File

@ -103,6 +103,7 @@ class EditorBottomBar extends StatelessWidget {
final bool allowEdits;
final bool zenMode;
final Func0<void> onZenModeChanged;
final bool metaDataEditable;
EditorBottomBar({
@required this.editor,
@ -111,6 +112,7 @@ class EditorBottomBar extends StatelessWidget {
@required this.allowEdits,
@required this.zenMode,
@required this.onZenModeChanged,
@required this.metaDataEditable,
});
@override
@ -137,6 +139,7 @@ class EditorBottomBar extends StatelessWidget {
editorState,
zenMode,
onZenModeChanged,
metaDataEditable,
),
elevation: 0,
);
@ -236,6 +239,7 @@ Widget _buildBottomMenuSheet(
EditorState editorState,
bool zenModeEnabled,
Func0<void> zenModeChanged,
bool metaDataEditable,
) {
return Container(
child: Column(
@ -262,6 +266,7 @@ Widget _buildBottomMenuSheet(
Share.share(note.body);
},
),
if (metaDataEditable)
ProOverlay(
feature: Feature.tags,
child: ListTile(

View File

@ -57,10 +57,8 @@ class _EditorScaffoldState extends State<EditorScaffold> {
editingMode = true;
}
if (editingMode == false) {
note = widget.editorState.getNote();
}
}
@override
void dispose() {
@ -149,6 +147,7 @@ class _EditorScaffoldState extends State<EditorScaffold> {
}
});
},
metaDataEditable: note.canHaveMetadata,
),
)
],