const constructure
This commit is contained in:
@@ -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.',
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user