const constructure
This commit is contained in:
parent
5058f99fe0
commit
e625bd3d2a
@ -4,6 +4,9 @@ linter:
|
|||||||
rules:
|
rules:
|
||||||
sort_pub_dependencies: false
|
sort_pub_dependencies: false
|
||||||
prefer_relative_imports: true
|
prefer_relative_imports: true
|
||||||
|
prefer_const_constructors: true
|
||||||
|
prefer_const_literals_to_create_immutables: true
|
||||||
|
prefer_const_declarations: true
|
||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
errors:
|
errors:
|
||||||
|
|||||||
@ -33,16 +33,16 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
|||||||
state.copyWith(
|
state.copyWith(
|
||||||
failureOption: optionOf(f),
|
failureOption: optionOf(f),
|
||||||
status: token
|
status: token
|
||||||
? AuthStatus.authenticated()
|
? const AuthStatus.authenticated()
|
||||||
: AuthStatus.unauthenticated(),
|
: const AuthStatus.unauthenticated(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(user) => emit(
|
(user) => emit(
|
||||||
state.copyWith(
|
state.copyWith(
|
||||||
user: user,
|
user: user,
|
||||||
status: token
|
status: token
|
||||||
? AuthStatus.authenticated()
|
? const AuthStatus.authenticated()
|
||||||
: AuthStatus.unauthenticated(),
|
: const AuthStatus.unauthenticated(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -175,7 +175,7 @@ class CategoryLoaderBloc
|
|||||||
_searchDebounce?.cancel();
|
_searchDebounce?.cancel();
|
||||||
|
|
||||||
// Debounce search for better UX
|
// Debounce search for better UX
|
||||||
_searchDebounce = Timer(Duration(milliseconds: 300), () async {
|
_searchDebounce = Timer(const Duration(milliseconds: 300), () async {
|
||||||
emit(state.copyWith(isLoadingMore: true));
|
emit(state.copyWith(isLoadingMore: true));
|
||||||
_isLoadingMore = false;
|
_isLoadingMore = false;
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ class CategoryLoaderBloc
|
|||||||
);
|
);
|
||||||
|
|
||||||
// After sync error, try to load local data
|
// After sync error, try to load local data
|
||||||
Timer(Duration(seconds: 2), () {
|
Timer(const Duration(seconds: 2), () {
|
||||||
add(const CategoryLoaderEvent.getCategories());
|
add(const CategoryLoaderEvent.getCategories());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -251,7 +251,7 @@ class CategoryLoaderBloc
|
|||||||
);
|
);
|
||||||
|
|
||||||
// After successful sync, load the updated data
|
// After successful sync, load the updated data
|
||||||
Timer(Duration(seconds: 1), () {
|
Timer(const Duration(seconds: 1), () {
|
||||||
add(const CategoryLoaderEvent.getCategories());
|
add(const CategoryLoaderEvent.getCategories());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -43,7 +43,7 @@ class ProductLoaderBloc extends Bloc<ProductLoaderEvent, ProductLoaderState> {
|
|||||||
state.copyWith(
|
state.copyWith(
|
||||||
isLoadingMore: false,
|
isLoadingMore: false,
|
||||||
failureOptionProduct: optionOf(
|
failureOptionProduct: optionOf(
|
||||||
ProductFailure.dynamicErrorMessage(
|
const ProductFailure.dynamicErrorMessage(
|
||||||
'Database lokal belum siap. Silakan lakukan sinkronisasi data terlebih dahulu.',
|
'Database lokal belum siap. Silakan lakukan sinkronisasi data terlebih dahulu.',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,27 +1,27 @@
|
|||||||
part of 'theme.dart';
|
part of 'theme.dart';
|
||||||
|
|
||||||
class AppStyle {
|
class AppStyle {
|
||||||
static TextStyle xs = TextStyle(color: AppColor.black, fontSize: 11);
|
static TextStyle xs = const TextStyle(color: AppColor.black, fontSize: 11);
|
||||||
|
|
||||||
static TextStyle sm = TextStyle(color: AppColor.black, fontSize: 12);
|
static TextStyle sm = const TextStyle(color: AppColor.black, fontSize: 12);
|
||||||
|
|
||||||
static TextStyle md = TextStyle(color: AppColor.black, fontSize: 14);
|
static TextStyle md = const TextStyle(color: AppColor.black, fontSize: 14);
|
||||||
|
|
||||||
static TextStyle lg = TextStyle(color: AppColor.black, fontSize: 16);
|
static TextStyle lg = const TextStyle(color: AppColor.black, fontSize: 16);
|
||||||
|
|
||||||
static TextStyle xl = TextStyle(color: AppColor.black, fontSize: 18);
|
static TextStyle xl = const TextStyle(color: AppColor.black, fontSize: 18);
|
||||||
|
|
||||||
static TextStyle xxl = TextStyle(color: AppColor.black, fontSize: 20);
|
static TextStyle xxl = const TextStyle(color: AppColor.black, fontSize: 20);
|
||||||
|
|
||||||
static TextStyle h6 = TextStyle(color: AppColor.black, fontSize: 22);
|
static TextStyle h6 = const TextStyle(color: AppColor.black, fontSize: 22);
|
||||||
|
|
||||||
static TextStyle h5 = TextStyle(color: AppColor.black, fontSize: 24);
|
static TextStyle h5 = const TextStyle(color: AppColor.black, fontSize: 24);
|
||||||
|
|
||||||
static TextStyle h4 = TextStyle(color: AppColor.black, fontSize: 26);
|
static TextStyle h4 = const TextStyle(color: AppColor.black, fontSize: 26);
|
||||||
|
|
||||||
static TextStyle h3 = TextStyle(color: AppColor.black, fontSize: 28);
|
static TextStyle h3 = const TextStyle(color: AppColor.black, fontSize: 28);
|
||||||
|
|
||||||
static TextStyle h2 = TextStyle(color: AppColor.black, fontSize: 30);
|
static TextStyle h2 = const TextStyle(color: AppColor.black, fontSize: 30);
|
||||||
|
|
||||||
static TextStyle h1 = TextStyle(color: AppColor.black, fontSize: 32);
|
static TextStyle h1 = const TextStyle(color: AppColor.black, fontSize: 32);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
part of 'theme.dart';
|
part of 'theme.dart';
|
||||||
|
|
||||||
class AppValue {
|
class AppValue {}
|
||||||
// TODO: define value
|
|
||||||
}
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class ThemeApp {
|
|||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
primaryColor: AppColor.primary,
|
primaryColor: AppColor.primary,
|
||||||
scaffoldBackgroundColor: AppColor.white,
|
scaffoldBackgroundColor: AppColor.white,
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: const AppBarTheme(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
titleTextStyle: TextStyle(
|
titleTextStyle: TextStyle(
|
||||||
@ -19,7 +19,7 @@ class ThemeApp {
|
|||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
iconTheme: const IconThemeData(color: AppColor.primary),
|
iconTheme: IconThemeData(color: AppColor.primary),
|
||||||
),
|
),
|
||||||
fontFamily: FontFamily.quicksand,
|
fontFamily: FontFamily.quicksand,
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: AppColor.primary),
|
colorScheme: ColorScheme.fromSeed(seedColor: AppColor.primary),
|
||||||
@ -28,19 +28,19 @@ class ThemeApp {
|
|||||||
hintStyle: const TextStyle(color: AppColor.textSecondary),
|
hintStyle: const TextStyle(color: AppColor.textSecondary),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
borderSide: BorderSide(color: AppColor.borderDark),
|
borderSide: const BorderSide(color: AppColor.borderDark),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
borderSide: BorderSide(color: AppColor.primary),
|
borderSide: const BorderSide(color: AppColor.primary),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
borderSide: BorderSide(color: AppColor.borderDark),
|
borderSide: const BorderSide(color: AppColor.borderDark),
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
borderSide: BorderSide(color: AppColor.error),
|
borderSide: const BorderSide(color: AppColor.error),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -89,6 +89,7 @@ class ProductAnalyticCategoryItem with _$ProductAnalyticCategoryItem {
|
|||||||
required int totalRevenue,
|
required int totalRevenue,
|
||||||
}) = _ProductAnalyticCategoryItem;
|
}) = _ProductAnalyticCategoryItem;
|
||||||
|
|
||||||
|
// ignore: prefer_const_constructors
|
||||||
factory ProductAnalyticCategoryItem.empty() => ProductAnalyticCategoryItem(
|
factory ProductAnalyticCategoryItem.empty() => ProductAnalyticCategoryItem(
|
||||||
categoryName: '',
|
categoryName: '',
|
||||||
productCount: 0,
|
productCount: 0,
|
||||||
|
|||||||
@ -10,8 +10,8 @@ class ListCustomer with _$ListCustomer {
|
|||||||
required int totalPages,
|
required int totalPages,
|
||||||
}) = _ListCustomer;
|
}) = _ListCustomer;
|
||||||
|
|
||||||
factory ListCustomer.empty() => ListCustomer(
|
factory ListCustomer.empty() => const ListCustomer(
|
||||||
customers: const [],
|
customers: [],
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
page: 0,
|
page: 0,
|
||||||
limit: 0,
|
limit: 0,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class AddItemOrderRequest with _$AddItemOrderRequest {
|
|||||||
required String notes,
|
required String notes,
|
||||||
}) = _AddItemOrderRequest;
|
}) = _AddItemOrderRequest;
|
||||||
|
|
||||||
factory AddItemOrderRequest.empty() => AddItemOrderRequest(
|
factory AddItemOrderRequest.empty() => const AddItemOrderRequest(
|
||||||
productId: '',
|
productId: '',
|
||||||
productVariantId: '',
|
productVariantId: '',
|
||||||
quantity: 0,
|
quantity: 0,
|
||||||
|
|||||||
@ -10,8 +10,13 @@ class ListOrder with _$ListOrder {
|
|||||||
required int totalPages,
|
required int totalPages,
|
||||||
}) = _ListOrder;
|
}) = _ListOrder;
|
||||||
|
|
||||||
factory ListOrder.empty() =>
|
factory ListOrder.empty() => const ListOrder(
|
||||||
ListOrder(orders: [], totalCount: 0, page: 0, limit: 0, totalPages: 0);
|
orders: [],
|
||||||
|
totalCount: 0,
|
||||||
|
page: 0,
|
||||||
|
limit: 0,
|
||||||
|
totalPages: 0,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class ListPaymentMethod with _$ListPaymentMethod {
|
|||||||
required int totalPages,
|
required int totalPages,
|
||||||
}) = _ListPaymentMethod;
|
}) = _ListPaymentMethod;
|
||||||
|
|
||||||
factory ListPaymentMethod.empty() => ListPaymentMethod(
|
factory ListPaymentMethod.empty() => const ListPaymentMethod(
|
||||||
paymentMethods: [],
|
paymentMethods: [],
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
page: 0,
|
page: 0,
|
||||||
|
|||||||
@ -10,8 +10,13 @@ class ListTable with _$ListTable {
|
|||||||
required int totalPages,
|
required int totalPages,
|
||||||
}) = _ListTable;
|
}) = _ListTable;
|
||||||
|
|
||||||
factory ListTable.empty() =>
|
factory ListTable.empty() => const ListTable(
|
||||||
ListTable(tables: [], totalCount: 0, page: 0, limit: 0, totalPages: 0);
|
tables: [],
|
||||||
|
totalCount: 0,
|
||||||
|
page: 0,
|
||||||
|
limit: 0,
|
||||||
|
totalPages: 0,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class AnalyticRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(AnalyticFailure.unexpectedError());
|
return DC.error(const AnalyticFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final dashboard = DashboardAnalyticDto.fromJson(
|
final dashboard = DashboardAnalyticDto.fromJson(
|
||||||
@ -65,7 +65,7 @@ class AnalyticRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(AnalyticFailure.unexpectedError());
|
return DC.error(const AnalyticFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final sales = SalesAnalyticDto.fromJson(
|
final sales = SalesAnalyticDto.fromJson(
|
||||||
@ -94,7 +94,7 @@ class AnalyticRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(AnalyticFailure.unexpectedError());
|
return DC.error(const AnalyticFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final products = ProductAnalyticDto.fromJson(
|
final products = ProductAnalyticDto.fromJson(
|
||||||
@ -123,7 +123,7 @@ class AnalyticRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(AnalyticFailure.unexpectedError());
|
return DC.error(const AnalyticFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final paymentMethods = PaymentMethodAnalyticDto.fromJson(
|
final paymentMethods = PaymentMethodAnalyticDto.fromJson(
|
||||||
@ -152,7 +152,7 @@ class AnalyticRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(AnalyticFailure.unexpectedError());
|
return DC.error(const AnalyticFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final profitLoss = ProfitLossAnalyticDto.fromJson(
|
final profitLoss = ProfitLossAnalyticDto.fromJson(
|
||||||
@ -181,7 +181,7 @@ class AnalyticRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(AnalyticFailure.unexpectedError());
|
return DC.error(const AnalyticFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final categories = CategoryAnalyticDto.fromJson(
|
final categories = CategoryAnalyticDto.fromJson(
|
||||||
@ -211,7 +211,7 @@ class AnalyticRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(AnalyticFailure.unexpectedError());
|
return DC.error(const AnalyticFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final inventory = InventoryAnalyticDto.fromJson(
|
final inventory = InventoryAnalyticDto.fromJson(
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AuthRemoteDataProvider {
|
|||||||
|
|
||||||
if (response.data['code'] == 401) {
|
if (response.data['code'] == 401) {
|
||||||
return DC.error(
|
return DC.error(
|
||||||
AuthFailure.serverError(
|
const AuthFailure.serverError(
|
||||||
ApiFailure.unauthorized('Incorrect email or password'),
|
ApiFailure.unauthorized('Incorrect email or password'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -52,7 +52,7 @@ class AuthRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(AuthFailure.unexpectedError());
|
return DC.error(const AuthFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
return DC.data(unit);
|
return DC.data(unit);
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: prefer_const_constructors
|
||||||
|
|
||||||
part of '../auth_dtos.dart';
|
part of '../auth_dtos.dart';
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
|
|||||||
@ -17,7 +17,9 @@ class CategoryLocalDataProvider {
|
|||||||
CategoryLocalDataProvider(this._databaseHelper);
|
CategoryLocalDataProvider(this._databaseHelper);
|
||||||
|
|
||||||
final Map<String, List<CategoryDto>> _queryCache = {};
|
final Map<String, List<CategoryDto>> _queryCache = {};
|
||||||
final Duration _cacheExpiry = Duration(minutes: AppConstant.cacheExpire);
|
final Duration _cacheExpiry = const Duration(
|
||||||
|
minutes: AppConstant.cacheExpire,
|
||||||
|
);
|
||||||
final Map<String, DateTime> _cacheTimestamps = {};
|
final Map<String, DateTime> _cacheTimestamps = {};
|
||||||
|
|
||||||
Future<DC<CategoryFailure, void>> saveCategoriesBatch(
|
Future<DC<CategoryFailure, void>> saveCategoriesBatch(
|
||||||
@ -203,7 +205,7 @@ class CategoryLocalDataProvider {
|
|||||||
|
|
||||||
if (maps.isEmpty) {
|
if (maps.isEmpty) {
|
||||||
log('❌ Category not found: $id', name: _logName);
|
log('❌ Category not found: $id', name: _logName);
|
||||||
return DC.error(CategoryFailure.empty());
|
return DC.error(const CategoryFailure.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
final category = CategoryDto.fromMap(maps.first);
|
final category = CategoryDto.fromMap(maps.first);
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class CategoryRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['data'] == null) {
|
if (response.data['data'] == null) {
|
||||||
return DC.error(CategoryFailure.empty());
|
return DC.error(const CategoryFailure.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
final categories = ListCategoryDto.fromJson(
|
final categories = ListCategoryDto.fromJson(
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class CustomerRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(CustomerFailure.unexpectedError());
|
return DC.error(const CustomerFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final customers = ListCustomerDto.fromJson(
|
final customers = ListCustomerDto.fromJson(
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final orders = ListOrderDto.fromJson(
|
final orders = ListOrderDto.fromJson(
|
||||||
@ -68,7 +68,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final order = OrderDto.fromJson(
|
final order = OrderDto.fromJson(
|
||||||
@ -93,7 +93,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final order = OrderDto.fromJson(
|
final order = OrderDto.fromJson(
|
||||||
@ -119,7 +119,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
} else {
|
} else {
|
||||||
final order = OrderDto.fromJson(
|
final order = OrderDto.fromJson(
|
||||||
response.data['data'] as Map<String, dynamic>,
|
response.data['data'] as Map<String, dynamic>,
|
||||||
@ -161,7 +161,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final payment = PaymentDto.fromJson(
|
final payment = PaymentDto.fromJson(
|
||||||
@ -190,7 +190,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final order = OrderDto.fromJson(
|
final order = OrderDto.fromJson(
|
||||||
@ -227,7 +227,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
return DC.data(unit);
|
return DC.data(unit);
|
||||||
@ -249,7 +249,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final payment = PaymentDto.fromJson(
|
final payment = PaymentDto.fromJson(
|
||||||
@ -276,7 +276,7 @@ class OrderRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(OrderFailure.unexpectedError());
|
return DC.error(const OrderFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
return DC.data(unit);
|
return DC.data(unit);
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class OutletRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['data'] == null) {
|
if (response.data['data'] == null) {
|
||||||
return DC.error(OutletFailure.empty());
|
return DC.error(const OutletFailure.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
final outlets = (response.data['data']['outlets'] as List)
|
final outlets = (response.data['data']['outlets'] as List)
|
||||||
@ -51,7 +51,7 @@ class OutletRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['data'] == null) {
|
if (response.data['data'] == null) {
|
||||||
return DC.error(OutletFailure.empty());
|
return DC.error(const OutletFailure.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
final outlet = OutletDto.fromJson(
|
final outlet = OutletDto.fromJson(
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class PaymentMethodRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(PaymentMethodFailure.unexpectedError());
|
return DC.error(const PaymentMethodFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final paymentMethods = ListPaymentMethodDto.fromJson(
|
final paymentMethods = ListPaymentMethodDto.fromJson(
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class PrinterLocalDataProvider {
|
|||||||
|
|
||||||
if (printerExist.hasData) {
|
if (printerExist.hasData) {
|
||||||
return DC.error(
|
return DC.error(
|
||||||
PrinterFailure.dynamicErrorMessage('Printer Telah Terdaftar'),
|
const PrinterFailure.dynamicErrorMessage('Printer Telah Terdaftar'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ class PrinterLocalDataProvider {
|
|||||||
log('Error creating printer', name: _logName, error: e);
|
log('Error creating printer', name: _logName, error: e);
|
||||||
|
|
||||||
return DC.error(
|
return DC.error(
|
||||||
PrinterFailure.dynamicErrorMessage('Error creating printer'),
|
const PrinterFailure.dynamicErrorMessage('Error creating printer'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ class PrinterLocalDataProvider {
|
|||||||
|
|
||||||
if (updatedRows == 0) {
|
if (updatedRows == 0) {
|
||||||
return DC.error(
|
return DC.error(
|
||||||
PrinterFailure.dynamicErrorMessage('Printer not found'),
|
const PrinterFailure.dynamicErrorMessage('Printer not found'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ class PrinterLocalDataProvider {
|
|||||||
log('Error updating printer', name: _logName, error: e);
|
log('Error updating printer', name: _logName, error: e);
|
||||||
|
|
||||||
return DC.error(
|
return DC.error(
|
||||||
PrinterFailure.dynamicErrorMessage('Error updating printer'),
|
const PrinterFailure.dynamicErrorMessage('Error updating printer'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ class PrinterLocalDataProvider {
|
|||||||
|
|
||||||
if (deletedRows == 0) {
|
if (deletedRows == 0) {
|
||||||
return DC.error(
|
return DC.error(
|
||||||
PrinterFailure.dynamicErrorMessage('Printer not found'),
|
const PrinterFailure.dynamicErrorMessage('Printer not found'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ class PrinterLocalDataProvider {
|
|||||||
log('Error deleting printer', name: _logName, error: e);
|
log('Error deleting printer', name: _logName, error: e);
|
||||||
|
|
||||||
return DC.error(
|
return DC.error(
|
||||||
PrinterFailure.dynamicErrorMessage('Error deleting printer'),
|
const PrinterFailure.dynamicErrorMessage('Error deleting printer'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ class PrinterLocalDataProvider {
|
|||||||
|
|
||||||
if (result.isEmpty) {
|
if (result.isEmpty) {
|
||||||
log('Printer with code $code not found');
|
log('Printer with code $code not found');
|
||||||
return DC.error(PrinterFailure.empty());
|
return DC.error(const PrinterFailure.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
final printer = PrinterDto.fromJson(result.first);
|
final printer = PrinterDto.fromJson(result.first);
|
||||||
@ -133,7 +133,7 @@ class PrinterLocalDataProvider {
|
|||||||
log('findPrinterByCode', name: _logName, error: e);
|
log('findPrinterByCode', name: _logName, error: e);
|
||||||
|
|
||||||
return DC.error(
|
return DC.error(
|
||||||
PrinterFailure.dynamicErrorMessage('Error getting printer'),
|
const PrinterFailure.dynamicErrorMessage('Error getting printer'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,7 +86,7 @@ class PrinterRepository implements IPrinterRepository {
|
|||||||
);
|
);
|
||||||
log("Error connecting to Bluetooth printer", name: _logName, error: e);
|
log("Error connecting to Bluetooth printer", name: _logName, error: e);
|
||||||
return left(
|
return left(
|
||||||
PrinterFailure.dynamicErrorMessage(
|
const PrinterFailure.dynamicErrorMessage(
|
||||||
'Error connecting to Bluetooth printer',
|
'Error connecting to Bluetooth printer',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -102,7 +102,7 @@ class PrinterRepository implements IPrinterRepository {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
log("Error disconnecting Bluetooth printer", error: e, name: _logName);
|
log("Error disconnecting Bluetooth printer", error: e, name: _logName);
|
||||||
return left(
|
return left(
|
||||||
PrinterFailure.dynamicErrorMessage(
|
const PrinterFailure.dynamicErrorMessage(
|
||||||
'Error disconnecting Bluetooth printer',
|
'Error disconnecting Bluetooth printer',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -121,7 +121,7 @@ class PrinterRepository implements IPrinterRepository {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
log("Error getting paired Bluetooth devices", name: _logName, error: e);
|
log("Error getting paired Bluetooth devices", name: _logName, error: e);
|
||||||
return left(
|
return left(
|
||||||
PrinterFailure.dynamicErrorMessage(
|
const PrinterFailure.dynamicErrorMessage(
|
||||||
'Error getting paired Bluetooth devices',
|
'Error getting paired Bluetooth devices',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -137,7 +137,9 @@ class PrinterRepository implements IPrinterRepository {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
log("Error checking Bluetooth status", name: _logName, error: e);
|
log("Error checking Bluetooth status", name: _logName, error: e);
|
||||||
return left(
|
return left(
|
||||||
PrinterFailure.dynamicErrorMessage('Error checking Bluetooth status'),
|
const PrinterFailure.dynamicErrorMessage(
|
||||||
|
'Error checking Bluetooth status',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -254,7 +256,7 @@ class PrinterRepository implements IPrinterRepository {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
return left(
|
return left(
|
||||||
PrinterFailure.dynamicErrorMessage(
|
const PrinterFailure.dynamicErrorMessage(
|
||||||
'Printer cannot connect to bluetooth, Please connect in printer setting!',
|
'Printer cannot connect to bluetooth, Please connect in printer setting!',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -306,7 +308,7 @@ class PrinterRepository implements IPrinterRepository {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
return left(
|
return left(
|
||||||
PrinterFailure.dynamicErrorMessage('Error printing struct'),
|
const PrinterFailure.dynamicErrorMessage('Error printing struct'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -339,7 +341,7 @@ class PrinterRepository implements IPrinterRepository {
|
|||||||
information: ['Printer: ${printer.name}', 'IP: ${printer.address}'],
|
information: ['Printer: ${printer.name}', 'IP: ${printer.address}'],
|
||||||
);
|
);
|
||||||
return left(
|
return left(
|
||||||
PrinterFailure.dynamicErrorMessage('Error printing struct'),
|
const PrinterFailure.dynamicErrorMessage('Error printing struct'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,9 @@ class ProductLocalDataProvider {
|
|||||||
final _logName = 'ProductLocalDataProvider';
|
final _logName = 'ProductLocalDataProvider';
|
||||||
|
|
||||||
final Map<String, List<ProductDto>> _queryCache = {};
|
final Map<String, List<ProductDto>> _queryCache = {};
|
||||||
final Duration _cacheExpiry = Duration(minutes: AppConstant.cacheExpire);
|
final Duration _cacheExpiry = const Duration(
|
||||||
|
minutes: AppConstant.cacheExpire,
|
||||||
|
);
|
||||||
final Map<String, DateTime> _cacheTimestamps = {};
|
final Map<String, DateTime> _cacheTimestamps = {};
|
||||||
|
|
||||||
ProductLocalDataProvider(this._databaseHelper);
|
ProductLocalDataProvider(this._databaseHelper);
|
||||||
@ -281,7 +283,7 @@ class ProductLocalDataProvider {
|
|||||||
|
|
||||||
if (maps.isEmpty) {
|
if (maps.isEmpty) {
|
||||||
log('❌ Product not found: $id', name: _logName);
|
log('❌ Product not found: $id', name: _logName);
|
||||||
return DC.error(ProductFailure.empty());
|
return DC.error(const ProductFailure.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
final variants = await _getProductVariants(db, id);
|
final variants = await _getProductVariants(db, id);
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class ProductRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['data'] == null) {
|
if (response.data['data'] == null) {
|
||||||
return DC.error(ProductFailure.empty());
|
return DC.error(const ProductFailure.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
final categories = ListProductDto.fromJson(
|
final categories = ListProductDto.fromJson(
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class TableRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['data'] == null) {
|
if (response.data['data'] == null) {
|
||||||
return DC.error(TableFailure.empty());
|
return DC.error(const TableFailure.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
final tables = ListTableDto.fromJson(
|
final tables = ListTableDto.fromJson(
|
||||||
@ -71,7 +71,7 @@ class TableRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(TableFailure.unexpectedError());
|
return DC.error(const TableFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final table = TableDto.fromJson(
|
final table = TableDto.fromJson(
|
||||||
@ -99,7 +99,7 @@ class TableRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(TableFailure.unexpectedError());
|
return DC.error(const TableFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
final table = TableDto.fromJson(
|
final table = TableDto.fromJson(
|
||||||
@ -124,7 +124,7 @@ class TableRemoteDataProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.data['success'] == false) {
|
if (response.data['success'] == false) {
|
||||||
return DC.error(TableFailure.unexpectedError());
|
return DC.error(const TableFailure.unexpectedError());
|
||||||
}
|
}
|
||||||
|
|
||||||
return DC.data(unit);
|
return DC.data(unit);
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class AppIconButton extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(6.0),
|
borderRadius: BorderRadius.circular(6.0),
|
||||||
border: Border.all(color: AppColor.border),
|
border: Border.all(color: AppColor.border),
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class CustomerCard extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
const CircleAvatar(
|
||||||
radius: 22,
|
radius: 22,
|
||||||
backgroundColor: AppColor.primary,
|
backgroundColor: AppColor.primary,
|
||||||
child: Icon(Icons.person, color: Colors.white),
|
child: Icon(Icons.person, color: Colors.white),
|
||||||
|
|||||||
@ -20,21 +20,21 @@ class ErrorCard extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.error_outline, size: 48, color: Colors.red.shade400),
|
Icon(Icons.error_outline, size: 48, color: Colors.red.shade400),
|
||||||
SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(
|
Text(
|
||||||
title,
|
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(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 32),
|
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||||
child: Text(
|
child: Text(
|
||||||
message,
|
message,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: Colors.grey.shade600),
|
style: const TextStyle(color: Colors.grey),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
AppElevatedButton.filled(
|
AppElevatedButton.filled(
|
||||||
width: 120,
|
width: 120,
|
||||||
onPressed: onTap,
|
onPressed: onTap,
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class OrderCard extends StatelessWidget {
|
|||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
const CircleAvatar(
|
||||||
radius: 22,
|
radius: 22,
|
||||||
backgroundColor: AppColor.primary,
|
backgroundColor: AppColor.primary,
|
||||||
child: Icon(Icons.person, color: Colors.white),
|
child: Icon(Icons.person, color: Colors.white),
|
||||||
@ -107,7 +107,7 @@ class OrderCard extends StatelessWidget {
|
|||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
const Icon(
|
||||||
Icons.table_bar,
|
Icons.table_bar,
|
||||||
size: 16,
|
size: 16,
|
||||||
color: AppColor.textSecondary,
|
color: AppColor.textSecondary,
|
||||||
@ -145,7 +145,7 @@ class OrderCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
(order.createdAt).toFormattedDateTime(),
|
(order.createdAt).toFormattedDateTime(),
|
||||||
style: TextStyle(color: AppColor.black),
|
style: const TextStyle(color: AppColor.black),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -182,7 +182,7 @@ class OrderCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
(order.status).toUpperCase(),
|
(order.status).toUpperCase(),
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
color: AppColor.success,
|
color: AppColor.success,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
@ -199,7 +199,7 @@ class OrderCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
(order.status).toUpperCase(),
|
(order.status).toUpperCase(),
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
color: AppColor.textSecondary,
|
color: AppColor.textSecondary,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
child: ListTile(
|
child: ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
leading: ClipRRect(
|
leading: ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8.0)),
|
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||||
child: AppNetworkImage(
|
child: AppNetworkImage(
|
||||||
url: widget.data.product.imageUrl,
|
url: widget.data.product.imageUrl,
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
@ -150,7 +150,7 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(8.0),
|
const SpaceHeight(8.0),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -160,7 +160,9 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
cursorColor: AppColor.primary,
|
cursorColor: AppColor.primary,
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
style: const TextStyle(fontSize: 12, color: AppColor.black),
|
style: const TextStyle(fontSize: 12, color: AppColor.black),
|
||||||
decoration: InputDecoration(hintText: 'Catatan Pesanan'),
|
decoration: const InputDecoration(
|
||||||
|
hintText: 'Catatan Pesanan',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SpaceWidth(16.0),
|
const SpaceWidth(16.0),
|
||||||
@ -180,7 +182,10 @@ class _OrderMenuState extends State<OrderMenu> {
|
|||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
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) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
||||||
margin: EdgeInsets.only(bottom: 12),
|
margin: const EdgeInsets.only(bottom: 12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isSelected ? AppColor.primary.withOpacity(0.1) : AppColor.white,
|
color: isSelected ? AppColor.primary.withOpacity(0.1) : AppColor.white,
|
||||||
border: Border.all(color: AppColor.primary),
|
border: Border.all(color: AppColor.primary),
|
||||||
@ -21,8 +21,8 @@ class OutletCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.store, color: AppColor.primary),
|
const Icon(Icons.store, color: AppColor.primary),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class PaymentCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
checkmarkColor: AppColor.white,
|
checkmarkColor: AppColor.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: AppColor.primary),
|
side: const BorderSide(color: AppColor.primary),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class ProductCard extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8.0)),
|
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||||
child: product.imageUrl == ""
|
child: product.imageUrl == ""
|
||||||
? Container(
|
? Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@ -71,7 +71,7 @@ class ProductCard extends StatelessWidget {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -82,7 +82,7 @@ class ProductCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -126,7 +126,7 @@ class ProductCard extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8.0)),
|
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||||
color: AppColor.disabled.withOpacity(0.5),
|
color: AppColor.disabled.withOpacity(0.5),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class CustomModalDialog extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
|
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
|
||||||
),
|
),
|
||||||
@ -74,9 +74,9 @@ class CustomModalDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.close, color: AppColor.white),
|
icon: const Icon(Icons.close, color: AppColor.white),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (onClose != null) {
|
if (onClose != null) {
|
||||||
onClose!();
|
onClose!();
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class _DeliveryDialogState extends State<DeliveryDialog> {
|
|||||||
height: 40.0,
|
height: 40.0,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
SpaceWidth(12.0),
|
const SpaceWidth(12.0),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
delivery.name,
|
delivery.name,
|
||||||
@ -83,7 +83,7 @@ class _DeliveryDialogState extends State<DeliveryDialog> {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12.0),
|
const SpaceWidth(12.0),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.check_circle,
|
Icons.check_circle,
|
||||||
color: selectedType?.id == delivery.id
|
color: selectedType?.id == delivery.id
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class LogoutModalDialog extends StatelessWidget {
|
|||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return CustomModalDialog(
|
return CustomModalDialog(
|
||||||
title: 'Konfirmasi',
|
title: 'Konfirmasi',
|
||||||
contentPadding: EdgeInsets.all(16),
|
contentPadding: const EdgeInsets.all(16),
|
||||||
bottom: Padding(
|
bottom: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -28,7 +28,7 @@ class LogoutModalDialog extends StatelessWidget {
|
|||||||
label: 'Batal',
|
label: 'Batal',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AppElevatedButton.filled(
|
child: AppElevatedButton.filled(
|
||||||
onPressed: state.isLoggingOut
|
onPressed: state.isLoggingOut
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class _OrderAddItemDialogState extends State<OrderAddItemDialog> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
context.read<OrderLoaderBloc>().add(
|
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>(
|
BlocBuilder<OrderLoaderBloc, OrderLoaderState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.isFetching) {
|
if (state.isFetching) {
|
||||||
return Center(child: LoaderWithText());
|
return const Center(child: LoaderWithText());
|
||||||
}
|
}
|
||||||
|
|
||||||
final availableOrders = state.orders;
|
final availableOrders = state.orders;
|
||||||
@ -258,7 +258,7 @@ class _OrderAddItemDialogState extends State<OrderAddItemDialog> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
BlocBuilder<OrderFormBloc, OrderFormState>(
|
BlocBuilder<OrderFormBloc, OrderFormState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return AppElevatedButton.filled(
|
return AppElevatedButton.filled(
|
||||||
|
|||||||
@ -195,7 +195,7 @@ class OrderPayLaterDialog extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
searchEntry.isEmpty
|
searchEntry.isEmpty
|
||||||
? "Tidak ada meja tersedia"
|
? "Tidak ada meja tersedia"
|
||||||
: "Tidak ditemukan meja dengan '${searchEntry}'",
|
: "Tidak ditemukan meja dengan '$searchEntry'",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.grey.shade600,
|
color: Colors.grey.shade600,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@ -233,7 +233,7 @@ class OrderPayLaterDialog extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(24),
|
const SpaceHeight(24),
|
||||||
BlocBuilder<OrderFormBloc, OrderFormState>(
|
BlocBuilder<OrderFormBloc, OrderFormState>(
|
||||||
builder: (context, orderState) {
|
builder: (context, orderState) {
|
||||||
return AppElevatedButton.filled(
|
return AppElevatedButton.filled(
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
minWidth: context.deviceWidth * 0.5,
|
minWidth: context.deviceWidth * 0.5,
|
||||||
minHeight: context.deviceHeight * 0.8,
|
minHeight: context.deviceHeight * 0.8,
|
||||||
bottom: Container(
|
bottom: Container(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -38,7 +38,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
label: 'Batalkan',
|
label: 'Batalkan',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AppElevatedButton.filled(
|
child: AppElevatedButton.filled(
|
||||||
isLoading: state.isCreating,
|
isLoading: state.isCreating,
|
||||||
@ -63,7 +63,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.textSecondary.withOpacity(0.05),
|
color: AppColor.textSecondary.withOpacity(0.05),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
@ -75,7 +75,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (checkoutState.items.isNotEmpty) ...[
|
if (checkoutState.items.isNotEmpty) ...[
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -87,22 +87,22 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(6),
|
padding: const EdgeInsets.all(6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: const Icon(
|
||||||
Icons.list_alt_rounded,
|
Icons.list_alt_rounded,
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
size: 16,
|
size: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
'Item yang akan dipesan:',
|
'Item yang akan dipesan:',
|
||||||
style: AppStyle.md.copyWith(
|
style: AppStyle.md.copyWith(
|
||||||
@ -114,10 +114,10 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
constraints: BoxConstraints(maxHeight: 120),
|
constraints: const BoxConstraints(maxHeight: 120),
|
||||||
child: Scrollbar(
|
child: Scrollbar(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 16,
|
left: 16,
|
||||||
right: 16,
|
right: 16,
|
||||||
bottom: 16,
|
bottom: 16,
|
||||||
@ -125,8 +125,8 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: checkoutState.items.map((item) {
|
children: checkoutState.items.map((item) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(bottom: 6),
|
margin: const EdgeInsets.only(bottom: 6),
|
||||||
padding: EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
@ -134,7 +134,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.03),
|
color: Colors.black.withOpacity(0.03),
|
||||||
blurRadius: 2,
|
blurRadius: 2,
|
||||||
offset: Offset(0, 1),
|
offset: const Offset(0, 1),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -143,12 +143,12 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 6,
|
width: 6,
|
||||||
height: 6,
|
height: 6,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
@ -172,7 +172,7 @@ class OrderSaveConfirmDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 6,
|
horizontal: 6,
|
||||||
vertical: 2,
|
vertical: 2,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -39,14 +39,14 @@ class OrderSaveDialog extends StatelessWidget {
|
|||||||
context.maybePop();
|
context.maybePop();
|
||||||
|
|
||||||
if (checkoutState.orderType == OrderType.dineIn) {
|
if (checkoutState.orderType == OrderType.dineIn) {
|
||||||
Future.delayed(Duration(milliseconds: 100), () {
|
Future.delayed(const Duration(milliseconds: 100), () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => OrderPayLaterDialog(tables: tables),
|
builder: (context) => OrderPayLaterDialog(tables: tables),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Future.delayed(Duration(milliseconds: 100), () {
|
Future.delayed(const Duration(milliseconds: 100), () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
@ -56,7 +56,7 @@ class OrderSaveDialog extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(16.0),
|
const SpaceHeight(16.0),
|
||||||
_item(
|
_item(
|
||||||
icon: Icons.shopping_cart_checkout_outlined,
|
icon: Icons.shopping_cart_checkout_outlined,
|
||||||
title: 'Tambahkan Pesanan',
|
title: 'Tambahkan Pesanan',
|
||||||
@ -92,7 +92,7 @@ class OrderSaveDialog extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(icon, color: AppColor.primary, size: 26.0),
|
Icon(icon, color: AppColor.primary, size: 26.0),
|
||||||
SpaceWidth(12.0),
|
const SpaceWidth(12.0),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
return CustomModalDialog(
|
return CustomModalDialog(
|
||||||
title: 'Konfirmasi Void',
|
title: 'Konfirmasi Void',
|
||||||
subtitle: 'Tindakan ini tidak dapat dibatalkan',
|
subtitle: 'Tindakan ini tidak dapat dibatalkan',
|
||||||
contentPadding: EdgeInsets.all(16),
|
contentPadding: const EdgeInsets.all(16),
|
||||||
bottom: Padding(
|
bottom: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -37,7 +37,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
child: AppElevatedButton.filled(
|
child: AppElevatedButton.filled(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.read<VoidFormBloc>().add(
|
context.read<VoidFormBloc>().add(
|
||||||
VoidFormEvent.submitted(),
|
const VoidFormEvent.submitted(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
label: state.voidType.isAll ? 'Void Pesanan' : 'Void Item',
|
label: state.voidType.isAll ? 'Void Pesanan' : 'Void Item',
|
||||||
@ -60,7 +60,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
|
|
||||||
if (state.voidType.isItem &&
|
if (state.voidType.isItem &&
|
||||||
state.selectedItemQuantities.isNotEmpty) ...[
|
state.selectedItemQuantities.isNotEmpty) ...[
|
||||||
SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// Items section
|
// Items section
|
||||||
Container(
|
Container(
|
||||||
@ -74,22 +74,22 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(6),
|
padding: const EdgeInsets.all(6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.primary.withOpacity(0.2),
|
color: AppColor.primary.withOpacity(0.2),
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: const Icon(
|
||||||
Icons.list_alt_rounded,
|
Icons.list_alt_rounded,
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
size: 16,
|
size: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
'Item yang akan divoid:',
|
'Item yang akan divoid:',
|
||||||
style: AppStyle.md.copyWith(
|
style: AppStyle.md.copyWith(
|
||||||
@ -101,10 +101,10 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
constraints: BoxConstraints(maxHeight: 120),
|
constraints: const BoxConstraints(maxHeight: 120),
|
||||||
child: Scrollbar(
|
child: Scrollbar(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 16,
|
left: 16,
|
||||||
right: 16,
|
right: 16,
|
||||||
bottom: 16,
|
bottom: 16,
|
||||||
@ -117,8 +117,8 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
(item) => item.id == entry.key,
|
(item) => item.id == entry.key,
|
||||||
);
|
);
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(bottom: 6),
|
margin: const EdgeInsets.only(bottom: 6),
|
||||||
padding: EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
@ -128,7 +128,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
0.03,
|
0.03,
|
||||||
),
|
),
|
||||||
blurRadius: 2,
|
blurRadius: 2,
|
||||||
offset: Offset(0, 1),
|
offset: const Offset(0, 1),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -137,12 +137,12 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 6,
|
width: 6,
|
||||||
height: 6,
|
height: 6,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
@ -169,7 +169,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 6,
|
horizontal: 6,
|
||||||
vertical: 2,
|
vertical: 2,
|
||||||
),
|
),
|
||||||
@ -201,11 +201,11 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
// Reason section
|
// Reason section
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.blue[50],
|
color: Colors.blue[50],
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
@ -215,18 +215,18 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(6),
|
padding: const EdgeInsets.all(6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.info.withOpacity(0.1),
|
color: AppColor.info.withOpacity(0.1),
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: const Icon(
|
||||||
Icons.note_alt_rounded,
|
Icons.note_alt_rounded,
|
||||||
color: AppColor.info,
|
color: AppColor.info,
|
||||||
size: 16,
|
size: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -239,7 +239,7 @@ class OrderVoidConfirmDialog extends StatelessWidget {
|
|||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
Text(
|
Text(
|
||||||
state.voidReason ?? "",
|
state.voidReason ?? "",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@ -89,7 +89,7 @@ class OrderTypeDialog extends StatelessWidget {
|
|||||||
? AppColor.white
|
? AppColor.white
|
||||||
: AppColor.black,
|
: AppColor.black,
|
||||||
),
|
),
|
||||||
SpaceWidth(12.0),
|
const SpaceWidth(12.0),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
type['label']!,
|
type['label']!,
|
||||||
@ -103,7 +103,7 @@ class OrderTypeDialog extends StatelessWidget {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12.0),
|
const SpaceWidth(12.0),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.check_circle,
|
Icons.check_circle,
|
||||||
color: selectedType == type['value']
|
color: selectedType == type['value']
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class _OutletDialogState extends State<OutletDialog> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
context.read<OutletLoaderBloc>().add(
|
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>(
|
child: BlocBuilder<OutletLoaderBloc, OutletLoaderState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.isFetching) {
|
if (state.isFetching) {
|
||||||
return LoaderWithText();
|
return const LoaderWithText();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
@ -46,8 +46,11 @@ class _OutletDialogState extends State<OutletDialog> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(24),
|
const SpaceHeight(24),
|
||||||
AppElevatedButton.filled(onPressed: null, label: 'Terapkan'),
|
const AppElevatedButton.filled(
|
||||||
|
onPressed: null,
|
||||||
|
label: 'Terapkan',
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -13,7 +13,9 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
loadPermissionBluetooth();
|
loadPermissionBluetooth();
|
||||||
context.read<BluetoothLoaderBloc>().add(BluetoothLoaderEvent.fetched());
|
context.read<BluetoothLoaderBloc>().add(
|
||||||
|
const BluetoothLoaderEvent.fetched(),
|
||||||
|
);
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,13 +23,13 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CustomModalDialog(
|
return CustomModalDialog(
|
||||||
title: 'Bluetooth',
|
title: 'Bluetooth',
|
||||||
contentPadding: EdgeInsets.all(16),
|
contentPadding: const EdgeInsets.all(16),
|
||||||
minHeight: context.deviceHeight * 0.6,
|
minHeight: context.deviceHeight * 0.6,
|
||||||
minWidth: context.deviceWidth * 0.4,
|
minWidth: context.deviceWidth * 0.4,
|
||||||
child: BlocBuilder<BluetoothLoaderBloc, BluetoothLoaderState>(
|
child: BlocBuilder<BluetoothLoaderBloc, BluetoothLoaderState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.isFetching) {
|
if (state.isFetching) {
|
||||||
return Center(child: LoaderWithText());
|
return const Center(child: LoaderWithText());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.bluetoothDevices.isEmpty) {
|
if (state.bluetoothDevices.isEmpty) {
|
||||||
@ -50,7 +52,7 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(color: AppColor.border, width: 1),
|
bottom: BorderSide(color: AppColor.border, width: 1),
|
||||||
),
|
),
|
||||||
@ -66,7 +68,7 @@ class _PrinterBluetoothDialogState extends State<PrinterBluetoothDialog> {
|
|||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Text(
|
Text(
|
||||||
item.macAdress,
|
item.macAdress,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class TableCreateDialog extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
AppTextFormField(
|
AppTextFormField(
|
||||||
label: 'Kapasitas',
|
label: 'Kapasitas',
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
@ -41,7 +41,7 @@ class TableCreateDialog extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(24),
|
const SpaceHeight(24),
|
||||||
AppElevatedButton.filled(
|
AppElevatedButton.filled(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.read<TableFormBloc>().add(
|
context.read<TableFormBloc>().add(
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class _TableTransferDialogState extends State<TableTransferDialog> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
context.read<TableLoaderBloc>().add(
|
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;
|
final availableTables = state.tables;
|
||||||
|
|
||||||
if (state.isFetching) {
|
if (state.isFetching) {
|
||||||
return Center(child: const LoaderWithText());
|
return const Center(child: LoaderWithText());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectTable == null && availableTables.isNotEmpty) {
|
if (selectTable == null && availableTables.isNotEmpty) {
|
||||||
@ -252,7 +252,7 @@ class _TableTransferDialogState extends State<TableTransferDialog> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(24),
|
const SpaceHeight(24),
|
||||||
BlocBuilder<TableFormBloc, TableFormState>(
|
BlocBuilder<TableFormBloc, TableFormState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return AppElevatedButton.filled(
|
return AppElevatedButton.filled(
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class VariantDialog extends StatelessWidget {
|
|||||||
title: 'Pilih Varian',
|
title: 'Pilih Varian',
|
||||||
subtitle: 'Silahkan pilih varian yang sesuai',
|
subtitle: 'Silahkan pilih varian yang sesuai',
|
||||||
minWidth: context.deviceWidth * 0.4,
|
minWidth: context.deviceWidth * 0.4,
|
||||||
contentPadding: EdgeInsets.all(16),
|
contentPadding: const EdgeInsets.all(16),
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
runSpacing: 12,
|
runSpacing: 12,
|
||||||
@ -44,7 +44,7 @@ class VariantDialog extends StatelessWidget {
|
|||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
variant.priceModifier.currencyFormatRpV2,
|
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',
|
message: 'Terjadi Kesalahan saat memuat metode pembayaran',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<PaymentMethodLoaderBloc>().add(
|
context.read<PaymentMethodLoaderBloc>().add(
|
||||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -26,7 +26,7 @@ class PaymentMethodErrorStateWidget extends StatelessWidget {
|
|||||||
message: value.erroMessage,
|
message: value.erroMessage,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<PaymentMethodLoaderBloc>().add(
|
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',
|
'Metode pembayaran masih kosong, silahkan tambahkan metode pembayaran',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<PaymentMethodLoaderBloc>().add(
|
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',
|
message: 'Terjadi Kesalahan saat memuat metode pembayaran',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<PaymentMethodLoaderBloc>().add(
|
context.read<PaymentMethodLoaderBloc>().add(
|
||||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -54,7 +54,7 @@ class PaymentMethodErrorStateWidget extends StatelessWidget {
|
|||||||
message: value.erroMessage,
|
message: value.erroMessage,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<PaymentMethodLoaderBloc>().add(
|
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',
|
message: 'Terjadi Kesalahan saat memuat metode pembayaran',
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<PaymentMethodLoaderBloc>().add(
|
context.read<PaymentMethodLoaderBloc>().add(
|
||||||
PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
const PaymentMethodLoaderEvent.fetched(isRefresh: true),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class _CustomerAutocompleteState extends State<CustomerAutocomplete> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
context.read<CustomerLoaderBloc>().add(CustomerLoaderEvent.fetched());
|
context.read<CustomerLoaderBloc>().add(const CustomerLoaderEvent.fetched());
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
|||||||
final bool isRequired;
|
final bool isRequired;
|
||||||
|
|
||||||
const AppDropdownSearch({
|
const AppDropdownSearch({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.hintText,
|
required this.hintText,
|
||||||
required this.items,
|
required this.items,
|
||||||
@ -34,7 +34,7 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
|||||||
this.itemBuilder,
|
this.itemBuilder,
|
||||||
this.showSearchBox = true,
|
this.showSearchBox = true,
|
||||||
this.isRequired = false,
|
this.isRequired = false,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -46,14 +46,14 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
label,
|
label,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isRequired)
|
if (isRequired)
|
||||||
Text(
|
const Text(
|
||||||
' *',
|
' *',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
@ -74,7 +74,10 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
|||||||
dropdownDecoratorProps: DropDownDecoratorProps(
|
dropdownDecoratorProps: DropDownDecoratorProps(
|
||||||
dropdownSearchDecoration: InputDecoration(
|
dropdownSearchDecoration: InputDecoration(
|
||||||
hintText: hintText,
|
hintText: hintText,
|
||||||
hintStyle: TextStyle(color: AppColor.textSecondary, fontSize: 14),
|
hintStyle: const TextStyle(
|
||||||
|
color: AppColor.textSecondary,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
prefixIcon: Icon(
|
prefixIcon: Icon(
|
||||||
prefixIcon,
|
prefixIcon,
|
||||||
color: AppColor.textSecondary,
|
color: AppColor.textSecondary,
|
||||||
@ -82,23 +85,29 @@ class AppDropdownSearch<T> extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
borderSide: BorderSide(color: AppColor.border, width: 1.5),
|
borderSide: const BorderSide(
|
||||||
|
color: AppColor.border,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
borderSide: BorderSide(color: AppColor.border, width: 1.5),
|
borderSide: const BorderSide(
|
||||||
|
color: AppColor.border,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
borderSide: BorderSide(color: AppColor.primary, width: 2),
|
borderSide: const BorderSide(color: AppColor.primary, width: 2),
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
borderSide: BorderSide(color: AppColor.error, width: 1.5),
|
borderSide: const BorderSide(color: AppColor.error, width: 1.5),
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
borderSide: BorderSide(color: AppColor.error, width: 2),
|
borderSide: const BorderSide(color: AppColor.error, width: 2),
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class _AppPasswordTextFormFieldState extends State<AppPasswordTextFormField> {
|
|||||||
prefixIcon: widget.prefixIcon,
|
prefixIcon: widget.prefixIcon,
|
||||||
suffixIcon: isPasswordVisible
|
suffixIcon: isPasswordVisible
|
||||||
? IconButton(
|
? IconButton(
|
||||||
icon: Icon(
|
icon: const Icon(
|
||||||
Icons.visibility,
|
Icons.visibility,
|
||||||
color: AppColor.textSecondary,
|
color: AppColor.textSecondary,
|
||||||
size: 20,
|
size: 20,
|
||||||
@ -78,7 +78,7 @@ class _AppPasswordTextFormFieldState extends State<AppPasswordTextFormField> {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
: IconButton(
|
: IconButton(
|
||||||
icon: Icon(
|
icon: const Icon(
|
||||||
Icons.visibility_off,
|
Icons.visibility_off,
|
||||||
color: AppColor.textSecondary,
|
color: AppColor.textSecondary,
|
||||||
size: 20,
|
size: 20,
|
||||||
|
|||||||
@ -52,7 +52,10 @@ class AppTextFormField extends StatelessWidget {
|
|||||||
maxLines: maxLines,
|
maxLines: maxLines,
|
||||||
validator: validator,
|
validator: validator,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: EdgeInsets.symmetric(vertical: 4, horizontal: 12),
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 4,
|
||||||
|
horizontal: 12,
|
||||||
|
),
|
||||||
prefixIcon: prefixIcon,
|
prefixIcon: prefixIcon,
|
||||||
suffixIcon: suffixIcon,
|
suffixIcon: suffixIcon,
|
||||||
hintText: label,
|
hintText: label,
|
||||||
|
|||||||
@ -12,8 +12,8 @@ class LoaderWithText extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SpinKitFadingCircle(color: AppColor.primary, size: 24),
|
const SpinKitFadingCircle(color: AppColor.primary, size: 24),
|
||||||
SpaceWidth(10),
|
const SpaceWidth(10),
|
||||||
Text(
|
Text(
|
||||||
'Loading...',
|
'Loading...',
|
||||||
style: AppStyle.md.copyWith(
|
style: AppStyle.md.copyWith(
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class PageTitle extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
height: context.deviceHeight * 0.123,
|
height: context.deviceHeight * 0.123,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(color: AppColor.border, width: 1.0),
|
bottom: BorderSide(color: AppColor.border, width: 1.0),
|
||||||
@ -39,13 +39,13 @@ class PageTitle extends StatelessWidget {
|
|||||||
if (isBack) ...[
|
if (isBack) ...[
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => context.router.maybePop(),
|
onTap: () => context.router.maybePop(),
|
||||||
child: Icon(
|
child: const Icon(
|
||||||
Icons.arrow_back,
|
Icons.arrow_back,
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
size: 24,
|
size: 24,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(16),
|
const SpaceWidth(16),
|
||||||
],
|
],
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@ -213,16 +213,9 @@ class _DateRangePickerDialogState extends State<_DateRangePickerDialog>
|
|||||||
// ── Header ──────────────────────────────────────────
|
// ── Header ──────────────────────────────────────────
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(20),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
gradient: LinearGradient(
|
color: AppColor.primary,
|
||||||
colors: [
|
borderRadius: BorderRadius.only(
|
||||||
widget.primaryColor,
|
|
||||||
widget.primaryColor.withOpacity(0.8),
|
|
||||||
],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
borderRadius: const BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(20),
|
topLeft: Radius.circular(20),
|
||||||
topRight: Radius.circular(20),
|
topRight: Radius.circular(20),
|
||||||
),
|
),
|
||||||
@ -254,7 +247,7 @@ class _DateRangePickerDialogState extends State<_DateRangePickerDialog>
|
|||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
|
|
||||||
// ── TableCalendar ────────────────────────────
|
// ── TableCalendar ────────────────────────────
|
||||||
Padding(
|
Padding(
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class CustomTabBar extends StatelessWidget {
|
|||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
tabAlignment: TabAlignment.start,
|
tabAlignment: TabAlignment.start,
|
||||||
labelColor: AppColor.primary,
|
labelColor: AppColor.primary,
|
||||||
labelStyle: TextStyle(fontWeight: FontWeight.bold),
|
labelStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
dividerColor: AppColor.border,
|
dividerColor: AppColor.border,
|
||||||
unselectedLabelColor: AppColor.primary,
|
unselectedLabelColor: AppColor.primary,
|
||||||
indicatorSize: TabBarIndicatorSize.label,
|
indicatorSize: TabBarIndicatorSize.label,
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
|
|
||||||
import '../../../../common/data/report_menu.dart';
|
import '../../../../common/data/report_menu.dart';
|
||||||
import '../../../../common/extension/extension.dart';
|
import '../../../../common/extension/extension.dart';
|
||||||
@ -32,7 +31,7 @@ class ReportHeader extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Text(
|
Text(
|
||||||
menu.subtitle,
|
menu.subtitle,
|
||||||
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class ReportSummaryCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Icon(icon, color: color, size: 22),
|
child: Icon(icon, color: color, size: 22),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -49,7 +49,7 @@ class ReportSummaryCard extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
@ -58,7 +58,7 @@ class ReportSummaryCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (subtitle != null) ...[
|
if (subtitle != null) ...[
|
||||||
SpaceHeight(2),
|
const SpaceHeight(2),
|
||||||
Text(
|
Text(
|
||||||
subtitle!,
|
subtitle!,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
|
|||||||
@ -72,15 +72,15 @@ class LoginPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SpaceHeight(20.0),
|
const SpaceHeight(20.0),
|
||||||
LoginEmailField(),
|
const LoginEmailField(),
|
||||||
const SpaceHeight(12.0),
|
const SpaceHeight(12.0),
|
||||||
LoginPasswordField(),
|
const LoginPasswordField(),
|
||||||
const SpaceHeight(24.0),
|
const SpaceHeight(24.0),
|
||||||
AppElevatedButton.filled(
|
AppElevatedButton.filled(
|
||||||
onPressed: state.isSubmitting
|
onPressed: state.isSubmitting
|
||||||
? null
|
? null
|
||||||
: () => context.read<LoginFormBloc>().add(
|
: () => context.read<LoginFormBloc>().add(
|
||||||
LoginFormEvent.submitted(),
|
const LoginFormEvent.submitted(),
|
||||||
),
|
),
|
||||||
textColor: state.isSubmitting
|
textColor: state.isSubmitting
|
||||||
? AppColor.primary
|
? AppColor.primary
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
(order) {
|
(order) {
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.read<CheckoutFormBloc>().add(
|
context.read<CheckoutFormBloc>().add(
|
||||||
CheckoutFormEvent.started([]),
|
const CheckoutFormEvent.started([]),
|
||||||
);
|
);
|
||||||
context.router.replace(SuccessOrderRoute(order: order));
|
context.router.replace(SuccessOrderRoute(order: order));
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
(order) {
|
(order) {
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.read<CheckoutFormBloc>().add(
|
context.read<CheckoutFormBloc>().add(
|
||||||
CheckoutFormEvent.started([]),
|
const CheckoutFormEvent.started([]),
|
||||||
);
|
);
|
||||||
context.router.replace(SuccessOrderRoute(order: order));
|
context.router.replace(SuccessOrderRoute(order: order));
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
(f) => AppFlushbar.showOrderFailureToast(context, f),
|
(f) => AppFlushbar.showOrderFailureToast(context, f),
|
||||||
(order) {
|
(order) {
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.router.replace(SuccessAddItemOrderRoute());
|
context.router.replace(const SuccessAddItemOrderRoute());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -103,7 +103,7 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
price: price,
|
price: price,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(2),
|
const SpaceWidth(2),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 3,
|
||||||
child: CheckoutRightPanel(
|
child: CheckoutRightPanel(
|
||||||
@ -127,11 +127,16 @@ class CheckoutPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (context) =>
|
create: (context) =>
|
||||||
getIt<PaymentMethodLoaderBloc>()
|
getIt<PaymentMethodLoaderBloc>()
|
||||||
..add(PaymentMethodLoaderEvent.fetched(isRefresh: true)),
|
..add(const PaymentMethodLoaderEvent.fetched(isRefresh: true)),
|
||||||
),
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (context) => getIt<TableLoaderBloc>()
|
create: (context) => getIt<TableLoaderBloc>()
|
||||||
..add(TableLoaderEvent.fetched(isRefresh: true, status: 'available')),
|
..add(
|
||||||
|
const TableLoaderEvent.fetched(
|
||||||
|
isRefresh: true,
|
||||||
|
status: 'available',
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: this,
|
child: this,
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
checkoutState.orderType.value,
|
checkoutState.orderType.value,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
@ -62,7 +62,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(160),
|
const SpaceWidth(160),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -95,7 +95,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
|||||||
itemCount: checkoutState.items.length,
|
itemCount: checkoutState.items.length,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
DashedDivider(color: AppColor.border),
|
const DashedDivider(color: AppColor.border),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -123,7 +123,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SpaceHeight(8.0),
|
const SpaceHeight(8.0),
|
||||||
DashedDivider(color: AppColor.border),
|
const DashedDivider(color: AppColor.border),
|
||||||
const SpaceHeight(8.0),
|
const SpaceHeight(8.0),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -168,7 +168,7 @@ class CheckoutLeftPanel extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SpaceHeight(8.0),
|
const SpaceHeight(8.0),
|
||||||
DashedDivider(color: AppColor.border),
|
const DashedDivider(color: AppColor.border),
|
||||||
const SpaceHeight(8.0),
|
const SpaceHeight(8.0),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
|||||||
builder: (context, orderState) {
|
builder: (context, orderState) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
PageTitle(
|
const PageTitle(
|
||||||
title: 'Pembayaran',
|
title: 'Pembayaran',
|
||||||
isBack: false,
|
isBack: false,
|
||||||
subtitle: 'Silahkan lakukan pembayaran',
|
subtitle: 'Silahkan lakukan pembayaran',
|
||||||
@ -78,7 +78,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
@ -100,7 +100,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
@ -125,7 +125,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
|||||||
>(
|
>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.isFetching) {
|
if (state.isFetching) {
|
||||||
return Center(child: LoaderWithText());
|
return const Center(child: LoaderWithText());
|
||||||
}
|
}
|
||||||
return state.failureOption.fold(
|
return state.failureOption.fold(
|
||||||
() => Wrap(
|
() => Wrap(
|
||||||
@ -172,7 +172,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
|||||||
orderState.paymentMethod!.type == 'cash')
|
orderState.paymentMethod!.type == 'cash')
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
@ -261,8 +261,8 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
border: Border(
|
border: Border(
|
||||||
top: BorderSide(color: AppColor.border, width: 1.0),
|
top: BorderSide(color: AppColor.border, width: 1.0),
|
||||||
@ -276,7 +276,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
|||||||
label: 'Batalkan',
|
label: 'Batalkan',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: BlocBuilder<TableLoaderBloc, TableLoaderState>(
|
child: BlocBuilder<TableLoaderBloc, TableLoaderState>(
|
||||||
builder: (context, tableState) {
|
builder: (context, tableState) {
|
||||||
@ -304,7 +304,7 @@ class _CheckoutRightPanelState extends State<CheckoutRightPanel> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AppElevatedButton.filled(
|
child: AppElevatedButton.filled(
|
||||||
isLoading: orderState.isCreatingWithPayment,
|
isLoading: orderState.isCreatingWithPayment,
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class _MainPageState extends State<MainPage> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: AutoTabsRouter(
|
child: AutoTabsRouter(
|
||||||
routes: [
|
routes: const [
|
||||||
HomeRoute(),
|
HomeRoute(),
|
||||||
TableRoute(),
|
TableRoute(),
|
||||||
ReportRoute(),
|
ReportRoute(),
|
||||||
@ -83,7 +83,7 @@ class _MainPageState extends State<MainPage> {
|
|||||||
),
|
),
|
||||||
minExtendedWidth: 56,
|
minExtendedWidth: 56,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Assets.images.logoWhite.image(
|
child: Assets.images.logoWhite.image(
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
@ -103,7 +103,8 @@ class _MainPageState extends State<MainPage> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => LogoutModalDialog(),
|
builder: (context) =>
|
||||||
|
const LogoutModalDialog(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
tooltip: 'Logout',
|
tooltip: 'Logout',
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import 'package:apskel_pos_flutter_v2/domain/customer/customer.dart';
|
|
||||||
import 'package:auto_route/auto_route.dart';
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
@ -6,6 +5,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import '../../../../../application/customer/customer_loader/customer_loader_bloc.dart';
|
import '../../../../../application/customer/customer_loader/customer_loader_bloc.dart';
|
||||||
import '../../../../../common/extension/extension.dart';
|
import '../../../../../common/extension/extension.dart';
|
||||||
import '../../../../../common/theme/theme.dart';
|
import '../../../../../common/theme/theme.dart';
|
||||||
|
import '../../../../../domain/customer/customer.dart';
|
||||||
import '../../../../../injection.dart';
|
import '../../../../../injection.dart';
|
||||||
import '../../../../components/border/dashed_border.dart';
|
import '../../../../components/border/dashed_border.dart';
|
||||||
import '../../../../components/card/customer_card.dart';
|
import '../../../../components/card/customer_card.dart';
|
||||||
@ -32,10 +32,10 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
PageTitle(title: 'Daftar Pelanggan'),
|
const PageTitle(title: 'Daftar Pelanggan'),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: state.isFetching
|
child: state.isFetching
|
||||||
? Center(child: const LoaderWithText())
|
? const Center(child: LoaderWithText())
|
||||||
: state.failureOrOption.fold(
|
: state.failureOrOption.fold(
|
||||||
() => ListView.builder(
|
() => ListView.builder(
|
||||||
itemCount: state.customers.length,
|
itemCount: state.customers.length,
|
||||||
@ -91,7 +91,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
const CircleAvatar(
|
||||||
radius: 24,
|
radius: 24,
|
||||||
backgroundColor: AppColor.primary,
|
backgroundColor: AppColor.primary,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
@ -102,7 +102,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(
|
Text(
|
||||||
state.selectedCustomer?.name ?? "",
|
state.selectedCustomer?.name ?? "",
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@ -110,7 +110,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
DashedDivider(color: AppColor.border),
|
const DashedDivider(color: AppColor.border),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 12.0,
|
horizontal: 12.0,
|
||||||
@ -122,7 +122,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
const Text(
|
||||||
'No. Handphone',
|
'No. Handphone',
|
||||||
style: TextStyle(fontSize: 12.0),
|
style: TextStyle(fontSize: 12.0),
|
||||||
),
|
),
|
||||||
@ -135,19 +135,19 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
? "-"
|
? "-"
|
||||||
: state.selectedCustomer?.phone ??
|
: state.selectedCustomer?.phone ??
|
||||||
"-",
|
"-",
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
const Text(
|
||||||
'Email',
|
'Email',
|
||||||
style: TextStyle(fontSize: 12.0),
|
style: TextStyle(fontSize: 12.0),
|
||||||
),
|
),
|
||||||
@ -160,19 +160,19 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
? "-"
|
? "-"
|
||||||
: state.selectedCustomer?.email ??
|
: state.selectedCustomer?.email ??
|
||||||
"-",
|
"-",
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
const Text(
|
||||||
'Alamat',
|
'Alamat',
|
||||||
style: TextStyle(fontSize: 12.0),
|
style: TextStyle(fontSize: 12.0),
|
||||||
),
|
),
|
||||||
@ -187,7 +187,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
.selectedCustomer
|
.selectedCustomer
|
||||||
?.address ??
|
?.address ??
|
||||||
"-",
|
"-",
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
@ -216,7 +216,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
message: "Terjadi kesalahan saat memuat pelanggan",
|
message: "Terjadi kesalahan saat memuat pelanggan",
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<CustomerLoaderBloc>().add(
|
context.read<CustomerLoaderBloc>().add(
|
||||||
CustomerLoaderEvent.fetched(isRefresh: true),
|
const CustomerLoaderEvent.fetched(isRefresh: true),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -225,7 +225,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
message: "Pelanggan masih kosong, silahkan tambahkan pelanggan",
|
message: "Pelanggan masih kosong, silahkan tambahkan pelanggan",
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<CustomerLoaderBloc>().add(
|
context.read<CustomerLoaderBloc>().add(
|
||||||
CustomerLoaderEvent.fetched(isRefresh: true),
|
const CustomerLoaderEvent.fetched(isRefresh: true),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -234,7 +234,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
message: "Terjadi kesalahan saat memuat pelanggan",
|
message: "Terjadi kesalahan saat memuat pelanggan",
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<CustomerLoaderBloc>().add(
|
context.read<CustomerLoaderBloc>().add(
|
||||||
CustomerLoaderEvent.fetched(isRefresh: true),
|
const CustomerLoaderEvent.fetched(isRefresh: true),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -243,7 +243,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
message: value.erroMessage,
|
message: value.erroMessage,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<CustomerLoaderBloc>().add(
|
context.read<CustomerLoaderBloc>().add(
|
||||||
CustomerLoaderEvent.fetched(isRefresh: true),
|
const CustomerLoaderEvent.fetched(isRefresh: true),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -252,7 +252,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
message: "Terjadi kesalahan saat memuat pelanggan",
|
message: "Terjadi kesalahan saat memuat pelanggan",
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<CustomerLoaderBloc>().add(
|
context.read<CustomerLoaderBloc>().add(
|
||||||
CustomerLoaderEvent.fetched(isRefresh: true),
|
const CustomerLoaderEvent.fetched(isRefresh: true),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -263,7 +263,7 @@ class CustomerPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
Widget wrappedRoute(BuildContext context) => BlocProvider(
|
Widget wrappedRoute(BuildContext context) => BlocProvider(
|
||||||
create: (context) =>
|
create: (context) =>
|
||||||
getIt<CustomerLoaderBloc>()
|
getIt<CustomerLoaderBloc>()
|
||||||
..add(CustomerLoaderEvent.fetched(isRefresh: true)),
|
..add(const CustomerLoaderEvent.fetched(isRefresh: true)),
|
||||||
child: this,
|
child: this,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class HomePage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Hero(
|
return const Hero(
|
||||||
tag: 'confirmation_screen',
|
tag: 'confirmation_screen',
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: AppColor.white,
|
backgroundColor: AppColor.white,
|
||||||
@ -41,11 +41,12 @@ class HomePage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (context) =>
|
create: (context) =>
|
||||||
getIt<CategoryLoaderBloc>()
|
getIt<CategoryLoaderBloc>()
|
||||||
..add(CategoryLoaderEvent.getCategories()),
|
..add(const CategoryLoaderEvent.getCategories()),
|
||||||
),
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (context) =>
|
create: (context) =>
|
||||||
getIt<ProductLoaderBloc>()..add(ProductLoaderEvent.getProduct()),
|
getIt<ProductLoaderBloc>()
|
||||||
|
..add(const ProductLoaderEvent.getProduct()),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: this,
|
child: this,
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class _CategoryTabBarState extends State<CategoryTabBar>
|
|||||||
if (_tabController.indexIsChanging) {
|
if (_tabController.indexIsChanging) {
|
||||||
if (_tabController.index == 0) {
|
if (_tabController.index == 0) {
|
||||||
context.read<ProductLoaderBloc>().add(
|
context.read<ProductLoaderBloc>().add(
|
||||||
ProductLoaderEvent.getProduct(),
|
const ProductLoaderEvent.getProduct(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
selectedCategoryId = widget.categories[_tabController.index].id;
|
selectedCategoryId = widget.categories[_tabController.index].id;
|
||||||
@ -64,7 +64,7 @@ class _CategoryTabBarState extends State<CategoryTabBar>
|
|||||||
if (_tabController.indexIsChanging) {
|
if (_tabController.indexIsChanging) {
|
||||||
if (_tabController.index == 0) {
|
if (_tabController.index == 0) {
|
||||||
context.read<ProductLoaderBloc>().add(
|
context.read<ProductLoaderBloc>().add(
|
||||||
ProductLoaderEvent.getProduct(),
|
const ProductLoaderEvent.getProduct(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
selectedCategoryId = widget.categories[_tabController.index].id;
|
selectedCategoryId = widget.categories[_tabController.index].id;
|
||||||
@ -99,7 +99,7 @@ class _CategoryTabBarState extends State<CategoryTabBar>
|
|||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
tabAlignment: TabAlignment.start,
|
tabAlignment: TabAlignment.start,
|
||||||
labelColor: AppColor.primary,
|
labelColor: AppColor.primary,
|
||||||
labelStyle: TextStyle(fontWeight: FontWeight.bold),
|
labelStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
dividerColor: AppColor.primary,
|
dividerColor: AppColor.primary,
|
||||||
unselectedLabelColor: AppColor.primary,
|
unselectedLabelColor: AppColor.primary,
|
||||||
indicatorSize: TabBarIndicatorSize.label,
|
indicatorSize: TabBarIndicatorSize.label,
|
||||||
|
|||||||
@ -33,7 +33,9 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
if (notification is ScrollEndNotification &&
|
if (notification is ScrollEndNotification &&
|
||||||
scrollController.position.extentAfter == 0) {
|
scrollController.position.extentAfter == 0) {
|
||||||
log('📄 Loading more products...');
|
log('📄 Loading more products...');
|
||||||
context.read<ProductLoaderBloc>().add(ProductLoaderEvent.loadMore());
|
context.read<ProductLoaderBloc>().add(
|
||||||
|
const ProductLoaderEvent.loadMore(),
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -44,7 +46,7 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
return BlocBuilder<CategoryLoaderBloc, CategoryLoaderState>(
|
return BlocBuilder<CategoryLoaderBloc, CategoryLoaderState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state.isLoadingMore) {
|
if (state.isLoadingMore) {
|
||||||
return Center(child: LoaderWithText());
|
return const Center(child: LoaderWithText());
|
||||||
}
|
}
|
||||||
return state.failureOptionCategory.fold(
|
return state.failureOptionCategory.fold(
|
||||||
() => _buildContent(context, state.categories),
|
() => _buildContent(context, state.categories),
|
||||||
@ -53,42 +55,42 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
title: 'Error Kategori',
|
title: 'Error Kategori',
|
||||||
message: 'Terjadi kesalahan saat memuat kategori',
|
message: 'Terjadi kesalahan saat memuat kategori',
|
||||||
onTap: () => context.read<CategoryLoaderBloc>().add(
|
onTap: () => context.read<CategoryLoaderBloc>().add(
|
||||||
CategoryLoaderEvent.getCategories(),
|
const CategoryLoaderEvent.getCategories(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
dynamicErrorMessage: (value) => ErrorCard(
|
dynamicErrorMessage: (value) => ErrorCard(
|
||||||
title: 'Error Kategori',
|
title: 'Error Kategori',
|
||||||
message: value.erroMessage,
|
message: value.erroMessage,
|
||||||
onTap: () => context.read<CategoryLoaderBloc>().add(
|
onTap: () => context.read<CategoryLoaderBloc>().add(
|
||||||
CategoryLoaderEvent.getCategories(),
|
const CategoryLoaderEvent.getCategories(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
localStorageError: (value) => ErrorCard(
|
localStorageError: (value) => ErrorCard(
|
||||||
title: 'Error Kategori',
|
title: 'Error Kategori',
|
||||||
message: value.erroMessage,
|
message: value.erroMessage,
|
||||||
onTap: () => context.read<CategoryLoaderBloc>().add(
|
onTap: () => context.read<CategoryLoaderBloc>().add(
|
||||||
CategoryLoaderEvent.getCategories(),
|
const CategoryLoaderEvent.getCategories(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
serverError: (value) => ErrorCard(
|
serverError: (value) => ErrorCard(
|
||||||
title: 'Error Kategori',
|
title: 'Error Kategori',
|
||||||
message: 'Terjadi kesalahan saat memuat kategori',
|
message: 'Terjadi kesalahan saat memuat kategori',
|
||||||
onTap: () => context.read<CategoryLoaderBloc>().add(
|
onTap: () => context.read<CategoryLoaderBloc>().add(
|
||||||
CategoryLoaderEvent.getCategories(),
|
const CategoryLoaderEvent.getCategories(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
unexpectedError: (value) => ErrorCard(
|
unexpectedError: (value) => ErrorCard(
|
||||||
title: 'Error Kategori',
|
title: 'Error Kategori',
|
||||||
message: 'Terjadi kesalahan saat memuat kategori',
|
message: 'Terjadi kesalahan saat memuat kategori',
|
||||||
onTap: () => context.read<CategoryLoaderBloc>().add(
|
onTap: () => context.read<CategoryLoaderBloc>().add(
|
||||||
CategoryLoaderEvent.getCategories(),
|
const CategoryLoaderEvent.getCategories(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
empty: (value) => ErrorCard(
|
empty: (value) => ErrorCard(
|
||||||
title: 'Error Kategori',
|
title: 'Error Kategori',
|
||||||
message: 'Kategori kosong',
|
message: 'Kategori kosong',
|
||||||
onTap: () => context.read<CategoryLoaderBloc>().add(
|
onTap: () => context.read<CategoryLoaderBloc>().add(
|
||||||
CategoryLoaderEvent.getCategories(),
|
const CategoryLoaderEvent.getCategories(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -108,7 +110,7 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Fast local search
|
// Fast local search
|
||||||
Future.delayed(Duration(milliseconds: 200), () {
|
Future.delayed(const Duration(milliseconds: 200), () {
|
||||||
if (value == searchController.text) {
|
if (value == searchController.text) {
|
||||||
log('🔍 Local search: "$value"');
|
log('🔍 Local search: "$value"');
|
||||||
context.read<ProductLoaderBloc>().add(
|
context.read<ProductLoaderBloc>().add(
|
||||||
@ -139,7 +141,7 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
title: 'Error Produk',
|
title: 'Error Produk',
|
||||||
message: 'Terjadi kesalahan saat memuat produk',
|
message: 'Terjadi kesalahan saat memuat produk',
|
||||||
onTap: () => context.read<ProductLoaderBloc>().add(
|
onTap: () => context.read<ProductLoaderBloc>().add(
|
||||||
ProductLoaderEvent.getProduct(),
|
const ProductLoaderEvent.getProduct(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -165,7 +167,7 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
children: [
|
children: [
|
||||||
if (products.isNotEmpty)
|
if (products.isNotEmpty)
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 16,
|
horizontal: 16,
|
||||||
vertical: 0,
|
vertical: 0,
|
||||||
).copyWith(bottom: 6),
|
).copyWith(bottom: 6),
|
||||||
@ -175,9 +177,9 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
'${products.length} produk ditemukan',
|
'${products.length} produk ditemukan',
|
||||||
style: AppStyle.sm.copyWith(color: AppColor.textSecondary),
|
style: AppStyle.sm.copyWith(color: AppColor.textSecondary),
|
||||||
),
|
),
|
||||||
Spacer(),
|
const Spacer(),
|
||||||
if (isLoadingMore)
|
if (isLoadingMore)
|
||||||
SizedBox(
|
const SizedBox(
|
||||||
width: 12,
|
width: 12,
|
||||||
height: 12,
|
height: 12,
|
||||||
child: SpinKitFadingCircle(
|
child: SpinKitFadingCircle(
|
||||||
@ -198,7 +200,7 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
cacheExtent: 200.0,
|
cacheExtent: 200.0,
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
maxCrossAxisExtent: 180,
|
maxCrossAxisExtent: 180,
|
||||||
mainAxisSpacing: 30,
|
mainAxisSpacing: 30,
|
||||||
crossAxisSpacing: 30,
|
crossAxisSpacing: 30,
|
||||||
@ -212,7 +214,7 @@ class _HomeLeftPanelState extends State<HomeLeftPanel> {
|
|||||||
|
|
||||||
if (hasReachedMax && products.isNotEmpty)
|
if (hasReachedMax && products.isNotEmpty)
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Semua produk telah dimuat',
|
'Semua produk telah dimuat',
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class HomeRightPanel extends StatelessWidget {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
HomeRightTitle(),
|
const HomeRightTitle(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(
|
padding: const EdgeInsets.all(
|
||||||
16.0,
|
16.0,
|
||||||
@ -54,7 +54,7 @@ class HomeRightPanel extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 130),
|
const SizedBox(width: 130),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -140,7 +140,7 @@ class HomeRightPanel extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(16.0),
|
const SpaceHeight(16.0),
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: AppElevatedButton.filled(
|
child: AppElevatedButton.filled(
|
||||||
@ -164,7 +164,7 @@ class HomeRightPanel extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
context.router.push(CheckoutRoute());
|
context.router.push(const CheckoutRoute());
|
||||||
},
|
},
|
||||||
label: 'Lanjutkan Pembayaran',
|
label: 'Lanjutkan Pembayaran',
|
||||||
),
|
),
|
||||||
|
|||||||
@ -19,9 +19,9 @@ class HomeRightTitle extends StatelessWidget {
|
|||||||
return BlocBuilder<CheckoutFormBloc, CheckoutFormState>(
|
return BlocBuilder<CheckoutFormBloc, CheckoutFormState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(top: 20),
|
padding: const EdgeInsets.only(top: 20),
|
||||||
height: context.deviceHeight * 0.15,
|
height: context.deviceHeight * 0.15,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
border: Border(left: BorderSide(color: Colors.white, width: 1.0)),
|
border: Border(left: BorderSide(color: Colors.white, width: 1.0)),
|
||||||
),
|
),
|
||||||
@ -47,7 +47,7 @@ class HomeRightTitle extends StatelessWidget {
|
|||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return OrderTypeDialog();
|
return const OrderTypeDialog();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -66,7 +66,7 @@ class HomeRightTitle extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
OrderType.takeAway => SizedBox.shrink(),
|
OrderType.takeAway => const SizedBox.shrink(),
|
||||||
OrderType.delivery => _buildButton(
|
OrderType.delivery => _buildButton(
|
||||||
state.delivery == null
|
state.delivery == null
|
||||||
? 'Pilih Pengiriman'
|
? 'Pilih Pengiriman'
|
||||||
@ -76,12 +76,12 @@ class HomeRightTitle extends StatelessWidget {
|
|||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return DeliveryDialog();
|
return const DeliveryDialog();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
OrderType.freeTable => SizedBox.shrink(),
|
OrderType.freeTable => const SizedBox.shrink(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class HomeTitle extends StatelessWidget {
|
|||||||
horizontal: 16.0,
|
horizontal: 16.0,
|
||||||
vertical: 0,
|
vertical: 0,
|
||||||
).copyWith(top: 20),
|
).copyWith(top: 20),
|
||||||
decoration: BoxDecoration(color: AppColor.white),
|
decoration: const BoxDecoration(color: AppColor.white),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -30,7 +30,7 @@ class HomeTitle extends StatelessWidget {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => showDialog(
|
onTap: () => showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => OutletDialog(),
|
builder: (context) => const OutletDialog(),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -44,8 +44,8 @@ class HomeTitle extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(2),
|
const SpaceWidth(2),
|
||||||
Icon(
|
const Icon(
|
||||||
Icons.keyboard_arrow_down,
|
Icons.keyboard_arrow_down,
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
size: 18,
|
size: 18,
|
||||||
|
|||||||
@ -64,9 +64,9 @@ class ReportPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceWidth(8),
|
const SpaceWidth(8),
|
||||||
AppIconButton(icons: Icons.download_outlined, onTap: () {}),
|
AppIconButton(icons: Icons.download_outlined, onTap: () {}),
|
||||||
SpaceWidth(8),
|
const SpaceWidth(8),
|
||||||
AppIconButton(
|
AppIconButton(
|
||||||
icons: Icons.refresh_outlined,
|
icons: Icons.refresh_outlined,
|
||||||
onTap: () => onFetched(context, state),
|
onTap: () => onFetched(context, state),
|
||||||
|
|||||||
@ -43,10 +43,10 @@ class ReportCategorySection extends StatelessWidget {
|
|||||||
endDate: endDate,
|
endDate: endDate,
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
_buildSummary(state),
|
_buildSummary(state),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
borderRadius: BorderRadius.circular(14),
|
borderRadius: BorderRadius.circular(14),
|
||||||
@ -56,7 +56,7 @@ class ReportCategorySection extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.disabled.withOpacity(0.8),
|
color: AppColor.disabled.withOpacity(0.8),
|
||||||
borderRadius: BorderRadius.vertical(
|
borderRadius: const BorderRadius.vertical(
|
||||||
top: Radius.circular(14),
|
top: Radius.circular(14),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -113,7 +113,7 @@ class ReportCategorySection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
borderRadius: BorderRadius.vertical(
|
borderRadius: BorderRadius.vertical(
|
||||||
bottom: Radius.circular(14),
|
bottom: Radius.circular(14),
|
||||||
@ -246,7 +246,7 @@ class ReportCategorySection extends StatelessWidget {
|
|||||||
value: state.categoryAnalytic.totalRevenue.currencyFormatRpV2,
|
value: state.categoryAnalytic.totalRevenue.currencyFormatRpV2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.info,
|
color: AppColor.info,
|
||||||
@ -255,7 +255,7 @@ class ReportCategorySection extends StatelessWidget {
|
|||||||
value: "${state.categoryAnalytic.totalQuantity} pcs",
|
value: "${state.categoryAnalytic.totalQuantity} pcs",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class ReportDashboardSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: ReportDashboardProductChart(
|
child: ReportDashboardProductChart(
|
||||||
@ -91,7 +91,7 @@ class ReportDashboardSection extends StatelessWidget {
|
|||||||
data: state.dashboardAnalytic.topProducts,
|
data: state.dashboardAnalytic.topProducts,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: ReportDashboardOrder(data: state.dashboardAnalytic),
|
child: ReportDashboardOrder(data: state.dashboardAnalytic),
|
||||||
@ -139,7 +139,7 @@ class ReportDashboardSection extends StatelessWidget {
|
|||||||
.currencyFormatRpV2,
|
.currencyFormatRpV2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.info,
|
color: AppColor.info,
|
||||||
@ -151,7 +151,7 @@ class ReportDashboardSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -166,7 +166,7 @@ class ReportDashboardSection extends StatelessWidget {
|
|||||||
.currencyFormatRpV2,
|
.currencyFormatRpV2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class _ReportInventorySectionState extends State<ReportInventorySection> {
|
|||||||
return Future.value();
|
return Future.value();
|
||||||
},
|
},
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
children: [
|
children: [
|
||||||
ReportHeader(
|
ReportHeader(
|
||||||
menu: widget.menu,
|
menu: widget.menu,
|
||||||
@ -64,12 +64,12 @@ class _ReportInventorySectionState extends State<ReportInventorySection> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
_buildTab('Produk', 0),
|
_buildTab('Produk', 0),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
_buildTab('Bahan Baku', 1),
|
_buildTab('Bahan Baku', 1),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
|
|
||||||
_selectedTabIndex == 0
|
_selectedTabIndex == 0
|
||||||
? ReportInventoryProductTab(
|
? ReportInventoryProductTab(
|
||||||
@ -98,7 +98,7 @@ class _ReportInventorySectionState extends State<ReportInventorySection> {
|
|||||||
|
|
||||||
Padding _buildSummary() {
|
Padding _buildSummary() {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsetsGeometry.only(top: 16),
|
padding: const EdgeInsetsGeometry.only(top: 16),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -110,7 +110,7 @@ class _ReportInventorySectionState extends State<ReportInventorySection> {
|
|||||||
.toString(),
|
.toString(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.info,
|
color: AppColor.info,
|
||||||
@ -120,7 +120,7 @@ class _ReportInventorySectionState extends State<ReportInventorySection> {
|
|||||||
.toString(),
|
.toString(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
|
|||||||
@ -43,13 +43,13 @@ class ReportPaymentMethodSection extends StatelessWidget {
|
|||||||
return Future.value();
|
return Future.value();
|
||||||
},
|
},
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
children: [
|
children: [
|
||||||
ReportHeader(menu: menu, endDate: endDate, startDate: startDate),
|
ReportHeader(menu: menu, endDate: endDate, startDate: startDate),
|
||||||
_buildSummary(),
|
_buildSummary(),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
borderRadius: BorderRadius.circular(14),
|
borderRadius: BorderRadius.circular(14),
|
||||||
@ -65,7 +65,7 @@ class ReportPaymentMethodSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
|
|
||||||
...List.generate(state.paymentMethodAnalytic.data.length, (
|
...List.generate(state.paymentMethodAnalytic.data.length, (
|
||||||
index,
|
index,
|
||||||
@ -115,10 +115,10 @@ class ReportPaymentMethodSection extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(color: AppColor.primary, width: 1),
|
border: Border.all(color: AppColor.primary, width: 1),
|
||||||
),
|
),
|
||||||
child: Icon(Icons.money, color: AppColor.white, size: 20),
|
child: const Icon(Icons.money, color: AppColor.white, size: 20),
|
||||||
),
|
),
|
||||||
|
|
||||||
SpaceWidth(16),
|
const SpaceWidth(16),
|
||||||
|
|
||||||
// Payment Method Details
|
// Payment Method Details
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -145,7 +145,7 @@ class ReportPaymentMethodSection extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@ -167,7 +167,7 @@ class ReportPaymentMethodSection extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
|
|
||||||
// Progress Bar
|
// Progress Bar
|
||||||
Container(
|
Container(
|
||||||
@ -215,7 +215,7 @@ class ReportPaymentMethodSection extends StatelessWidget {
|
|||||||
.currencyFormatRpV2,
|
.currencyFormatRpV2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.info,
|
color: AppColor.info,
|
||||||
@ -227,7 +227,7 @@ class ReportPaymentMethodSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -242,7 +242,7 @@ class ReportPaymentMethodSection extends StatelessWidget {
|
|||||||
.currencyFormatRpV2,
|
.currencyFormatRpV2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.info,
|
color: AppColor.info,
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ReportProductSection extends StatelessWidget {
|
|||||||
return Future.value();
|
return Future.value();
|
||||||
},
|
},
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
ReportHeader(
|
ReportHeader(
|
||||||
@ -56,7 +56,7 @@ class ReportProductSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: 90,
|
height: 90,
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: state.productAnalytic.categories.length,
|
itemCount: state.productAnalytic.categories.length,
|
||||||
@ -85,7 +85,7 @@ class ReportProductSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
@ -127,7 +127,7 @@ class ReportProductSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
itemCount: state.productAnalytic.data.length,
|
itemCount: state.productAnalytic.data.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@ -172,8 +172,8 @@ class ReportProductSection extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildBottomSummary() {
|
Widget _buildBottomSummary() {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
||||||
decoration: BoxDecoration(color: AppColor.white),
|
decoration: const BoxDecoration(color: AppColor.white),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -185,7 +185,7 @@ class ReportProductSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.star, color: AppColor.success, size: 16),
|
const Icon(Icons.star, color: AppColor.success, size: 16),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -244,7 +244,7 @@ class ReportProductSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
|
|
||||||
// Product Info
|
// Product Info
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -296,7 +296,7 @@ class ReportProductSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(6),
|
const SpaceHeight(6),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
// Category Badge
|
// Category Badge
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class ReportProfitLossSection extends StatelessWidget {
|
|||||||
return Future.value();
|
return Future.value();
|
||||||
},
|
},
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
children: [
|
children: [
|
||||||
ReportHeader(menu: menu, endDate: endDate, startDate: startDate),
|
ReportHeader(menu: menu, endDate: endDate, startDate: startDate),
|
||||||
_buildSummary(),
|
_buildSummary(),
|
||||||
@ -63,7 +63,7 @@ class ReportProfitLossSection extends StatelessWidget {
|
|||||||
data: state.profitLossAnalytic.productData,
|
data: state.profitLossAnalytic.productData,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: ReportProfitLossBreakdown(
|
child: ReportProfitLossBreakdown(
|
||||||
@ -111,7 +111,7 @@ class ReportProfitLossSection extends StatelessWidget {
|
|||||||
.currencyFormatRpV2,
|
.currencyFormatRpV2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.info,
|
color: AppColor.info,
|
||||||
@ -124,7 +124,7 @@ class ReportProfitLossSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -137,7 +137,7 @@ class ReportProfitLossSection extends StatelessWidget {
|
|||||||
.currencyFormatRpV2,
|
.currencyFormatRpV2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
|
|||||||
@ -43,12 +43,12 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
return Future.value();
|
return Future.value();
|
||||||
},
|
},
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
children: [
|
children: [
|
||||||
ReportHeader(menu: menu, endDate: endDate, startDate: startDate),
|
ReportHeader(menu: menu, endDate: endDate, startDate: startDate),
|
||||||
_buildSummary(),
|
_buildSummary(),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
@ -64,7 +64,7 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
itemCount: state.salesAnalytic.sortedDailyData.length,
|
itemCount: state.salesAnalytic.sortedDailyData.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@ -85,7 +85,7 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
_buildSummaryFooter(),
|
_buildSummaryFooter(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -118,7 +118,7 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
width: 8,
|
width: 8,
|
||||||
height: 8,
|
height: 8,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.success,
|
color: AppColor.success,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
@ -127,10 +127,10 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Kinerja puncak pada ${state.salesAnalytic.highestRevenueDay.date.toSimpleMonthDate()} dengan pendapatan ${state.salesAnalytic.highestRevenueDay.sales.currencyFormatRpV2} (pesanan ${state.salesAnalytic.highestRevenueDay.orders})',
|
'Kinerja puncak pada ${state.salesAnalytic.highestRevenueDay.date.toSimpleMonthDate()} dengan pendapatan ${state.salesAnalytic.highestRevenueDay.sales.currencyFormatRpV2} (pesanan ${state.salesAnalytic.highestRevenueDay.orders})',
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: const Color(0xFF374151),
|
color: Color(0xFF374151),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -159,17 +159,17 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SizedBox(
|
||||||
width: 60,
|
width: 60,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
date,
|
date,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: const Color(0xFF111827),
|
color: Color(0xFF111827),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isHighest)
|
if (isHighest)
|
||||||
@ -183,7 +183,7 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
color: const Color(0xFF10B981),
|
color: const Color(0xFF10B981),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: const Text(
|
||||||
'TOP',
|
'TOP',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 8,
|
fontSize: 8,
|
||||||
@ -203,18 +203,18 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
sales,
|
sales,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: const Color(0xFF111827),
|
color: Color(0xFF111827),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
const Text(
|
||||||
'Pendapatan',
|
'Pendapatan',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color: const Color(0xFF6B7280),
|
color: Color(0xFF6B7280),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -227,18 +227,18 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'$orders pesanan',
|
'$orders pesanan',
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: const Color(0xFF374151),
|
color: Color(0xFF374151),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'$items item',
|
'$items item',
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color: const Color(0xFF6B7280),
|
color: Color(0xFF6B7280),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -265,7 +265,7 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
state.salesAnalytic.summary.totalSales.currencyFormatRpV2,
|
state.salesAnalytic.summary.totalSales.currencyFormatRpV2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.info,
|
color: AppColor.info,
|
||||||
@ -276,7 +276,7 @@ class ReportSalesSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
ReportSummaryCard(
|
ReportSummaryCard(
|
||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
icon: Icons.attach_money_outlined,
|
icon: Icons.attach_money_outlined,
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class ReportDashboardOrder extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(20),
|
const SpaceHeight(20),
|
||||||
_buildSummaryItem(
|
_buildSummaryItem(
|
||||||
'Total Pesanan',
|
'Total Pesanan',
|
||||||
'${data.overview.totalOrders}',
|
'${data.overview.totalOrders}',
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class ReportDashboardProductChart extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 160,
|
height: 160,
|
||||||
child: PieChart(
|
child: PieChart(
|
||||||
@ -57,7 +57,7 @@ class ReportDashboardProductChart extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
Column(
|
Column(
|
||||||
children: data.take(3).map((product) {
|
children: data.take(3).map((product) {
|
||||||
final index = data.indexOf(product);
|
final index = data.indexOf(product);
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class ReportDashboardSalesChart extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 220,
|
height: 220,
|
||||||
child: LineChart(
|
child: LineChart(
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class ReportDashboardTopProduct extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
Column(
|
Column(
|
||||||
children: data.map((product) {
|
children: data.map((product) {
|
||||||
return Container(
|
return Container(
|
||||||
@ -50,7 +50,7 @@ class ReportDashboardTopProduct extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(2),
|
const SpaceHeight(2),
|
||||||
Text(
|
Text(
|
||||||
product.categoryName,
|
product.categoryName,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class ReportInventoryIngredientTab extends StatelessWidget {
|
|||||||
value: data.summary.lowStockIngredients.toString(),
|
value: data.summary.lowStockIngredients.toString(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.error,
|
color: AppColor.error,
|
||||||
@ -32,7 +32,7 @@ class ReportInventoryIngredientTab extends StatelessWidget {
|
|||||||
value: data.summary.zeroStockIngredients.toString(),
|
value: data.summary.zeroStockIngredients.toString(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.error,
|
color: AppColor.error,
|
||||||
@ -44,8 +44,8 @@ class ReportInventoryIngredientTab extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.primary, // Purple color
|
color: AppColor.primary, // Purple color
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(8),
|
topLeft: Radius.circular(8),
|
||||||
@ -72,9 +72,9 @@ class ReportInventoryIngredientTab extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(color: AppColor.white),
|
decoration: const BoxDecoration(color: AppColor.white),
|
||||||
child: Table(
|
child: Table(
|
||||||
columnWidths: {
|
columnWidths: const {
|
||||||
0: FlexColumnWidth(2.5), // Name
|
0: FlexColumnWidth(2.5), // Name
|
||||||
1: FlexColumnWidth(1), // Stock
|
1: FlexColumnWidth(1), // Stock
|
||||||
2: FlexColumnWidth(2), // Masuk
|
2: FlexColumnWidth(2), // Masuk
|
||||||
@ -91,7 +91,7 @@ class ReportInventoryIngredientTab extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.primary, // Purple color
|
color: AppColor.primary, // Purple color
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(8),
|
bottomLeft: Radius.circular(8),
|
||||||
@ -165,7 +165,7 @@ class ReportInventoryIngredientTab extends StatelessWidget {
|
|||||||
Color? textColor,
|
Color? textColor,
|
||||||
}) {
|
}) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
||||||
alignment: alignment,
|
alignment: alignment,
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
@ -182,7 +182,7 @@ class ReportInventoryIngredientTab extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildHeaderCell(String text) {
|
Widget _buildHeaderCell(String text) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
@ -196,7 +196,7 @@ class ReportInventoryIngredientTab extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildTotalCell(String text) {
|
Widget _buildTotalCell(String text) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class ReportInventoryProductTab extends StatelessWidget {
|
|||||||
value: data.summary.lowStockProducts.toString(),
|
value: data.summary.lowStockProducts.toString(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.error,
|
color: AppColor.error,
|
||||||
@ -32,7 +32,7 @@ class ReportInventoryProductTab extends StatelessWidget {
|
|||||||
value: data.summary.zeroStockProducts.toString(),
|
value: data.summary.zeroStockProducts.toString(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReportSummaryCard(
|
child: ReportSummaryCard(
|
||||||
color: AppColor.error,
|
color: AppColor.error,
|
||||||
@ -44,8 +44,8 @@ class ReportInventoryProductTab extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.primary, // Purple color
|
color: AppColor.primary, // Purple color
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(8),
|
topLeft: Radius.circular(8),
|
||||||
@ -74,9 +74,9 @@ class ReportInventoryProductTab extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(color: AppColor.white),
|
decoration: const BoxDecoration(color: AppColor.white),
|
||||||
child: Table(
|
child: Table(
|
||||||
columnWidths: {
|
columnWidths: const {
|
||||||
0: FlexColumnWidth(2.5), // Produk
|
0: FlexColumnWidth(2.5), // Produk
|
||||||
1: FlexColumnWidth(2), // Kategori
|
1: FlexColumnWidth(2), // Kategori
|
||||||
2: FlexColumnWidth(1), // Stock
|
2: FlexColumnWidth(1), // Stock
|
||||||
@ -94,7 +94,7 @@ class ReportInventoryProductTab extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: AppColor.primary, // Purple color
|
color: AppColor.primary, // Purple color
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(8),
|
bottomLeft: Radius.circular(8),
|
||||||
@ -171,7 +171,7 @@ class ReportInventoryProductTab extends StatelessWidget {
|
|||||||
Color? textColor,
|
Color? textColor,
|
||||||
}) {
|
}) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
||||||
alignment: alignment,
|
alignment: alignment,
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
@ -188,7 +188,7 @@ class ReportInventoryProductTab extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildHeaderCell(String text) {
|
Widget _buildHeaderCell(String text) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
@ -202,7 +202,7 @@ class ReportInventoryProductTab extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildTotalCell(String text) {
|
Widget _buildTotalCell(String text) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
|
|||||||
@ -52,12 +52,12 @@ class ReportProfitLossBreakdown extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Text(
|
Text(
|
||||||
'Komponen pembentuk profit',
|
'Komponen pembentuk profit',
|
||||||
style: AppStyle.sm.copyWith(color: AppColor.textSecondary),
|
style: AppStyle.sm.copyWith(color: AppColor.textSecondary),
|
||||||
),
|
),
|
||||||
SpaceHeight(20),
|
const SpaceHeight(20),
|
||||||
|
|
||||||
// Grafik Donut
|
// Grafik Donut
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -93,7 +93,7 @@ class ReportProfitLossBreakdown extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
|
|
||||||
// Legenda
|
// Legenda
|
||||||
Column(
|
Column(
|
||||||
@ -132,7 +132,7 @@ class ReportProfitLossBreakdown extends StatelessWidget {
|
|||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
|
|
||||||
// Rasio Profitabilitas
|
// Rasio Profitabilitas
|
||||||
Container(
|
Container(
|
||||||
@ -159,7 +159,7 @@ class ReportProfitLossBreakdown extends StatelessWidget {
|
|||||||
color: AppColor.textSecondary,
|
color: AppColor.textSecondary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
Text(
|
Text(
|
||||||
'${safeRound(data.summary.profitabilityRatio)}%',
|
'${safeRound(data.summary.profitabilityRatio)}%',
|
||||||
style: AppStyle.h5.copyWith(
|
style: AppStyle.h5.copyWith(
|
||||||
@ -167,7 +167,7 @@ class ReportProfitLossBreakdown extends StatelessWidget {
|
|||||||
color: AppColor.primary,
|
color: AppColor.primary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Text(
|
Text(
|
||||||
'Tingkat Pengembalian Pendapatan',
|
'Tingkat Pengembalian Pendapatan',
|
||||||
style: AppStyle.xs.copyWith(
|
style: AppStyle.xs.copyWith(
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class ReportProfitLossMetric extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
@ -30,7 +30,7 @@ class ReportProfitLossMetric extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
@ -43,7 +43,7 @@ class ReportProfitLossMetric extends StatelessWidget {
|
|||||||
AppColor.info,
|
AppColor.info,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _buildMetricCard(
|
child: _buildMetricCard(
|
||||||
'Keuntungan Rata-rata',
|
'Keuntungan Rata-rata',
|
||||||
@ -53,7 +53,7 @@ class ReportProfitLossMetric extends StatelessWidget {
|
|||||||
AppColor.success,
|
AppColor.success,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _buildMetricCard(
|
child: _buildMetricCard(
|
||||||
'Rasio Biaya',
|
'Rasio Biaya',
|
||||||
@ -66,7 +66,7 @@ class ReportProfitLossMetric extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
|
|
||||||
// Tabel rincian harian
|
// Tabel rincian harian
|
||||||
Container(
|
Container(
|
||||||
@ -246,7 +246,7 @@ class ReportProfitLossMetric extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Icon(icon, color: color, size: 24),
|
Icon(icon, color: color, size: 24),
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
Text(
|
Text(
|
||||||
value,
|
value,
|
||||||
style: AppStyle.lg.copyWith(
|
style: AppStyle.lg.copyWith(
|
||||||
@ -254,7 +254,7 @@ class ReportProfitLossMetric extends StatelessWidget {
|
|||||||
color: color,
|
color: color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
@ -263,7 +263,7 @@ class ReportProfitLossMetric extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(2),
|
const SpaceHeight(2),
|
||||||
Text(
|
Text(
|
||||||
subtitle,
|
subtitle,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
|||||||
@ -28,12 +28,12 @@ class ReportProfitLossProductProfitability extends StatelessWidget {
|
|||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Text(
|
Text(
|
||||||
'Analisis margin keuntungan per produk',
|
'Analisis margin keuntungan per produk',
|
||||||
style: AppStyle.sm.copyWith(color: AppColor.textSecondary),
|
style: AppStyle.sm.copyWith(color: AppColor.textSecondary),
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
Column(
|
Column(
|
||||||
children: data.take(4).map((product) {
|
children: data.take(4).map((product) {
|
||||||
return _buildProductItem(product);
|
return _buildProductItem(product);
|
||||||
@ -72,10 +72,10 @@ class ReportProfitLossProductProfitability extends StatelessWidget {
|
|||||||
product.productName,
|
product.productName,
|
||||||
style: AppStyle.md.copyWith(
|
style: AppStyle.md.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Color(0xFF0F172A),
|
color: const Color(0xFF0F172A),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(2),
|
const SpaceHeight(2),
|
||||||
Text(
|
Text(
|
||||||
'${product.quantitySold} unit • ${product.categoryName}',
|
'${product.quantitySold} unit • ${product.categoryName}',
|
||||||
style: AppStyle.sm.copyWith(
|
style: AppStyle.sm.copyWith(
|
||||||
@ -105,7 +105,7 @@ class ReportProfitLossProductProfitability extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(4),
|
const SpaceHeight(4),
|
||||||
Text(
|
Text(
|
||||||
product.grossProfit.toString().currencyFormatRpV2,
|
product.grossProfit.toString().currencyFormatRpV2,
|
||||||
style: AppStyle.md.copyWith(
|
style: AppStyle.md.copyWith(
|
||||||
@ -118,7 +118,7 @@ class ReportProfitLossProductProfitability extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -128,7 +128,7 @@ class ReportProfitLossProductProfitability extends StatelessWidget {
|
|||||||
AppColor.info,
|
AppColor.info,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(8),
|
const SpaceWidth(8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _buildProductMetric(
|
child: _buildProductMetric(
|
||||||
'Biaya',
|
'Biaya',
|
||||||
@ -136,7 +136,7 @@ class ReportProfitLossProductProfitability extends StatelessWidget {
|
|||||||
AppColor.error,
|
AppColor.error,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(8),
|
const SpaceWidth(8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _buildProductMetric(
|
child: _buildProductMetric(
|
||||||
'Laba/Unit',
|
'Laba/Unit',
|
||||||
@ -168,7 +168,7 @@ class ReportProfitLossProductProfitability extends StatelessWidget {
|
|||||||
color: Colors.grey[600],
|
color: Colors.grey[600],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceHeight(2),
|
const SpaceHeight(2),
|
||||||
Text(
|
Text(
|
||||||
value.toString().currencyFormatRpV2,
|
value.toString().currencyFormatRpV2,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class ReportProfitLossTrendChart extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class ReportMenuCard extends StatelessWidget {
|
|||||||
menu.title,
|
menu.title,
|
||||||
style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold),
|
style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
SpaceHeight(4.0),
|
const SpaceHeight(4.0),
|
||||||
Text(
|
Text(
|
||||||
menu.subtitle,
|
menu.subtitle,
|
||||||
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class _SettingPrinterBarState extends State<SettingPrinterBar> {
|
|||||||
code: 'bar',
|
code: 'bar',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('bar'),
|
const PrinterLoaderEvent.getByCode('bar'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -105,7 +105,7 @@ class _SettingPrinterBarState extends State<SettingPrinterBar> {
|
|||||||
},
|
},
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('bar'),
|
const PrinterLoaderEvent.getByCode('bar'),
|
||||||
);
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
isEdit = false;
|
isEdit = false;
|
||||||
@ -143,7 +143,7 @@ class _SettingPrinterBarState extends State<SettingPrinterBar> {
|
|||||||
code: 'bar',
|
code: 'bar',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('bar'),
|
const PrinterLoaderEvent.getByCode('bar'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class _SettingPrinterCheckerState extends State<SettingPrinterChecker> {
|
|||||||
code: 'checker',
|
code: 'checker',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('checker'),
|
const PrinterLoaderEvent.getByCode('checker'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -105,7 +105,7 @@ class _SettingPrinterCheckerState extends State<SettingPrinterChecker> {
|
|||||||
},
|
},
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('checker'),
|
const PrinterLoaderEvent.getByCode('checker'),
|
||||||
);
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
isEdit = false;
|
isEdit = false;
|
||||||
@ -143,7 +143,7 @@ class _SettingPrinterCheckerState extends State<SettingPrinterChecker> {
|
|||||||
code: 'checker',
|
code: 'checker',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('checker'),
|
const PrinterLoaderEvent.getByCode('checker'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -141,7 +141,7 @@ class _SettingPrinterFormState extends State<SettingPrinterForm> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
state.type == 'Bluetooth'
|
state.type == 'Bluetooth'
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@ -169,7 +169,7 @@ class _SettingPrinterFormState extends State<SettingPrinterForm> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
AppTextFormField(
|
AppTextFormField(
|
||||||
label: 'Nama Printer',
|
label: 'Nama Printer',
|
||||||
controller: _nameController,
|
controller: _nameController,
|
||||||
@ -179,7 +179,7 @@ class _SettingPrinterFormState extends State<SettingPrinterForm> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
AppDropdownSearch<String>(
|
AppDropdownSearch<String>(
|
||||||
label: 'Kertas',
|
label: 'Kertas',
|
||||||
hintText: 'Kertas Tipe',
|
hintText: 'Kertas Tipe',
|
||||||
@ -192,7 +192,7 @@ class _SettingPrinterFormState extends State<SettingPrinterForm> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SpaceHeight(20),
|
const SpaceHeight(20),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (widget.printer != null) ...[
|
if (widget.printer != null) ...[
|
||||||
@ -202,7 +202,7 @@ class _SettingPrinterFormState extends State<SettingPrinterForm> {
|
|||||||
label: 'Batal',
|
label: 'Batal',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
],
|
],
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AppElevatedButton.outlined(
|
child: AppElevatedButton.outlined(
|
||||||
@ -217,7 +217,7 @@ class _SettingPrinterFormState extends State<SettingPrinterForm> {
|
|||||||
label: 'Test Print',
|
label: 'Test Print',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AppElevatedButton.filled(
|
child: AppElevatedButton.filled(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@ -228,7 +228,7 @@ class _SettingPrinterFormState extends State<SettingPrinterForm> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
context.read<PrinterFormBloc>().add(
|
context.read<PrinterFormBloc>().add(
|
||||||
PrinterFormEvent.created(),
|
const PrinterFormEvent.created(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class _SettingPrinterKitchenState extends State<SettingPrinterKitchen> {
|
|||||||
code: 'kitchen',
|
code: 'kitchen',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('kitchen'),
|
const PrinterLoaderEvent.getByCode('kitchen'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -105,7 +105,7 @@ class _SettingPrinterKitchenState extends State<SettingPrinterKitchen> {
|
|||||||
},
|
},
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('kitchen'),
|
const PrinterLoaderEvent.getByCode('kitchen'),
|
||||||
);
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
isEdit = false;
|
isEdit = false;
|
||||||
@ -143,7 +143,7 @@ class _SettingPrinterKitchenState extends State<SettingPrinterKitchen> {
|
|||||||
code: 'kitchen',
|
code: 'kitchen',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('kitchen'),
|
const PrinterLoaderEvent.getByCode('kitchen'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class _SettingPrinterReceiptState extends State<SettingPrinterReceipt> {
|
|||||||
code: 'receipt',
|
code: 'receipt',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('receipt'),
|
const PrinterLoaderEvent.getByCode('receipt'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -105,7 +105,7 @@ class _SettingPrinterReceiptState extends State<SettingPrinterReceipt> {
|
|||||||
},
|
},
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('receipt'),
|
const PrinterLoaderEvent.getByCode('receipt'),
|
||||||
);
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
isEdit = false;
|
isEdit = false;
|
||||||
@ -143,7 +143,7 @@ class _SettingPrinterReceiptState extends State<SettingPrinterReceipt> {
|
|||||||
code: 'receipt',
|
code: 'receipt',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('receipt'),
|
const PrinterLoaderEvent.getByCode('receipt'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class _SettingPrinterTicketState extends State<SettingPrinterTicket> {
|
|||||||
code: 'ticket',
|
code: 'ticket',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('ticket'),
|
const PrinterLoaderEvent.getByCode('ticket'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -105,7 +105,7 @@ class _SettingPrinterTicketState extends State<SettingPrinterTicket> {
|
|||||||
},
|
},
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('ticket'),
|
const PrinterLoaderEvent.getByCode('ticket'),
|
||||||
);
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
isEdit = false;
|
isEdit = false;
|
||||||
@ -140,7 +140,7 @@ class _SettingPrinterTicketState extends State<SettingPrinterTicket> {
|
|||||||
code: 'ticket',
|
code: 'ticket',
|
||||||
onSuccess: () {
|
onSuccess: () {
|
||||||
context.read<PrinterLoaderBloc>().add(
|
context.read<PrinterLoaderBloc>().add(
|
||||||
PrinterLoaderEvent.getByCode('ticket'),
|
const PrinterLoaderEvent.getByCode('ticket'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class SettingPrinterSection extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return const Column(
|
||||||
children: [
|
children: [
|
||||||
PageTitle(
|
PageTitle(
|
||||||
isBack: false,
|
isBack: false,
|
||||||
|
|||||||
@ -79,7 +79,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
PageTitle(
|
const PageTitle(
|
||||||
title: 'Sinkronisasi',
|
title: 'Sinkronisasi',
|
||||||
subtitle: 'Sinkronisasi data dengan server',
|
subtitle: 'Sinkronisasi data dengan server',
|
||||||
isBack: false,
|
isBack: false,
|
||||||
@ -91,11 +91,11 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SpaceHeight(24),
|
const SpaceHeight(24),
|
||||||
_buildQuickActions(context, state),
|
_buildQuickActions(context, state),
|
||||||
SpaceHeight(24),
|
const SpaceHeight(24),
|
||||||
_buildSyncTables(context, state),
|
_buildSyncTables(context, state),
|
||||||
SpaceHeight(24),
|
const SpaceHeight(24),
|
||||||
_buildDatabaseStats(context, state),
|
_buildDatabaseStats(context, state),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -123,7 +123,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
'Aksi Cepat',
|
'Aksi Cepat',
|
||||||
style: AppStyle.lg.copyWith(fontWeight: FontWeight.w600),
|
style: AppStyle.lg.copyWith(fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -136,7 +136,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
: 'Sync Semua Data',
|
: 'Sync Semua Data',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AppElevatedButton.outlined(
|
child: AppElevatedButton.outlined(
|
||||||
onPressed: state.isLoading || state.isSyncing
|
onPressed: state.isLoading || state.isSyncing
|
||||||
@ -168,7 +168,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
'Sinkronisasi per Tabel',
|
'Sinkronisasi per Tabel',
|
||||||
style: AppStyle.lg.copyWith(fontWeight: FontWeight.w600),
|
style: AppStyle.lg.copyWith(fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
_buildSyncTableItem(
|
_buildSyncTableItem(
|
||||||
context: context,
|
context: context,
|
||||||
state: state,
|
state: state,
|
||||||
@ -184,9 +184,9 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
onClear: () => _clearCategories(context),
|
onClear: () => _clearCategories(context),
|
||||||
),
|
),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
SpaceHeight(12),
|
const SpaceHeight(12),
|
||||||
_buildSyncTableItem(
|
_buildSyncTableItem(
|
||||||
context: context,
|
context: context,
|
||||||
state: state,
|
state: state,
|
||||||
@ -228,7 +228,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Icon(icon, color: color, size: 24),
|
child: Icon(icon, color: color, size: 24),
|
||||||
),
|
),
|
||||||
SpaceWidth(12),
|
const SpaceWidth(12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -239,7 +239,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
title,
|
title,
|
||||||
style: AppStyle.md.copyWith(fontWeight: FontWeight.w600),
|
style: AppStyle.md.copyWith(fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
SpaceWidth(8),
|
const SpaceWidth(8),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 6,
|
horizontal: 6,
|
||||||
@ -278,7 +278,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
foregroundColor: color,
|
foregroundColor: color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SpaceWidth(4),
|
const SpaceWidth(4),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: state.isLoading || state.isSyncing ? null : onClear,
|
onPressed: state.isLoading || state.isSyncing ? null : onClear,
|
||||||
icon: const Icon(Icons.delete_outline, size: 20),
|
icon: const Icon(Icons.delete_outline, size: 20),
|
||||||
@ -320,7 +320,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
if (state.isLoading)
|
if (state.isLoading)
|
||||||
Center(child: LoaderWithText())
|
const Center(child: LoaderWithText())
|
||||||
else
|
else
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@ -333,7 +333,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SpaceHeight(16),
|
const SpaceHeight(16),
|
||||||
if (state.isLoading)
|
if (state.isLoading)
|
||||||
const Center(child: LoaderWithText())
|
const Center(child: LoaderWithText())
|
||||||
else
|
else
|
||||||
@ -345,28 +345,28 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
Icons.category,
|
Icons.category,
|
||||||
Colors.blue,
|
Colors.blue,
|
||||||
),
|
),
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
_buildStatRow(
|
_buildStatRow(
|
||||||
'Produk',
|
'Produk',
|
||||||
state.productStats['total_products']?.toString() ?? '0',
|
state.productStats['total_products']?.toString() ?? '0',
|
||||||
Icons.inventory_2,
|
Icons.inventory_2,
|
||||||
Colors.green,
|
Colors.green,
|
||||||
),
|
),
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
_buildStatRow(
|
_buildStatRow(
|
||||||
'Variant',
|
'Variant',
|
||||||
state.productStats['total_variants']?.toString() ?? '0',
|
state.productStats['total_variants']?.toString() ?? '0',
|
||||||
Icons.tune,
|
Icons.tune,
|
||||||
Colors.orange,
|
Colors.orange,
|
||||||
),
|
),
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
_buildStatRow(
|
_buildStatRow(
|
||||||
'Cache Entries',
|
'Cache Entries',
|
||||||
'$totalCacheEntries',
|
'$totalCacheEntries',
|
||||||
Icons.memory,
|
Icons.memory,
|
||||||
Colors.purple,
|
Colors.purple,
|
||||||
),
|
),
|
||||||
SpaceHeight(8),
|
const SpaceHeight(8),
|
||||||
_buildStatRow(
|
_buildStatRow(
|
||||||
'Ukuran Database',
|
'Ukuran Database',
|
||||||
'${totalDatabaseSize.toStringAsFixed(2)} MB',
|
'${totalDatabaseSize.toStringAsFixed(2)} MB',
|
||||||
@ -384,7 +384,7 @@ class _SettingSyncPageContent extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(icon, size: 16, color: color),
|
Icon(icon, size: 16, color: color),
|
||||||
SpaceWidth(8),
|
const SpaceWidth(8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
label,
|
label,
|
||||||
|
|||||||
@ -25,8 +25,8 @@ class SettingPage extends StatelessWidget implements AutoRouteWrapper {
|
|||||||
Expanded(
|
Expanded(
|
||||||
flex: 4,
|
flex: 4,
|
||||||
child: switch (state.index) {
|
child: switch (state.index) {
|
||||||
0 => SettingPrinterSection(),
|
0 => const SettingPrinterSection(),
|
||||||
1 => SettingSyncSection(),
|
1 => const SettingSyncSection(),
|
||||||
_ => Container(),
|
_ => Container(),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user