fix: Fehlerbehandlung beim Laden und Meldungen überarbeiten
Reklamationen der Fahrer: Meldungen verdeckten Buttons, und nach dem Abschluss stand „Lieferung nicht in der Tour gefunden" ohne Ausweg da. Meldungen: - Erfolgs-SnackBars entfernt, bei Erfolg bleibt der Spinner - einheitliche, schwebende Meldungen statt Stau über den Buttons - Server-Rohtexte durch verständliche Texte ersetzt (api_failure_text) Laden: - fehlt eine geöffnete Lieferung, wird die Tour einmal neu geholt; die Meldung kommt nur nach erfolgreichem Abruf ohne die Lieferung - Endlos-Spinner auf Lieferdetail, Filial-Abholung und Beladen ersetzt durch Kopfzeile, Fehlergrund und „Erneut versuchen" - Tour wird nach einem Tageswechsel nachgeladen, offene Seiten bleiben dabei unberührt - Abschluss und Zuweisung überschreiben kein zwischenzeitliches Neuladen, alte Antworten drehen einen Abschluss nicht mehr zurück - leere Server-Antworten gelten als Fehler statt als „keine Daten" Anmeldung: - Token-Erneuerung wartet höchstens 12 s, der native Aufruf läuft weiter - App-Start ohne Netz zeigt einen Hinweis mit „Erneut versuchen" - Fehlerseite der Fahrzeugauswahl bietet „Abmelden" Außerdem Podfile.lock an die Plugins angeglichen. Tests für die neuen Fehlerpfade ergänzt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:hl_lieferservice/feature/authentication/bloc/auth_bloc.dart';
|
||||
import 'package:hl_lieferservice/feature/authentication/bloc/auth_event.dart';
|
||||
import 'package:hl_lieferservice/feature/authentication/bloc/auth_state.dart';
|
||||
import 'package:hl_lieferservice/feature/car_selection/bloc/bloc.dart';
|
||||
import 'package:hl_lieferservice/feature/car_selection/bloc/events.dart';
|
||||
@ -55,7 +56,8 @@ class _CarSelectionEnforcerState extends State<CarSelectionEnforcer> {
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
const Text(
|
||||
"Fehler beim Laden der Fahrzeugauswahl.",
|
||||
"Fehler beim Laden der Fahrzeugauswahl. "
|
||||
"Bitte Verbindung prüfen.",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
@ -70,6 +72,15 @@ class _CarSelectionEnforcerState extends State<CarSelectionEnforcer> {
|
||||
},
|
||||
child: const Text("Erneut versuchen"),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// Hier gibt es kein Menü: Ohne diesen Button käme ein
|
||||
// Fahrer ohne Netz nicht mehr aus dem Konto heraus.
|
||||
TextButton(
|
||||
onPressed: () => context.read<AuthBloc>().add(
|
||||
const LogoutRequested(),
|
||||
),
|
||||
child: const Text("Abmelden"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -12,6 +12,7 @@ import 'package:hl_lieferservice/feature/cars/bloc/cars_event.dart';
|
||||
import 'package:hl_lieferservice/feature/cars/bloc/cars_state.dart';
|
||||
import 'package:hl_lieferservice/feature/cars/presentation/car_dialog.dart';
|
||||
import 'package:hl_lieferservice/domain/entity/car.dart';
|
||||
import 'package:hl_lieferservice/widget/app_message.dart';
|
||||
|
||||
class CarSelectionPage extends StatefulWidget {
|
||||
/// When set, the page is in "change" mode: the car is pre-highlighted
|
||||
@ -118,11 +119,7 @@ class _CarSelectionPageState extends State<CarSelectionPage> {
|
||||
return BlocListener<CarSelectBloc, CarSelectState>(
|
||||
listener: (context, state) {
|
||||
if (state is CarSelectFailed) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text("Fehler beim Speichern der Fahrzeugauswahl."),
|
||||
),
|
||||
);
|
||||
context.showAppMessage("Fehler beim Speichern der Fahrzeugauswahl.");
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
@ -216,19 +213,22 @@ class _CarSelectionPageState extends State<CarSelectionPage> {
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: FilledButton(
|
||||
onPressed: _selectedCar != null ? _onConfirm : null,
|
||||
child: const Text("Auswählen"),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: SafeArea(
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: FilledButton(
|
||||
onPressed: _selectedCar != null ? _onConfirm : null,
|
||||
child: const Text("Auswählen"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user