better error message
This commit is contained in:
38
flutter/lib/components/error_display/error_display.dart
Normal file
38
flutter/lib/components/error_display/error_display.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user