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, orders: []));
  }
}
