Skip to content

Commit

Permalink
updated cart_list
Browse files Browse the repository at this point in the history
  • Loading branch information
Eznira committed Aug 26, 2024
1 parent 1d3bf29 commit a56cea1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class _MyHomePageState extends State<MyHomePage> {
return ListTile(
onTap: goToCart,
leading: Icon(
Icons.card_travel,
Icons.shopping_cart,
color: Colors.white,
),
title: Text('Cart', style: TextStyle(color: Colors.white)),
Expand Down
24 changes: 14 additions & 10 deletions lib/screens/page2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,20 @@ class _Page2State extends State<Page2> {
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
Expanded(
child: ListView.builder(
itemCount: value.cart_list.length,
itemBuilder: (context, index) {
Shoe shoe = value.cart_list[index];
return ShoeTile(
shoe: shoe,
onPressed: () => removeShoe(shoe),
);
},
),
child: value.cart_list.isEmpty
? Center(
child: Text("Empyt Cart!"),
)
: ListView.builder(
itemCount: value.cart_list.length,
itemBuilder: (context, index) {
Shoe shoe = value.cart_list[index];
return ShoeTile(
shoe: shoe,
onPressed: () => removeShoe(shoe),
);
},
),
)
],
)),
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/custom_nav_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CustomNavBar extends StatelessWidget {
text: 'Shop',
),
GButton(
icon: Icons.card_travel,
icon: Icons.shopping_cart,
text: 'Cart',
),
],
Expand Down

0 comments on commit a56cea1

Please sign in to comment.