Files
food_delivery_mobile/lib/feature/basket/presentation/blocs/basket_bloc.dart
2025-10-25 11:38:17 +05:00

21 lines
552 B
Dart

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