1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
thesis_shop/lib/screens/cart/cart_screen.dart

37 lines
1.1 KiB

import 'package:flutter/material.dart';
import 'package:provider/provider.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/store/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 items = context.watch<CartStore>().cart;
return Scaffold(
appBar: AppBar(
title: const Text('Warenkorb'),
actions: const [UserSwitch()],
),
body: Column(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(child: CartItemList(items: items)),
const TotalPriceText(),
],
),
);
}
}