mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-04 06:38:27 +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) {
|
Widget _buildAlertDialog(BuildContext context) {
|
||||||
var title = newNote
|
var title = newNote
|
||||||
? "Do you want to discard the entry"
|
? "Do you want to discard this?"
|
||||||
: "Do you want to discard the changes?";
|
: "Do you want to ignore the changes?";
|
||||||
|
|
||||||
|
var editText = newNote ? "Keep Writing" : "Keep Editing";
|
||||||
|
var discardText = newNote ? "Discard" : "Discard Changes";
|
||||||
|
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
// FIXME: Change this to 'Save' vs 'Discard'
|
title: Text(title),
|
||||||
title: Text('Are you sure?'),
|
|
||||||
content: Text(title),
|
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
FlatButton(
|
||||||
onPressed: () => Navigator.of(context).pop(false),
|
onPressed: () => Navigator.of(context).pop(false),
|
||||||
child: Text('No'),
|
child: Text(editText),
|
||||||
),
|
),
|
||||||
FlatButton(
|
FlatButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context); // Alert box
|
Navigator.pop(context); // Alert box
|
||||||
Navigator.pop(context); // Note Editor
|
Navigator.pop(context); // Note Editor
|
||||||
},
|
},
|
||||||
child: Text('Yes'),
|
child: Text(discardText),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user