showErrorWidget function
Implementation
Widget showErrorWidget({required String errorMessage}) {
return Center(
child: Container(
margin: const EdgeInsets.all(20),
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: Colors.red.shade50,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: Colors.red.shade200),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.error_outline,
color: Colors.red.shade400,
size: 48,
),
const SizedBox(height: 16),
Text(
errorMessage,
style: TextStyle(
color: Colors.red.shade700,
fontSize: 15,
fontWeight: FontWeight.w500,
fontFamily: primaryFontFamily,
),
textAlign: TextAlign.center,
maxLines: 5,
),
],
),
),
);
}