note: do not rename if name textbox is empty

master
EmaMaker 2021-09-21 21:41:35 +02:00
parent 5bde0d383e
commit 1997677fb2
1 changed files with 7 additions and 5 deletions

View File

@ -124,11 +124,13 @@ class MyListTileState extends State<MyListTile> {
child: Text('No')),
TextButton(
onPressed: () {
Navigator.pop(context);
widget.toggleFunction(widget.file, false);
widget.storage.renameNote(
basename(widget.file.path), _controller.text);
_controller.text = "";
if (_controller.text != "") {
Navigator.pop(context);
widget.toggleFunction(widget.file, false);
widget.storage.renameNote(
basename(widget.file.path), _controller.text);
_controller.text = "";
}
},
child: Text('Yes')),
],