import 'package:flutter/material.dart'; class ErrorView extends StatelessWidget { final String message; final VoidCallback? onRetry; const ErrorView({super.key, required this.message, this.onRetry}); @override Widget build(BuildContext context) { final cs = Theme.of(context).colorScheme; return Center( child: Padding( padding: const EdgeInsets.all(24), child: Column( mainAxisSize: MainAxisSize.min, children: [ const Icon(Icons.error_outline, size: 48, color: Color(0xFFE02424)), const SizedBox(height: 16), Text( message, textAlign: TextAlign.center, style: TextStyle(color: cs.onSurfaceVariant), ), if (onRetry != null) ...[ const SizedBox(height: 16), ElevatedButton(onPressed: onRetry, child: const Text('Retry')), ], ], ), ), ); } }