const constructure
This commit is contained in:
@@ -33,7 +33,7 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
(order) {
|
||||
if (context.mounted) {
|
||||
context.read<CheckoutFormBloc>().add(
|
||||
CheckoutFormEvent.started([]),
|
||||
const CheckoutFormEvent.started([]),
|
||||
);
|
||||
context.router.replace(SuccessOrderRoute(order: order));
|
||||
}
|
||||
@@ -52,7 +52,7 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
(order) {
|
||||
if (context.mounted) {
|
||||
context.read<CheckoutFormBloc>().add(
|
||||
CheckoutFormEvent.started([]),
|
||||
const CheckoutFormEvent.started([]),
|
||||
);
|
||||
context.router.replace(SuccessOrderRoute(order: order));
|
||||
}
|
||||
@@ -70,7 +70,7 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
(f) => AppFlushbar.showOrderFailureToast(context, f),
|
||||
(order) {
|
||||
if (context.mounted) {
|
||||
context.router.replace(SuccessAddItemOrderRoute());
|
||||
context.router.replace(const SuccessAddItemOrderRoute());
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -103,7 +103,7 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
price: price,
|
||||
),
|
||||
),
|
||||
SpaceWidth(2),
|
||||
const SpaceWidth(2),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: CheckoutRightPanel(
|
||||
@@ -127,11 +127,16 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
BlocProvider(
|
||||
create: (context) =>
|
||||
getIt<PaymentMethodLoaderBloc>()
|
||||
..add(PaymentMethodLoaderEvent.fetched(isRefresh: true)),
|
||||
..add(const PaymentMethodLoaderEvent.fetched(isRefresh: true)),
|
||||
),
|
||||
BlocProvider(
|
||||
create: (context) => getIt<TableLoaderBloc>()
|
||||
..add(TableLoaderEvent.fetched(isRefresh: true, status: 'available')),
|
||||
..add(
|
||||
const TableLoaderEvent.fetched(
|
||||
isRefresh: true,
|
||||
status: 'available',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: this,
|
||||
|
||||
@@ -36,7 +36,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
checkoutState.orderType.value,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: AppColor.primary,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -62,7 +62,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SpaceWidth(160),
|
||||
const SpaceWidth(160),
|
||||
SizedBox(
|
||||
width: 50.0,
|
||||
child: Text(
|
||||
@@ -95,7 +95,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
||||
itemCount: checkoutState.items.length,
|
||||
),
|
||||
),
|
||||
DashedDivider(color: AppColor.border),
|
||||
const DashedDivider(color: AppColor.border),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
@@ -123,7 +123,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SpaceHeight(8.0),
|
||||
DashedDivider(color: AppColor.border),
|
||||
const DashedDivider(color: AppColor.border),
|
||||
const SpaceHeight(8.0),
|
||||
],
|
||||
),
|
||||
@@ -168,7 +168,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SpaceHeight(8.0),
|
||||
DashedDivider(color: AppColor.border),
|
||||
const DashedDivider(color: AppColor.border),
|
||||
const SpaceHeight(8.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
|
||||
@@ -67,7 +67,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
||||
builder: (context, orderState) {
|
||||
return Column(
|
||||
children: [
|
||||
PageTitle(
|
||||
const PageTitle(
|
||||
title: 'Pembayaran',
|
||||
isBack: false,
|
||||
subtitle: 'Silahkan lakukan pembayaran',
|
||||
@@ -78,7 +78,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.white,
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
@@ -100,7 +100,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.white,
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
@@ -125,7 +125,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
||||
>(
|
||||
builder: (context, state) {
|
||||
if (state.isFetching) {
|
||||
return Center(child: LoaderWithText());
|
||||
return const Center(child: LoaderWithText());
|
||||
}
|
||||
return state.failureOption.fold(
|
||||
() => Wrap(
|
||||
@@ -172,7 +172,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
||||
orderState.paymentMethod!.type == 'cash')
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.white,
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
@@ -261,8 +261,8 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.white,
|
||||
border: Border(
|
||||
top: BorderSide(color: AppColor.border, width: 1.0),
|
||||
@@ -276,7 +276,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
||||
label: 'Batalkan',
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: BlocBuilder<TableLoaderBloc, TableLoaderState>(
|
||||
builder: (context, tableState) {
|
||||
@@ -304,7 +304,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
||||
},
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: AppElevatedButton.filled(
|
||||
isLoading: orderState.isCreatingWithPayment,
|
||||
|
||||
Reference in New Issue
Block a user