Cleanup code

This commit is contained in:
Moe Poi ~ 2022-04-30 09:44:45 +07:00
parent 70b7154b22
commit 9fa82bf551

View file

@ -12,17 +12,12 @@ class CheckoutItems extends StatefulWidget {
}
class _CheckoutItemsState extends State<CheckoutItems> {
late var orderData;
getData() async {
orderData = await viewCart();
}
@override
Widget build(BuildContext context) {
Future<dynamic> getTotal() async {
dynamic totalPrice = 0;
await getData();
var orderData = await viewCart();
await orderData.forEach((x) async {
var product = await getProduct(x['product_id']);
totalPrice += product[0]['PRICE'] * x['quantity'];