-
Notifications
You must be signed in to change notification settings - Fork 1
/
error_message.dart
37 lines (35 loc) · 1.14 KB
/
error_message.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import 'package:flutter/material.dart';
class ErrorMessage extends StatelessWidget {
final String title;
final String message;
final IconData icon;
final Color iconColor;
const ErrorMessage(this.title, this.message,
{this.icon = Icons.error, this.iconColor = Colors.red, super.key});
@override
Widget build(BuildContext context) {
return Container(
color: Colors.grey,
alignment: Alignment.center,
child: Column(children: [
const Spacer(),
Container(
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
margin: const EdgeInsets.all(20),
padding: const EdgeInsets.all(20),
child: Column(children: [
Icon(
icon,
color: iconColor,
size: 48,
),
const SizedBox(height: 10),
Text(title, style: Theme.of(context).textTheme.headlineLarge),
const SizedBox(height: 20),
Text(message)
])),
const Spacer()
]));
}
}