diff --git a/lib/screens/cart/cart_item_list.dart b/lib/screens/cart/cart_item_list.dart new file mode 100644 index 0000000..7f72ec9 --- /dev/null +++ b/lib/screens/cart/cart_item_list.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; + +class CartItemList extends StatelessWidget { + const CartItemList({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return DefaultTextStyle.merge( + style: const TextStyle(fontSize: 16, height: 2.5), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Table( + columnWidths: const { + 0: FlexColumnWidth(), + 1: FixedColumnWidth(128), + 2: IntrinsicColumnWidth(), + }, + children: const [ + TableRow(children: [Text('Äpfel'), Text('3x3€'), Text('9€')]), + TableRow(children: [Text('Äpfel'), Text('3x3€'), Text('9€')]), + TableRow(children: [Text('Äpfel'), Text('3x3€'), Text('9€')]) + ], + ), + ), + ); + } +} diff --git a/lib/screens/cart/cart_screen.dart b/lib/screens/cart/cart_screen.dart index 74f5da6..3e7ded1 100644 --- a/lib/screens/cart/cart_screen.dart +++ b/lib/screens/cart/cart_screen.dart @@ -1,6 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:thesis_shop/screens/cart/total_price_text.dart'; import 'package:thesis_shop/widgets/user_switch.dart'; +import 'cart_item_list.dart'; + class CartScreen extends StatelessWidget { const CartScreen({Key? key}) : super(key: key); @@ -11,6 +14,13 @@ class CartScreen extends StatelessWidget { title: const Text('Warenkorb'), actions: [UserSwitch(isOn: true, onChanged: (_) {})], ), + body: Column( + mainAxisSize: MainAxisSize.max, + children: const [ + Expanded(child: CartItemList()), + TotalPriceText(), + ], + ), ); } } diff --git a/lib/screens/cart/total_price_text.dart b/lib/screens/cart/total_price_text.dart new file mode 100644 index 0000000..a08b1e6 --- /dev/null +++ b/lib/screens/cart/total_price_text.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; + +class TotalPriceText extends StatelessWidget { + const TotalPriceText({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'Gesamtpreis: 27€', + style: Theme.of(context).textTheme.labelLarge?.copyWith(fontSize: 24), + ), + ), + ); + } +} diff --git a/lib/screens/product_list/cart_button.dart b/lib/screens/product_list/cart_button.dart index 6e8bfdd..0958bcb 100644 --- a/lib/screens/product_list/cart_button.dart +++ b/lib/screens/product_list/cart_button.dart @@ -9,7 +9,7 @@ class CartButton extends StatelessWidget { return ElevatedButton.icon( onPressed: () => Navigator.of(context).pushRouteKey(RouteKey.cart), icon: const Icon(Icons.shopping_basket), - label: const Text('Warenkorb (2 Produkte)'), + label: const Text('Warenkorb (3 Produkte)'), ); } }