aboutsummaryrefslogtreecommitdiffstats
path: root/lib/screens/error_screen.dart
diff options
context:
space:
mode:
Diffstat (limited to 'lib/screens/error_screen.dart')
-rw-r--r--lib/screens/error_screen.dart62
1 files changed, 62 insertions, 0 deletions
diff --git a/lib/screens/error_screen.dart b/lib/screens/error_screen.dart
new file mode 100644
index 0000000..04a5d30
--- /dev/null
+++ b/lib/screens/error_screen.dart
@@ -0,0 +1,62 @@
+import 'package:flutter/material.dart';
+
+class ErrorScreen extends StatelessWidget {
+ final VoidCallback onRetry;
+
+ ErrorScreen({required this.onRetry});
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ body: Center(
+ child: SizedBox(
+ width: MediaQuery.of(context).size.width * 0.7, // 70% of screen width
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Icon(
+ Icons.error_outline, // Use a Material Icon
+ size: 100,
+ color: Colors.red,
+ ),
+ SizedBox(height: 20), // Add some spacing
+ Text(
+ 'Oops!',
+ style: TextStyle(
+ fontSize: 24,
+ fontWeight: FontWeight.bold,
+ color: Colors.red,
+ ),
+ ),
+ SizedBox(height: 10),
+ Text(
+ 'Unable to connect to the voice assistant backend. Make sure the "agl-voiceagent-service" is up and running in server mode with correct config values.',
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 18,
+ color: Colors.grey[700],
+ ),
+ ),
+ SizedBox(height: 20),
+ ElevatedButton(
+ onPressed: () {
+ onRetry(); // Call the retry callback
+ },
+ style: ElevatedButton.styleFrom(
+ foregroundColor: Colors.white,
+ backgroundColor: Colors.blue, // Set button color
+ ),
+ child: Text(
+ 'Retry',
+ style: TextStyle(
+ fontSize: 18,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}