2026-03-19 00:51:56 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
2026-03-27 14:05:03 +08:00
|
|
|
import '../../core/l10n/l10n.dart';
|
2026-03-19 00:51:56 +08:00
|
|
|
import '../../core/theme/design_tokens.dart';
|
|
|
|
|
import 'app_button.dart';
|
|
|
|
|
|
|
|
|
|
class ErrorRetrySurface extends StatelessWidget {
|
|
|
|
|
const ErrorRetrySurface({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.message,
|
|
|
|
|
required this.onRetry,
|
|
|
|
|
this.horizontalPadding = AppSpacing.xl,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
final String message;
|
|
|
|
|
final VoidCallback onRetry;
|
|
|
|
|
final double horizontalPadding;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: horizontalPadding),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
message,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: const TextStyle(color: AppColors.red500),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: AppSpacing.md),
|
2026-03-27 14:05:03 +08:00
|
|
|
AppButton(text: context.l10n.commonRetry, onPressed: onRetry),
|
2026-03-19 00:51:56 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|