error wenn no econtrol API

This commit is contained in:
2026-09-26 23:26:58 +02:00
parent d6bdc01281
commit 141999d61c
5 changed files with 132 additions and 41 deletions
+61 -1
View File
@@ -62,7 +62,67 @@ class GasstationsPage extends GetView<GasstationsController> {
],
),
);
} else if (staCtrl.eControlData.isEmpty) {
}
// Anzeige bei Fehler/Unerreichbarkeit des E-Control Services
else if (staCtrl.errorMessage.isNotEmpty) {
return Center(
child: Container(
margin: const EdgeInsets.all(24),
padding: const EdgeInsets.all(32),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
blurRadius: 10,
offset: const Offset(0, 5),
),
],
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.cloud_off,
size: 64,
color: Colors.red[400],
),
const SizedBox(height: 16),
Text(
'Service nicht erreichbar',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.blueGrey[800],
),
),
const SizedBox(height: 8),
Text(
staCtrl.errorMessage.value,
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
ElevatedButton.icon(
onPressed: () => staCtrl.retry(),
icon: const Icon(Icons.refresh),
label: const Text('Erneut versuchen'),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blueGrey[800],
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
],
),
),
);
}
// Anzeige, wenn keine Tankstellen gefunden wurden
else if (staCtrl.eControlData.isEmpty) {
return Center(
child: Container(
margin: const EdgeInsets.all(24),