import 'package:food_delivery_client/food_delivery_client.dart';

part 'splash_event.dart';

part 'splash_state.dart';

part 'splash_bloc.freezed.dart';

@injectable
class SplashBloc extends Bloc<SplashEvent, SplashState> {
  SplashBloc() : super(const SplashState()) {
    on<_Started>(_onStarted);
  }

  Future<void> _onStarted(_Started event, Emitter<SplashState> emit) async {
    await Future.delayed(TimeDelayConst.duration3);
    emit(state.copyWith(status: RequestStatus.loaded));
  }
}
