39 lines
1.2 KiB
Dart
Raw Normal View History

2025-04-18 14:07:31 +02:00
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ErrorDisplay extends StatelessWidget {
final String errorMessage;
const ErrorDisplay({Key? key, required this.errorMessage}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Container(
constraints: const BoxConstraints(maxWidth: 300),
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: Colors.red[100],
border: Border.all(color: Colors.red[300]!),
borderRadius: BorderRadius.circular(12.0),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(FontAwesomeIcons.triangleExclamation, color: Colors.red, size: 48.0),
const SizedBox(height: 16.0),
Text(
errorMessage,
textAlign: TextAlign.center,
style: TextStyle(color: Colors.red[900], fontSize: 16.0),
),
],
),
),
),
);
}
}