Properly implement the dismissable backgrounds.

This commit is contained in:
Hyperling 2025-02-07 04:41:53 -07:00
parent 595aaefedc
commit 0f65166123

View File

@ -43,31 +43,22 @@ class _ExpensePageState extends State<ExpensePage> {
child: Dismissible( child: Dismissible(
key: Key(curr.toString()), key: Key(curr.toString()),
background: Container( background: Container(
color: Colors.blue, color: Colors.red,
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( Icon(Icons.delete),
color: Colors.red, Text("Delete"),
child: Row( ],
mainAxisSize: MainAxisSize.max, ),
children: [ ),
Icon(Icons.delete), secondaryBackground: Container(
Text("Delete"), color: Colors.yellow,
], child: Row(
), mainAxisAlignment: MainAxisAlignment.end,
), children: [
Spacer(), Text("Edit"),
Container( Icon(Icons.edit),
color: Colors.yellow,
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Text("Edit"),
Icon(Icons.edit),
],
),
),
], ],
), ),
), ),