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

28 lines
889 B

import 'package:flutter/material.dart';
import 'package:thesis_shop/bloc_provider.dart';
class TotalPriceText extends StatelessWidget {
const TotalPriceText({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final cartBloc = AppState.of(context).blocProvider.cartBloc;
return StreamBuilder<double>(
stream: cartBloc.totalPriceStream,
initialData: cartBloc.totalPrice,
builder: (context, snapshot) {
return SafeArea(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Gesamtpreis: ${snapshot.requireData.toStringAsFixed(2)}',
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(fontSize: 24),
),
),
);
});
}
}