feat(umgebung): Server-Umgebung im Login-Screen waehlbar (Produktion/Test)
- Umgebungen (Name, API-URL, Keycloak-Issuer) kommen aus assets/hl_server_config.json statt hartcodiertem BackendConfig.prod; Testumgebung 192.168.1.9:3001 ist dort hinterlegt - AppBloc laedt die Config, aktiviert die gespeicherte Wahl (Fallback Default) und registriert das Networking; Wechsel persistiert per SharedPreferences und registriert neu - Bloc-Baum ist pro Umgebung gekeyt: beim Wechsel entstehen alle Blocs mit dem neuen API-Client neu - Login-Screen: Zahnrad oben rechts oeffnet Einstellungen mit Umgebungs- Cards (Name + IP:Port); Hinweis auf aktive Umgebung unter dem Button - Fahrzeugauswahl pro Umgebung getrennt (eigene DB = eigene Car-IDs) - Tests fuer Config-Parsing, Auswahl-Fallback, Card-Wechsel, Re-Registrierung Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,10 +1,9 @@
|
||||
import 'package:hl_lieferservice/data/network/backend_environment.dart';
|
||||
|
||||
/// Lifecycle-States des App-Bootstraps.
|
||||
///
|
||||
/// Die alte `LocalDocuFrameConfiguration` mit `backendUrl` ist mit der
|
||||
/// Backend-Migration entfallen — die App-Konfiguration kommt jetzt aus
|
||||
/// `BackendConfig` (compile-time) und nicht mehr aus einer asset-JSON.
|
||||
/// Das `AppConfigLoaded`-Signal bleibt als Marker, dass der App-Bootstrap
|
||||
/// abgeschlossen ist (Networking ist registriert, Token-Provider steht).
|
||||
/// `AppConfigLoaded` heißt: Server-Config ist gelesen, die aktive Umgebung
|
||||
/// steht fest und das Networking dafür ist im Locator registriert.
|
||||
abstract class AppState {
|
||||
const AppState();
|
||||
}
|
||||
@ -18,7 +17,13 @@ class AppConfigLoading extends AppState {
|
||||
}
|
||||
|
||||
class AppConfigLoaded extends AppState {
|
||||
const AppConfigLoaded();
|
||||
const AppConfigLoaded({required this.catalog, required this.active});
|
||||
|
||||
/// Alle auswählbaren Umgebungen aus der Config-Datei.
|
||||
final ServerCatalog catalog;
|
||||
|
||||
/// Die Umgebung, gegen die die App gerade spricht.
|
||||
final BackendEnvironment active;
|
||||
}
|
||||
|
||||
class AppConfigLoadingFailed extends AppState {
|
||||
|
||||
Reference in New Issue
Block a user