|
|
|
@ -1,22 +1,16 @@ |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:thesis_shop/models/cart_item.dart'; |
|
|
|
|
import 'package:thesis_shop/models/product.dart'; |
|
|
|
|
import 'package:thesis_shop/screens/cart/total_price_text.dart'; |
|
|
|
|
import 'package:thesis_shop/stores/cart_store.dart'; |
|
|
|
|
import 'package:thesis_shop/widgets/user_switch.dart'; |
|
|
|
|
|
|
|
|
|
import 'cart_item_list.dart'; |
|
|
|
|
|
|
|
|
|
const _placeHolderItems = [ |
|
|
|
|
CartItem(product: Product(title: 'Äpfel', price: 3), amount: 3), |
|
|
|
|
CartItem(product: Product(title: 'Äpfel', price: 3), amount: 3), |
|
|
|
|
CartItem(product: Product(title: 'Äpfel', price: 3), amount: 3), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
class CartScreen extends StatelessWidget { |
|
|
|
|
const CartScreen({Key? key}) : super(key: key); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
final cartStore = CartStore.of(context); |
|
|
|
|
return Scaffold( |
|
|
|
|
appBar: AppBar( |
|
|
|
|
title: const Text('Warenkorb'), |
|
|
|
@ -24,8 +18,8 @@ class CartScreen extends StatelessWidget { |
|
|
|
|
), |
|
|
|
|
body: Column( |
|
|
|
|
mainAxisSize: MainAxisSize.max, |
|
|
|
|
children: const [ |
|
|
|
|
Expanded(child: CartItemList(items: _placeHolderItems)), |
|
|
|
|
children: [ |
|
|
|
|
Expanded(child: CartItemList(items: cartStore.cartItems)), |
|
|
|
|
TotalPriceText(), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|