Last active
January 10, 2021 17:38
-
-
Save corelmax/c013f88136ab4be0c97d76f57319c1b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DeleteTodoDialog extends StatelessWidget { | |
final Todo todo; | |
const DeleteTodoDialog({Key key, this.todo}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Dialog( | |
child: Container( | |
padding: EdgeInsets.all(16), | |
child: Column( | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
Row( | |
children: [ | |
Container( | |
child: Text( | |
'Delete ${todo.title}?', | |
style: TextStyle( | |
color: Colors.black, | |
fontSize: 24, | |
) | |
) | |
) | |
] | |
), | |
Row( | |
children: [ | |
Expanded( | |
child: FlatButton( | |
textColor: Colors.red, | |
onPressed: () { | |
// we will do delete here | |
}, | |
child: Text('Delete'), | |
) | |
), | |
Expanded( | |
child: FlatButton( | |
textColor: Colors.black54, | |
onPressed: () { | |
Navigator.of(context).pop(); | |
}, | |
child: Text('Dismiss'), | |
) | |
), | |
], | |
), | |
], | |
) | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment