45 lines
1.1 KiB
Dart
45 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:miaoji_zhang/shared/theme/app_theme.dart';
|
|
|
|
class AsyncErrorView extends StatelessWidget {
|
|
final String message;
|
|
final Future<void> Function() onRetry;
|
|
|
|
const AsyncErrorView({
|
|
super.key,
|
|
required this.message,
|
|
required this.onRetry,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(32),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Icon(Icons.cloud_off_outlined, size: 42, color: context.jz.text3),
|
|
SizedBox(height: 14),
|
|
Text(
|
|
message,
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
color: context.jz.text2,
|
|
fontSize: 13,
|
|
height: 1.5,
|
|
),
|
|
),
|
|
SizedBox(height: 16),
|
|
FilledButton.icon(
|
|
onPressed: onRetry,
|
|
icon: Icon(Icons.refresh, size: 18),
|
|
label: Text('重试'),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|