mirror of
https://github.com/foss42/apidash.git
synced 2025-06-03 08:16:25 +08:00
37 lines
943 B
Dart
37 lines
943 B
Dart
import 'package:apidash/consts.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class ErrorMessage extends StatelessWidget {
|
|
const ErrorMessage({super.key, required this.message});
|
|
|
|
final String? message;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final color = Theme.of(context).colorScheme.secondary;
|
|
return Padding(
|
|
padding: kPh20v10,
|
|
child: Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(
|
|
Icons.warning_rounded,
|
|
size: 40,
|
|
color: color,
|
|
),
|
|
SelectableText(
|
|
message ?? 'And error occurred. $kRaiseIssue',
|
|
textAlign: TextAlign.center,
|
|
style: Theme.of(context)
|
|
.textTheme
|
|
.titleMedium
|
|
?.copyWith(color: color),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|