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

38 lines
1.1 KiB

2 years ago
import 'package:flutter/material.dart';
2 years ago
import 'package:provider/provider.dart';
import 'package:thesis_shop/models/cart_item.dart';
import 'package:thesis_shop/models/product.dart';
2 years ago
import 'package:thesis_shop/screens/cart/total_price_text.dart';
2 years ago
import 'package:thesis_shop/store/cart_store.dart';
2 years ago
import 'package:thesis_shop/widgets/user_switch.dart';
2 years ago
2 years ago
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),
];
2 years ago
class CartScreen extends StatelessWidget {
const CartScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
2 years ago
final items = context.watch<CartStore>().cart;
2 years ago
return Scaffold(
2 years ago
appBar: AppBar(
title: const Text('Warenkorb'),
2 years ago
actions: const [UserSwitch()],
2 years ago
),
2 years ago
body: Column(
mainAxisSize: MainAxisSize.max,
2 years ago
children: [
Expanded(child: CartItemList(items: items)),
const TotalPriceText(),
2 years ago
],
),
2 years ago
);
}
}