const constructure

This commit is contained in:
Efril
2026-03-01 20:02:12 +07:00
parent 5058f99fe0
commit e625bd3d2a
142 changed files with 817 additions and 760 deletions
+4 -4
View File
@@ -33,16 +33,16 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
state.copyWith(
failureOption: optionOf(f),
status: token
? AuthStatus.authenticated()
: AuthStatus.unauthenticated(),
? const AuthStatus.authenticated()
: const AuthStatus.unauthenticated(),
),
),
(user) => emit(
state.copyWith(
user: user,
status: token
? AuthStatus.authenticated()
: AuthStatus.unauthenticated(),
? const AuthStatus.authenticated()
: const AuthStatus.unauthenticated(),
),
),
);
@@ -175,7 +175,7 @@ class CategoryLoaderBloc
_searchDebounce?.cancel();
// Debounce search for better UX
_searchDebounce = Timer(Duration(milliseconds: 300), () async {
_searchDebounce = Timer(const Duration(milliseconds: 300), () async {
emit(state.copyWith(isLoadingMore: true));
_isLoadingMore = false;
@@ -237,7 +237,7 @@ class CategoryLoaderBloc
);
// After sync error, try to load local data
Timer(Duration(seconds: 2), () {
Timer(const Duration(seconds: 2), () {
add(const CategoryLoaderEvent.getCategories());
});
},
@@ -251,7 +251,7 @@ class CategoryLoaderBloc
);
// After successful sync, load the updated data
Timer(Duration(seconds: 1), () {
Timer(const Duration(seconds: 1), () {
add(const CategoryLoaderEvent.getCategories());
});
},
@@ -43,7 +43,7 @@ class ProductLoaderBloc extends Bloc<ProductLoaderEvent, ProductLoaderState> {
state.copyWith(
isLoadingMore: false,
failureOptionProduct: optionOf(
ProductFailure.dynamicErrorMessage(
const ProductFailure.dynamicErrorMessage(
'Database lokal belum siap. Silakan lakukan sinkronisasi data terlebih dahulu.',
),
),