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[600], ), ), 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, ), ), ), ], ), ), ), ); } }