From 7af130309f7e7f3e45d13f6d4a415030ff883cea Mon Sep 17 00:00:00 2001 From: Rizz-33 <162025795+Rizz-33@users.noreply.github.com> Date: Mon, 25 Mar 2024 22:30:24 +0530 Subject: [PATCH] feat: display title in the cart after tapping on an item --- lib/components/carttile.dart | 0 lib/pages/cart.dart | 25 +++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 lib/components/carttile.dart diff --git a/lib/components/carttile.dart b/lib/components/carttile.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/pages/cart.dart b/lib/pages/cart.dart index 20712d8..0271599 100644 --- a/lib/pages/cart.dart +++ b/lib/pages/cart.dart @@ -14,9 +14,30 @@ class CartPage extends StatelessWidget { //screen return Scaffold( appBar: AppBar( - title: Text('data'), + title: Text('Cart'), + backgroundColor: Colors.transparent, + foregroundColor: Theme.of(context).colorScheme.primary, + centerTitle: true, + ), + body: Column( + children: [ + Expanded( + child: ListView.builder( + itemCount: userCart.length, + itemBuilder: (context, index) { + //get individual cart item + final cartitem = userCart[index]; + + //return cart title + return ListTile( + title: Text(userCart[index].food.name), + ); + } + ), + ), + ], ), ); }); } -} \ No newline at end of file +}