Files

44 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import '../core/theme/app_theme.dart';
class ErrorDisplay extends StatelessWidget {
final String message;
final VoidCallback? onRetry;
const ErrorDisplay({
super.key,
required this.message,
this.onRetry,
});
@override
Widget build(BuildContext context) {
return Center(
child: Padding(
padding: const EdgeInsets.all(32),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.error_outline,
size: 48, color: VoIdeaColors.error),
const SizedBox(height: 16),
Text(
message,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge,
),
if (onRetry != null) ...[
const SizedBox(height: 16),
ElevatedButton.icon(
onPressed: onRetry,
icon: const Icon(Icons.refresh),
label: const Text('Повторить'),
),
],
],
),
),
);
}
}