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/total_price_text.dart

23 lines
674 B

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:thesis_shop/store/cart_store.dart';
class TotalPriceText extends StatelessWidget {
const TotalPriceText({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final totalPrice = context
.select<CartStore, double>((store) => store.totalPrice)
.toStringAsFixed(2);
return SafeArea(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Gesamtpreis: $totalPrice',
style: Theme.of(context).textTheme.labelLarge?.copyWith(fontSize: 24),
),
),
);
}
}