mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 04:07:53 +08:00
NoteEditor: Improve cancel alert box
Better wording, and avoid a generic 'Yes' or 'No' in the buttons.
This commit is contained in:
@ -97,24 +97,25 @@ class NoteEditorState extends State<NoteEditor> {
|
||||
|
||||
Widget _buildAlertDialog(BuildContext context) {
|
||||
var title = newNote
|
||||
? "Do you want to discard the entry"
|
||||
: "Do you want to discard the changes?";
|
||||
? "Do you want to discard this?"
|
||||
: "Do you want to ignore the changes?";
|
||||
|
||||
var editText = newNote ? "Keep Writing" : "Keep Editing";
|
||||
var discardText = newNote ? "Discard" : "Discard Changes";
|
||||
|
||||
return AlertDialog(
|
||||
// FIXME: Change this to 'Save' vs 'Discard'
|
||||
title: Text('Are you sure?'),
|
||||
content: Text(title),
|
||||
title: Text(title),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text('No'),
|
||||
child: Text(editText),
|
||||
),
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context); // Alert box
|
||||
Navigator.pop(context); // Note Editor
|
||||
},
|
||||
child: Text('Yes'),
|
||||
child: Text(discardText),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
Reference in New Issue
Block a user