diff --git a/lib/presentation/home/pages/home_page.dart b/lib/presentation/home/pages/home_page.dart index e61d897..f8f8c6c 100644 --- a/lib/presentation/home/pages/home_page.dart +++ b/lib/presentation/home/pages/home_page.dart @@ -1,7 +1,6 @@ // ignore_for_file: public_member_api_docs, sort_constructors_first import 'package:enaklo_pos/core/components/flushbar.dart'; import 'package:enaklo_pos/presentation/home/bloc/current_outlet/current_outlet_bloc.dart'; -import 'package:enaklo_pos/presentation/home/bloc/outlet_loader/outlet_loader_bloc.dart'; import 'package:enaklo_pos/presentation/home/bloc/product_loader/product_loader_bloc.dart'; import 'package:enaklo_pos/presentation/home/widgets/home_right_title.dart'; import 'package:flutter/material.dart'; @@ -355,49 +354,40 @@ class _HomePageState extends State { ), ), Expanded( - child: SingleChildScrollView( - padding: const EdgeInsets.all(16.0).copyWith(top: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BlocBuilder( - builder: (context, state) { - return state.maybeWhen( - orElse: () => const Center( - child: Text('No Items'), - ), - loaded: (products, - discountModel, - discount, - discountAmount, - tax, - serviceCharge, - totalQuantity, - totalPrice, - draftName, - orderType) { - if (products.isEmpty) { - return const Center( - child: Text('No Items'), - ); - } - return ListView.separated( - shrinkWrap: true, - physics: - const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) => - OrderMenu(data: products[index]), - separatorBuilder: (context, index) => - const SpaceHeight(1.0), - itemCount: products.length, - ); - }, - ); - }, + child: BlocBuilder( + builder: (context, state) { + return state.maybeWhen( + orElse: () => const Center( + child: Text('No Items'), ), - const SpaceHeight(8.0), - ], - ), + loaded: (products, + discountModel, + discount, + discountAmount, + tax, + serviceCharge, + totalQuantity, + totalPrice, + draftName, + orderType) { + if (products.isEmpty) { + return const Center( + child: Text('No Items'), + ); + } + return ListView.separated( + shrinkWrap: true, + padding: const EdgeInsets.symmetric( + horizontal: 16), + itemBuilder: (context, index) => + OrderMenu(data: products[index]), + separatorBuilder: (context, index) => + const SpaceHeight(1.0), + itemCount: products.length, + ); + }, + ); + }, ), ), Padding( @@ -498,21 +488,19 @@ class _HomePageState extends State { return state.maybeWhen( orElse: () => Align( alignment: Alignment.bottomCenter, - child: Expanded( - child: Button.filled( - borderRadius: 12, - elevation: 1, - disabled: true, - onPressed: () { - context.push(ConfirmPaymentPage( - isTable: widget.table == null - ? false - : true, - table: widget.table, - )); - }, - label: 'Lanjutkan Pembayaran', - ), + child: Button.filled( + borderRadius: 12, + elevation: 1, + disabled: true, + onPressed: () { + context.push(ConfirmPaymentPage( + isTable: widget.table == null + ? false + : true, + table: widget.table, + )); + }, + label: 'Lanjutkan Pembayaran', ), ), loaded: (items, @@ -527,27 +515,25 @@ class _HomePageState extends State { orderType) => Align( alignment: Alignment.bottomCenter, - child: Expanded( - child: Button.filled( - borderRadius: 12, - elevation: 1, - disabled: items.isEmpty, - onPressed: () { - if (orderType.name == 'dineIn' && - widget.table == null) { - AppFlushbar.showError(context, - 'Mohon pilih meja terlebih dahulu'); - return; - } - context.push(ConfirmPaymentPage( - isTable: widget.table == null - ? false - : true, - table: widget.table, - )); - }, - label: 'Lanjutkan Pembayaran', - ), + child: Button.filled( + borderRadius: 12, + elevation: 1, + disabled: items.isEmpty, + onPressed: () { + if (orderType.name == 'dineIn' && + widget.table == null) { + AppFlushbar.showError(context, + 'Mohon pilih meja terlebih dahulu'); + return; + } + context.push(ConfirmPaymentPage( + isTable: widget.table == null + ? false + : true, + table: widget.table, + )); + }, + label: 'Lanjutkan Pembayaran', ), ), );