From 0f651661237e77ef64d9fe4925f33c9b5b511a9d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 7 Feb 2025 04:41:53 -0700 Subject: [PATCH] Properly implement the dismissable backgrounds. --- lib/pages/expense.dart | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/lib/pages/expense.dart b/lib/pages/expense.dart index f4f023a..b22d02d 100644 --- a/lib/pages/expense.dart +++ b/lib/pages/expense.dart @@ -43,31 +43,22 @@ class _ExpensePageState extends State { child: Dismissible( key: Key(curr.toString()), background: Container( - color: Colors.blue, + color: Colors.red, child: Row( - mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Container( - color: Colors.red, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon(Icons.delete), - Text("Delete"), - ], - ), - ), - Spacer(), - Container( - color: Colors.yellow, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Text("Edit"), - Icon(Icons.edit), - ], - ), - ), + Icon(Icons.delete), + Text("Delete"), + ], + ), + ), + secondaryBackground: Container( + color: Colors.yellow, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text("Edit"), + Icon(Icons.edit), ], ), ),