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(
|
child: Dismissible(
|
||||||
key: Key(curr.toString()),
|
key: Key(curr.toString()),
|
||||||
background: Container(
|
background: Container(
|
||||||
color: Colors.blue,
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.delete),
|
Icon(Icons.delete),
|
||||||
Text("Delete"),
|
Text("Delete"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Spacer(),
|
secondaryBackground: Container(
|
||||||
Container(
|
|
||||||
color: Colors.yellow,
|
color: Colors.yellow,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Text("Edit"),
|
Text("Edit"),
|
||||||
Icon(Icons.edit),
|
Icon(Icons.edit),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onDismissed: (direction) {
|
onDismissed: (direction) {
|
||||||
setState(() {
|
setState(() {
|
||||||
expenses.remove(curr);
|
expenses.remove(curr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user