智慧水务管理系统 - 精河县供水工程综合管理平台

error_retry.dart 942B

123456789101112131415161718192021222324252627282930313233343536
  1. import 'package:flutter/material.dart';
  2. /// 错误重试组件
  3. class ErrorRetry extends StatelessWidget {
  4. final String message;
  5. final VoidCallback onRetry;
  6. const ErrorRetry({
  7. super.key,
  8. required this.message,
  9. required this.onRetry,
  10. });
  11. @override
  12. Widget build(BuildContext context) {
  13. return Center(
  14. child: Padding(
  15. padding: const EdgeInsets.all(32),
  16. child: Column(
  17. mainAxisSize: MainAxisSize.min,
  18. children: [
  19. Icon(Icons.error_outline, size: 64, color: Colors.red.shade300),
  20. const SizedBox(height: 16),
  21. Text(message, style: TextStyle(fontSize: 15, color: Colors.grey.shade700)),
  22. const SizedBox(height: 16),
  23. FilledButton.icon(
  24. onPressed: onRetry,
  25. icon: const Icon(Icons.refresh),
  26. label: const Text('重试'),
  27. ),
  28. ],
  29. ),
  30. ),
  31. );
  32. }
  33. }