21 lines
837 B
Dart
21 lines
837 B
Dart
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:hl_lieferservice/bloc/app_events.dart';
|
|
import 'package:hl_lieferservice/bloc/app_states.dart';
|
|
|
|
/// App-Bootstrap-Bloc.
|
|
///
|
|
/// Vor der Backend-Migration lud dieser Bloc eine `hl_server_config.json` aus
|
|
/// assets, parste daraus eine `backendUrl` und persistierte sie ins Dateisystem.
|
|
/// Mit dem Wechsel auf das Rust-Backend kommt die URL über `BackendConfig`
|
|
/// (compile-time, siehe `data/network/backend_config.dart`); der App-Bloc
|
|
/// emittiert jetzt nur noch sofort `AppConfigLoaded`, damit die UI ihre
|
|
/// üblichen Phasen-Übergänge behält.
|
|
class AppBloc extends Bloc<AppEvents, AppState> {
|
|
AppBloc() : super(const AppInitial()) {
|
|
on<AppLoadConfig>((event, emit) {
|
|
emit(const AppConfigLoading());
|
|
emit(const AppConfigLoaded());
|
|
});
|
|
}
|
|
}
|