Properly implement the dismissable backgrounds.
This commit is contained in:
parent
595aaefedc
commit
0f65166123
@ -43,34 +43,25 @@ class _ExpensePageState extends State<ExpensePage> {
|
||||
child: Dismissible(
|
||||
key: Key(curr.toString()),
|
||||
background: Container(
|
||||
color: Colors.blue,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.red,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Icon(Icons.delete),
|
||||
Text("Delete"),
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Container(
|
||||
secondaryBackground: Container(
|
||||
color: Colors.yellow,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text("Edit"),
|
||||
Icon(Icons.edit),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
onDismissed: (direction) {
|
||||
setState(() {
|
||||
expenses.remove(curr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user