mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
@@ -110,7 +110,7 @@ class EntryTile extends StatelessWidget {
|
|||||||
trailing: Row(
|
trailing: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Edit'),
|
child: Text('Edit'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showDialog<void>(
|
showDialog<void>(
|
||||||
@@ -121,7 +121,7 @@ class EntryTile extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Delete'),
|
child: Text('Delete'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var shouldDelete = await showDialog<bool>(
|
var shouldDelete = await showDialog<bool>(
|
||||||
@@ -129,11 +129,11 @@ class EntryTile extends StatelessWidget {
|
|||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: Text('Delete entry?'),
|
title: Text('Delete entry?'),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Cancel'),
|
child: Text('Cancel'),
|
||||||
onPressed: () => Navigator.of(context).pop(false),
|
onPressed: () => Navigator.of(context).pop(false),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Delete'),
|
child: Text('Delete'),
|
||||||
onPressed: () => Navigator.of(context).pop(true),
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
),
|
),
|
||||||
@@ -146,7 +146,7 @@ class EntryTile extends StatelessWidget {
|
|||||||
.entries
|
.entries
|
||||||
.delete(category.id, entry.id);
|
.delete(category.id, entry.id);
|
||||||
|
|
||||||
Scaffold.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text('Entry deleted'),
|
content: Text('Entry deleted'),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user