Skip to content

Instantly share code, notes, and snippets.

@corelmax
Last active January 10, 2021 17:38
Show Gist options
  • Save corelmax/c013f88136ab4be0c97d76f57319c1b2 to your computer and use it in GitHub Desktop.
Save corelmax/c013f88136ab4be0c97d76f57319c1b2 to your computer and use it in GitHub Desktop.
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