Skip to content

Commit

Permalink
feat: display title in the cart after tapping on an item
Browse files Browse the repository at this point in the history
  • Loading branch information
Rizz-33 committed Mar 25, 2024
1 parent c262579 commit 7af1303
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Empty file added lib/components/carttile.dart
Empty file.
25 changes: 23 additions & 2 deletions lib/pages/cart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}
),
),
],
),
);
});
}
}
}

0 comments on commit 7af1303

Please sign in to comment.