import 'package:flutter/material.dart'; import '../button/button.dart'; class ErrorCard extends StatelessWidget { final String title; final String message; final Function() onTap; const ErrorCard({ super.key, required this.title, required this.message, required this.onTap, }); @override Widget build(BuildContext context) { return Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(Icons.error_outline, size: 48, color: Colors.red.shade400), SizedBox(height: 16), Text( title, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), SizedBox(height: 8), Padding( padding: EdgeInsets.symmetric(horizontal: 32), child: Text( message, textAlign: TextAlign.center, style: TextStyle(color: Colors.grey.shade600), ), ), SizedBox(height: 16), AppElevatedButton.filled( width: 120, onPressed: onTap, label: 'Coba Lagi', ), ], ), ); } }