Editor: Bring back 'Move to Folder' in the dropdown menu

I cannot seem to position the BottomAppBar on top of the keyboard, and
until I can do that lets keep this action over here.

https://github.com/flutter/flutter/issues/26499
This commit is contained in:
Vishesh Handa
2020-05-05 10:10:56 +02:00
parent 48b6fa21f7
commit f129f2ac94

View File

@ -17,7 +17,7 @@ abstract class EditorState {
Note getNote(); Note getNote();
} }
enum DropDownChoices { Rename, DiscardChanges, Share } enum DropDownChoices { Rename, MoveToFolder, DiscardChanges, Share }
AppBar buildEditorAppBar( AppBar buildEditorAppBar(
Editor editor, Editor editor,
@ -58,6 +58,11 @@ AppBar buildEditorAppBar(
editor.renameNoteSelected(note); editor.renameNoteSelected(note);
return; return;
case DropDownChoices.MoveToFolder:
var note = editorState.getNote();
editor.moveNoteToFolderSelected(note);
return;
case DropDownChoices.DiscardChanges: case DropDownChoices.DiscardChanges:
var note = editorState.getNote(); var note = editorState.getNote();
editor.discardChangesSelected(note); editor.discardChangesSelected(note);
@ -75,6 +80,10 @@ AppBar buildEditorAppBar(
value: DropDownChoices.Rename, value: DropDownChoices.Rename,
child: Text('Edit File Name'), child: Text('Edit File Name'),
), ),
const PopupMenuItem<DropDownChoices>(
value: DropDownChoices.MoveToFolder,
child: Text('Move to Folder'),
),
const PopupMenuItem<DropDownChoices>( const PopupMenuItem<DropDownChoices>(
value: DropDownChoices.DiscardChanges, value: DropDownChoices.DiscardChanges,
child: Text('Discard Changes'), child: Text('Discard Changes'),