feat:Order item created
This commit is contained in:
20
lib/feature/basket/presentation/blocs/basket_bloc.dart
Normal file
20
lib/feature/basket/presentation/blocs/basket_bloc.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:food_delivery_client/food_delivery_client.dart';
|
||||
|
||||
part 'basket_event.dart';
|
||||
|
||||
part 'basket_state.dart';
|
||||
|
||||
part 'basket_bloc.freezed.dart';
|
||||
|
||||
@injectable
|
||||
class BasketBloc extends Bloc<BasketEvent, BasketState> {
|
||||
BasketBloc() : super(const BasketState()) {
|
||||
on<_Started>(_onStarted);
|
||||
}
|
||||
|
||||
_onStarted(_Started event, Emitter<BasketState> emit) async {
|
||||
emit(state.copyWith(status: RequestStatus.loading));
|
||||
await Future.delayed(TimeDelayConst.duration3);
|
||||
emit(state.copyWith(status: RequestStatus.loaded));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user