const constructure
This commit is contained in:
@@ -10,7 +10,7 @@ class AppIconButton extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
border: Border.all(color: AppColor.border),
|
||||
|
||||
@@ -35,7 +35,7 @@ class CustomerCard extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
const CircleAvatar(
|
||||
radius: 22,
|
||||
backgroundColor: AppColor.primary,
|
||||
child: Icon(Icons.person, color: Colors.white),
|
||||
|
||||
@@ -20,21 +20,21 @@ class ErrorCard extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.error_outline, size: 48, color: Colors.red.shade400),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: Text(
|
||||
message,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.grey.shade600),
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
AppElevatedButton.filled(
|
||||
width: 120,
|
||||
onPressed: onTap,
|
||||
|
||||
@@ -84,7 +84,7 @@ class OrderCard extends StatelessWidget {
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
const CircleAvatar(
|
||||
radius: 22,
|
||||
backgroundColor: AppColor.primary,
|
||||
child: Icon(Icons.person, color: Colors.white),
|
||||
@@ -107,7 +107,7 @@ class OrderCard extends StatelessWidget {
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
const Icon(
|
||||
Icons.table_bar,
|
||||
size: 16,
|
||||
color: AppColor.textSecondary,
|
||||
@@ -145,7 +145,7 @@ class OrderCard extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
(order.createdAt).toFormattedDateTime(),
|
||||
style: TextStyle(color: AppColor.black),
|
||||
style: const TextStyle(color: AppColor.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -182,7 +182,7 @@ class OrderCard extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
(order.status).toUpperCase(),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: AppColor.success,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 12,
|
||||
@@ -199,7 +199,7 @@ class OrderCard extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
(order.status).toUpperCase(),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: AppColor.textSecondary,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 12,
|
||||
|
||||
@@ -50,7 +50,7 @@ class _OrderMenuState extends State<OrderMenu> {
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.0)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||
child: AppNetworkImage(
|
||||
url: widget.data.product.imageUrl,
|
||||
width: 50.0,
|
||||
@@ -150,7 +150,7 @@ class _OrderMenuState extends State<OrderMenu> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceHeight(8.0),
|
||||
const SpaceHeight(8.0),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
@@ -160,7 +160,9 @@ class _OrderMenuState extends State<OrderMenu> {
|
||||
cursorColor: AppColor.primary,
|
||||
controller: _controller,
|
||||
style: const TextStyle(fontSize: 12, color: AppColor.black),
|
||||
decoration: InputDecoration(hintText: 'Catatan Pesanan'),
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Catatan Pesanan',
|
||||
),
|
||||
),
|
||||
),
|
||||
const SpaceWidth(16.0),
|
||||
@@ -180,7 +182,10 @@ class _OrderMenuState extends State<OrderMenu> {
|
||||
color: AppColor.primary,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
child: Icon(Icons.delete_outline, color: AppColor.white),
|
||||
child: const Icon(
|
||||
Icons.delete_outline,
|
||||
color: AppColor.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -13,7 +13,7 @@ class OutletCard extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
||||
margin: EdgeInsets.only(bottom: 12),
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? AppColor.primary.withOpacity(0.1) : AppColor.white,
|
||||
border: Border.all(color: AppColor.primary),
|
||||
@@ -21,8 +21,8 @@ class OutletCard extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.store, color: AppColor.primary),
|
||||
SpaceWidth(12),
|
||||
const Icon(Icons.store, color: AppColor.primary),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -28,7 +28,7 @@ class PaymentCard extends StatelessWidget {
|
||||
),
|
||||
checkmarkColor: AppColor.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(color: AppColor.primary),
|
||||
side: const BorderSide(color: AppColor.primary),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
|
||||
@@ -44,7 +44,7 @@ class ProductCard extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.0)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||
child: product.imageUrl == ""
|
||||
? Container(
|
||||
width: double.infinity,
|
||||
@@ -71,7 +71,7 @@ class ProductCard extends StatelessWidget {
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
@@ -82,7 +82,7 @@ class ProductCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -126,7 +126,7 @@ class ProductCard extends StatelessWidget {
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.0)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||
color: AppColor.disabled.withOpacity(0.5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -45,7 +45,7 @@ class CustomModalDialog extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.primary,
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
|
||||
),
|
||||
@@ -74,9 +74,9 @@ class CustomModalDialog extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
IconButton(
|
||||
icon: Icon(Icons.close, color: AppColor.white),
|
||||
icon: const Icon(Icons.close, color: AppColor.white),
|
||||
onPressed: () {
|
||||
if (onClose != null) {
|
||||
onClose!();
|
||||
|
||||
@@ -68,7 +68,7 @@ class _DeliveryDialogState extends State<DeliveryDialog> {
|
||||
height: 40.0,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
SpaceWidth(12.0),
|
||||
const SpaceWidth(12.0),
|
||||
Expanded(
|
||||
child: Text(
|
||||
delivery.name,
|
||||
@@ -83,7 +83,7 @@ class _DeliveryDialogState extends State<DeliveryDialog> {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
SpaceWidth(12.0),
|
||||
const SpaceWidth(12.0),
|
||||
Icon(
|
||||
Icons.check_circle,
|
||||
color: selectedType?.id == delivery.id
|
||||
|
||||
@@ -17,7 +17,7 @@ class LogoutModalDialog extends StatelessWidget {
|
||||
builder: (context, state) {
|
||||
return CustomModalDialog(
|
||||
title: 'Konfirmasi',
|
||||
contentPadding: EdgeInsets.all(16),
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
bottom: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
@@ -28,7 +28,7 @@ class LogoutModalDialog extends StatelessWidget {
|
||||
label: 'Batal',
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: AppElevatedButton.filled(
|
||||
onPressed: state.isLoggingOut
|
||||
|
||||
@@ -27,7 +27,7 @@ class _OrderAddItemDialogState extends State<OrderAddItemDialog> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
context.read<OrderLoaderBloc>().add(
|
||||
OrderLoaderEvent.fetched(status: 'pending', isRefresh: true),
|
||||
const OrderLoaderEvent.fetched(status: 'pending', isRefresh: true),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class _OrderAddItemDialogState extends State<OrderAddItemDialog> {
|
||||
BlocBuilder<OrderLoaderBloc, OrderLoaderState>(
|
||||
builder: (context, state) {
|
||||
if (state.isFetching) {
|
||||
return Center(child: LoaderWithText());
|
||||
return const Center(child: LoaderWithText());
|
||||
}
|
||||
|
||||
final availableOrders = state.orders;
|
||||
@@ -258,7 +258,7 @@ class _OrderAddItemDialogState extends State<OrderAddItemDialog> {
|
||||
);
|
||||
},
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
BlocBuilder<OrderFormBloc, OrderFormState>(
|
||||
builder: (context, state) {
|
||||
return AppElevatedButton.filled(
|
||||
|
||||
@@ -195,7 +195,7 @@ class OrderPayLaterDialog extends StatelessWidget {
|
||||
Text(
|
||||
searchEntry.isEmpty
|
||||
? "Tidak ada meja tersedia"
|
||||
: "Tidak ditemukan meja dengan '${searchEntry}'",
|
||||
: "Tidak ditemukan meja dengan '$searchEntry'",
|
||||
style: TextStyle(
|
||||
color: Colors.grey.shade600,
|
||||
fontSize: 14,
|
||||
@@ -233,7 +233,7 @@ class OrderPayLaterDialog extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
BlocBuilder<OrderFormBloc, OrderFormState>(
|
||||
builder: (context, orderState) {
|
||||
return AppElevatedButton.filled(
|
||||
|
||||
@@ -29,7 +29,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
minWidth: context.deviceWidth * 0.5,
|
||||
minHeight: context.deviceHeight * 0.8,
|
||||
bottom: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -38,7 +38,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
label: 'Batalkan',
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: AppElevatedButton.filled(
|
||||
isLoading: state.isCreating,
|
||||
@@ -63,7 +63,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.textSecondary.withOpacity(0.05),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
@@ -75,7 +75,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
if (checkoutState.items.isNotEmpty) ...[
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
@@ -87,22 +87,22 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(6),
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.primary,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.list_alt_rounded,
|
||||
color: AppColor.white,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Item yang akan dipesan:',
|
||||
style: AppStyle.md.copyWith(
|
||||
@@ -114,10 +114,10 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
constraints: BoxConstraints(maxHeight: 120),
|
||||
constraints: const BoxConstraints(maxHeight: 120),
|
||||
child: Scrollbar(
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.only(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16,
|
||||
right: 16,
|
||||
bottom: 16,
|
||||
@@ -125,8 +125,8 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
child: Column(
|
||||
children: checkoutState.items.map((item) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 6),
|
||||
padding: EdgeInsets.all(10),
|
||||
margin: const EdgeInsets.only(bottom: 6),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
@@ -134,7 +134,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.03),
|
||||
blurRadius: 2,
|
||||
offset: Offset(0, 1),
|
||||
offset: const Offset(0, 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -143,12 +143,12 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
Container(
|
||||
width: 6,
|
||||
height: 6,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.primary,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
@@ -172,7 +172,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 2,
|
||||
),
|
||||
|
||||
@@ -39,14 +39,14 @@ class OrderSaveDialog extends StatelessWidget {
|
||||
context.maybePop();
|
||||
|
||||
if (checkoutState.orderType == OrderType.dineIn) {
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => OrderPayLaterDialog(tables: tables),
|
||||
);
|
||||
});
|
||||
} else {
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
@@ -56,7 +56,7 @@ class OrderSaveDialog extends StatelessWidget {
|
||||
}
|
||||
},
|
||||
),
|
||||
SpaceHeight(16.0),
|
||||
const SpaceHeight(16.0),
|
||||
_item(
|
||||
icon: Icons.shopping_cart_checkout_outlined,
|
||||
title: 'Tambahkan Pesanan',
|
||||
@@ -92,7 +92,7 @@ class OrderSaveDialog extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, color: AppColor.primary, size: 26.0),
|
||||
SpaceWidth(12.0),
|
||||
const SpaceWidth(12.0),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -21,7 +21,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
return CustomModalDialog(
|
||||
title: 'Konfirmasi Void',
|
||||
subtitle: 'Tindakan ini tidak dapat dibatalkan',
|
||||
contentPadding: EdgeInsets.all(16),
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
bottom: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Row(
|
||||
@@ -37,7 +37,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
child: AppElevatedButton.filled(
|
||||
onPressed: () {
|
||||
context.read<VoidFormBloc>().add(
|
||||
VoidFormEvent.submitted(),
|
||||
const VoidFormEvent.submitted(),
|
||||
);
|
||||
},
|
||||
label: state.voidType.isAll ? 'Void Pesanan' : 'Void Item',
|
||||
@@ -60,7 +60,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
|
||||
if (state.voidType.isItem &&
|
||||
state.selectedItemQuantities.isNotEmpty) ...[
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Items section
|
||||
Container(
|
||||
@@ -74,22 +74,22 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(6),
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.primary.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.list_alt_rounded,
|
||||
color: AppColor.primary,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Item yang akan divoid:',
|
||||
style: AppStyle.md.copyWith(
|
||||
@@ -101,10 +101,10 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
constraints: BoxConstraints(maxHeight: 120),
|
||||
constraints: const BoxConstraints(maxHeight: 120),
|
||||
child: Scrollbar(
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.only(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16,
|
||||
right: 16,
|
||||
bottom: 16,
|
||||
@@ -117,8 +117,8 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
(item) => item.id == entry.key,
|
||||
);
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 6),
|
||||
padding: EdgeInsets.all(10),
|
||||
margin: const EdgeInsets.only(bottom: 6),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
@@ -128,7 +128,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
0.03,
|
||||
),
|
||||
blurRadius: 2,
|
||||
offset: Offset(0, 1),
|
||||
offset: const Offset(0, 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -137,12 +137,12 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
Container(
|
||||
width: 6,
|
||||
height: 6,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.primary,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
@@ -169,7 +169,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 2,
|
||||
),
|
||||
@@ -201,11 +201,11 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
],
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
// Reason section
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue[50],
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@@ -215,18 +215,18 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(6),
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.info.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.note_alt_rounded,
|
||||
color: AppColor.info,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -239,7 +239,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 2),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
state.voidReason ?? "",
|
||||
style: TextStyle(
|
||||
|
||||
@@ -89,7 +89,7 @@ class OrderTypeDialog extends StatelessWidget {
|
||||
? AppColor.white
|
||||
: AppColor.black,
|
||||
),
|
||||
SpaceWidth(12.0),
|
||||
const SpaceWidth(12.0),
|
||||
Expanded(
|
||||
child: Text(
|
||||
type['label']!,
|
||||
@@ -103,7 +103,7 @@ class OrderTypeDialog extends StatelessWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
SpaceWidth(12.0),
|
||||
const SpaceWidth(12.0),
|
||||
Icon(
|
||||
Icons.check_circle,
|
||||
color: selectedType == type['value']
|
||||
|
||||
@@ -12,7 +12,7 @@ class _OutletDialogState extends State<OutletDialog> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
context.read<OutletLoaderBloc>().add(
|
||||
OutletLoaderEvent.fetched(isRefresh: true),
|
||||
const OutletLoaderEvent.fetched(isRefresh: true),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class _OutletDialogState extends State<OutletDialog> {
|
||||
child: BlocBuilder<OutletLoaderBloc, OutletLoaderState>(
|
||||
builder: (context, state) {
|
||||
if (state.isFetching) {
|
||||
return LoaderWithText();
|
||||
return const LoaderWithText();
|
||||
}
|
||||
|
||||
return Column(
|
||||
@@ -46,8 +46,11 @@ class _OutletDialogState extends State<OutletDialog> {
|
||||
),
|
||||
),
|
||||
),
|
||||
SpaceHeight(24),
|
||||
AppElevatedButton.filled(onPressed: null, label: 'Terapkan'),
|
||||
const SpaceHeight(24),
|
||||
const AppElevatedButton.filled(
|
||||
onPressed: null,
|
||||
label: 'Terapkan',
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
@@ -13,7 +13,9 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
loadPermissionBluetooth();
|
||||
context.read<BluetoothLoaderBloc>().add(BluetoothLoaderEvent.fetched());
|
||||
context.read<BluetoothLoaderBloc>().add(
|
||||
const BluetoothLoaderEvent.fetched(),
|
||||
);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -21,13 +23,13 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
|
||||
Widget build(BuildContext context) {
|
||||
return CustomModalDialog(
|
||||
title: 'Bluetooth',
|
||||
contentPadding: EdgeInsets.all(16),
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
minHeight: context.deviceHeight * 0.6,
|
||||
minWidth: context.deviceWidth * 0.4,
|
||||
child: BlocBuilder<BluetoothLoaderBloc, BluetoothLoaderState>(
|
||||
builder: (context, state) {
|
||||
if (state.isFetching) {
|
||||
return Center(child: LoaderWithText());
|
||||
return const Center(child: LoaderWithText());
|
||||
}
|
||||
|
||||
if (state.bluetoothDevices.isEmpty) {
|
||||
@@ -50,7 +52,7 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(color: AppColor.border, width: 1),
|
||||
),
|
||||
@@ -66,7 +68,7 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Text(
|
||||
item.macAdress,
|
||||
style: AppStyle.sm.copyWith(
|
||||
|
||||
@@ -31,7 +31,7 @@ class TableCreateDialog extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
AppTextFormField(
|
||||
label: 'Kapasitas',
|
||||
keyboardType: TextInputType.number,
|
||||
@@ -41,7 +41,7 @@ class TableCreateDialog extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
AppElevatedButton.filled(
|
||||
onPressed: () {
|
||||
context.read<TableFormBloc>().add(
|
||||
|
||||
@@ -29,7 +29,7 @@ class _TableTransferDialogState extends State<TableTransferDialog> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
context.read<TableLoaderBloc>().add(
|
||||
TableLoaderEvent.fetched(isRefresh: true, status: 'available'),
|
||||
const TableLoaderEvent.fetched(isRefresh: true, status: 'available'),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class _TableTransferDialogState extends State<TableTransferDialog> {
|
||||
final availableTables = state.tables;
|
||||
|
||||
if (state.isFetching) {
|
||||
return Center(child: const LoaderWithText());
|
||||
return const Center(child: LoaderWithText());
|
||||
}
|
||||
|
||||
if (selectTable == null && availableTables.isNotEmpty) {
|
||||
@@ -252,7 +252,7 @@ class _TableTransferDialogState extends State<TableTransferDialog> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
BlocBuilder<TableFormBloc, TableFormState>(
|
||||
builder: (context, state) {
|
||||
return AppElevatedButton.filled(
|
||||
|
||||
@@ -10,7 +10,7 @@ class VariantDialog extends StatelessWidget {
|
||||
title: 'Pilih Varian',
|
||||
subtitle: 'Silahkan pilih varian yang sesuai',
|
||||
minWidth: context.deviceWidth * 0.4,
|
||||
contentPadding: EdgeInsets.all(16),
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
child: Wrap(
|
||||
spacing: 12,
|
||||
runSpacing: 12,
|
||||
@@ -44,7 +44,7 @@ class VariantDialog extends StatelessWidget {
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
variant.priceModifier.currencyFormatRpV2,
|
||||
style: TextStyle(color: AppColor.black),
|
||||
style: const TextStyle(color: AppColor.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -17,7 +17,7 @@ class PaymentMethodErrorStateWidget extends StatelessWidget {
|
||||
message: 'Terjadi Kesalahan saat memuat metode pembayaran',
|
||||
onTap: () {
|
||||
context.read<PaymentMethodLoaderBloc>().add(
|
||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -26,7 +26,7 @@ class PaymentMethodErrorStateWidget extends StatelessWidget {
|
||||
message: value.erroMessage,
|
||||
onTap: () {
|
||||
context.read<PaymentMethodLoaderBloc>().add(
|
||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -36,7 +36,7 @@ class PaymentMethodErrorStateWidget extends StatelessWidget {
|
||||
'Metode pembayaran masih kosong, silahkan tambahkan metode pembayaran',
|
||||
onTap: () {
|
||||
context.read<PaymentMethodLoaderBloc>().add(
|
||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -45,7 +45,7 @@ class PaymentMethodErrorStateWidget extends StatelessWidget {
|
||||
message: 'Terjadi Kesalahan saat memuat metode pembayaran',
|
||||
onTap: () {
|
||||
context.read<PaymentMethodLoaderBloc>().add(
|
||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -54,7 +54,7 @@ class PaymentMethodErrorStateWidget extends StatelessWidget {
|
||||
message: value.erroMessage,
|
||||
onTap: () {
|
||||
context.read<PaymentMethodLoaderBloc>().add(
|
||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -63,7 +63,7 @@ class PaymentMethodErrorStateWidget extends StatelessWidget {
|
||||
message: 'Terjadi Kesalahan saat memuat metode pembayaran',
|
||||
onTap: () {
|
||||
context.read<PaymentMethodLoaderBloc>().add(
|
||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -21,7 +21,7 @@ class _CustomerAutocompleteState extends State<CustomerAutocomplete> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
context.read<CustomerLoaderBloc>().add(CustomerLoaderEvent.fetched());
|
||||
context.read<CustomerLoaderBloc>().add(const CustomerLoaderEvent.fetched());
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -18,7 +18,7 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
||||
final bool isRequired;
|
||||
|
||||
const AppDropdownSearch({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.label,
|
||||
required this.hintText,
|
||||
required this.items,
|
||||
@@ -34,7 +34,7 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
||||
this.itemBuilder,
|
||||
this.showSearchBox = true,
|
||||
this.isRequired = false,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -46,14 +46,14 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
if (isRequired)
|
||||
Text(
|
||||
const Text(
|
||||
' *',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
@@ -74,7 +74,10 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
||||
dropdownDecoratorProps: DropDownDecoratorProps(
|
||||
dropdownSearchDecoration: InputDecoration(
|
||||
hintText: hintText,
|
||||
hintStyle: TextStyle(color: AppColor.textSecondary, fontSize: 14),
|
||||
hintStyle: const TextStyle(
|
||||
color: AppColor.textSecondary,
|
||||
fontSize: 14,
|
||||
),
|
||||
prefixIcon: Icon(
|
||||
prefixIcon,
|
||||
color: AppColor.textSecondary,
|
||||
@@ -82,23 +85,29 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: AppColor.border, width: 1.5),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.border,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: AppColor.border, width: 1.5),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.border,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: AppColor.primary, width: 2),
|
||||
borderSide: const BorderSide(color: AppColor.primary, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: AppColor.error, width: 1.5),
|
||||
borderSide: const BorderSide(color: AppColor.error, width: 1.5),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: AppColor.error, width: 2),
|
||||
borderSide: const BorderSide(color: AppColor.error, width: 2),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
|
||||
@@ -64,7 +64,7 @@ class _AppPasswordTextFormFieldState extends State<AppPasswordTextFormField> {
|
||||
prefixIcon: widget.prefixIcon,
|
||||
suffixIcon: isPasswordVisible
|
||||
? IconButton(
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
Icons.visibility,
|
||||
color: AppColor.textSecondary,
|
||||
size: 20,
|
||||
@@ -78,7 +78,7 @@ class _AppPasswordTextFormFieldState extends State<AppPasswordTextFormField> {
|
||||
},
|
||||
)
|
||||
: IconButton(
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
Icons.visibility_off,
|
||||
color: AppColor.textSecondary,
|
||||
size: 20,
|
||||
|
||||
@@ -52,7 +52,10 @@ class AppTextFormField extends StatelessWidget {
|
||||
maxLines: maxLines,
|
||||
validator: validator,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 4, horizontal: 12),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
vertical: 4,
|
||||
horizontal: 12,
|
||||
),
|
||||
prefixIcon: prefixIcon,
|
||||
suffixIcon: suffixIcon,
|
||||
hintText: label,
|
||||
|
||||
@@ -12,8 +12,8 @@ class LoaderWithText extends StatelessWidget {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SpinKitFadingCircle(color: AppColor.primary, size: 24),
|
||||
SpaceWidth(10),
|
||||
const SpinKitFadingCircle(color: AppColor.primary, size: 24),
|
||||
const SpaceWidth(10),
|
||||
Text(
|
||||
'Loading...',
|
||||
style: AppStyle.md.copyWith(
|
||||
|
||||
@@ -28,7 +28,7 @@ class PageTitle extends StatelessWidget {
|
||||
Container(
|
||||
height: context.deviceHeight * 0.123,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.white,
|
||||
border: Border(
|
||||
bottom: BorderSide(color: AppColor.border, width: 1.0),
|
||||
@@ -39,13 +39,13 @@ class PageTitle extends StatelessWidget {
|
||||
if (isBack) ...[
|
||||
GestureDetector(
|
||||
onTap: () => context.router.maybePop(),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.arrow_back,
|
||||
color: AppColor.primary,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
const SpaceWidth(16),
|
||||
],
|
||||
Expanded(
|
||||
child: Column(
|
||||
|
||||
@@ -213,16 +213,9 @@ class _DateRangePickerDialogState extends State<_DateRangePickerDialog>
|
||||
// ── Header ──────────────────────────────────────────
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
widget.primaryColor,
|
||||
widget.primaryColor.withOpacity(0.8),
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: const BorderRadius.only(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.primary,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
@@ -254,7 +247,7 @@ class _DateRangePickerDialogState extends State<_DateRangePickerDialog>
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
|
||||
// ── TableCalendar ────────────────────────────
|
||||
Padding(
|
||||
|
||||
@@ -27,7 +27,7 @@ class CustomTabBar extends StatelessWidget {
|
||||
isScrollable: true,
|
||||
tabAlignment: TabAlignment.start,
|
||||
labelColor: AppColor.primary,
|
||||
labelStyle: TextStyle(fontWeight: FontWeight.bold),
|
||||
labelStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||
dividerColor: AppColor.border,
|
||||
unselectedLabelColor: AppColor.primary,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../../../../common/data/report_menu.dart';
|
||||
import '../../../../common/extension/extension.dart';
|
||||
@@ -32,7 +31,7 @@ class ReportHeader extends StatelessWidget {
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Text(
|
||||
menu.subtitle,
|
||||
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||
|
||||
@@ -37,7 +37,7 @@ class ReportSummaryCard extends StatelessWidget {
|
||||
),
|
||||
child: Icon(icon, color: color, size: 22),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -49,7 +49,7 @@ class ReportSummaryCard extends StatelessWidget {
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Text(
|
||||
title,
|
||||
style: AppStyle.sm.copyWith(
|
||||
@@ -58,7 +58,7 @@ class ReportSummaryCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
if (subtitle != null) ...[
|
||||
SpaceHeight(2),
|
||||
const SpaceHeight(2),
|
||||
Text(
|
||||
subtitle!,
|
||||
style: AppStyle.sm.copyWith(
|
||||
|
||||
Reference in New Issue
Block a user