Note Tag Editor: Capture back button

This way the tags are even updated with the back button.
This commit is contained in:
Vishesh Handa
2020-05-13 01:37:06 +02:00
parent 321d05664c
commit b7124b37bb

View File

@ -34,7 +34,7 @@ class _NoteTagEditorState extends State<NoteTagEditor> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var theme = Theme.of(context); var theme = Theme.of(context);
return Scaffold( var s = Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
icon: const Icon(Icons.arrow_back), icon: const Icon(Icons.arrow_back),
@ -54,6 +54,14 @@ class _NoteTagEditorState extends State<NoteTagEditor> {
), ),
body: buildView(_textController.text), body: buildView(_textController.text),
); );
return WillPopScope(
onWillPop: () async {
Navigator.of(context).pop(_selectedTags);
return false;
},
child: s,
);
} }
Widget buildView(String query) { Widget buildView(String query) {