import 'package:flutter/material.dart'; class ErrorCard extends StatelessWidget { final String error; final String title; final bool hideIcon; const ErrorCard({ super.key, required this.error, this.title = "Error Loading Content", this.hideIcon = false, }); @override Widget build(BuildContext context) { return Card( margin: const EdgeInsets.all(16), child: Center( child: Padding( padding: const EdgeInsets.all(16), child: Column( mainAxisSize: MainAxisSize.min, children: [ if (hideIcon == false) Icon( Icons.error_outline, size: 48, color: Theme.of(context).colorScheme.error, ), const SizedBox(height: 16), Text( title, style: Theme.of(context).textTheme.titleLarge, ), const SizedBox(height: 8), Text( error, textAlign: TextAlign.center, style: Theme.of(context).textTheme.bodyMedium, ), ], ), ), ), ); } }