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

12345678910111213141516171819202122232425262728293031323334353637383940
  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[300]),
  20. const SizedBox(height: 16),
  21. Text(
  22. message,
  23. textAlign: TextAlign.center,
  24. style: TextStyle(fontSize: 16, color: Colors.grey[700]),
  25. ),
  26. const SizedBox(height: 16),
  27. ElevatedButton.icon(
  28. onPressed: onRetry,
  29. icon: const Icon(Icons.refresh),
  30. label: const Text('重试'),
  31. ),
  32. ],
  33. ),
  34. ),
  35. );
  36. }
  37. }