Skip to content

Commit

Permalink
feat: go to checkout button
Browse files Browse the repository at this point in the history
  • Loading branch information
Rizz-33 committed Mar 26, 2024
1 parent 9bdfea0 commit 1907af3
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions lib/pages/cart.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:blend_bristo/components/button.dart';
import 'package:blend_bristo/components/carttile.dart';
import 'package:blend_bristo/models/restaurant.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -55,25 +56,38 @@ class CartPage extends StatelessWidget {
),
body: Column(
children: [
userCart.isEmpty ? Expanded(
child: Center(
child: Text(
"Cart is empty.",
style: TextStyle(color: Theme.of(context).colorScheme.secondary),),
),
)
: Expanded(
child: ListView.builder(
itemCount: userCart.length,
itemBuilder: (context, index) {
//get individual cart item
final cartItem = userCart[index];

//return cart title
return MyCartTile(cartItem: cartItem);
}



//cart item list
Expanded(
child: Column(
children: [
userCart.isEmpty ? Expanded(
child: Center(
child: Text(
"Cart is empty.",
style: TextStyle(color: Theme.of(context).colorScheme.secondary),),
),
)
: Expanded(
child: ListView.builder(
itemCount: userCart.length,
itemBuilder: (context, index) {
//get individual cart item
final cartItem = userCart[index];

//return cart title
return MyCartTile(cartItem: cartItem);
}
),
),
],
),
),

//button to pay
MyButton(text: "Go To Checkout", onTap: (){})
],
),
);
Expand Down

0 comments on commit 1907af3

Please sign in to comment.