import 'package:flutter/material.dart'; import '../theme/app_theme.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) => Center( child: Padding( padding: const EdgeInsets.all(32), child: Column( mainAxisSize: MainAxisSize.min, children: [ const Icon(Icons.error_outline, size: 48, color: AppColors.danger), const SizedBox(height: 12), Text(message, textAlign: TextAlign.center, style: const TextStyle(color: AppColors.textSub, fontSize: 14)), if (onRetry != null) ...[ const SizedBox(height: 16), ElevatedButton.icon( onPressed: onRetry, icon: const Icon(Icons.refresh), label: const Text('Coba lagi'), ), ], ], ), ), ); }