Show read button if loading fails.

This commit is contained in:
2025-09-14 17:05:45 +08:00
parent 3a9d634edf
commit 4c257d7178
3 changed files with 136 additions and 99 deletions

View File

@@ -7,6 +7,7 @@ class NetworkError extends StatelessWidget {
this.retry,
this.withAppbar = true,
this.buttonText,
this.action,
});
final String message;
@@ -17,6 +18,8 @@ class NetworkError extends StatelessWidget {
final String? buttonText;
final Widget? action;
@override
Widget build(BuildContext context) {
var cfe = CloudflareException.fromString(message);
@@ -67,9 +70,16 @@ class NetworkError extends StatelessWidget {
child: Text('Verify'.tl),
)
else
FilledButton(
onPressed: retry,
child: Text(buttonText ?? 'Retry'.tl),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (action != null)
action!.paddingRight(8),
FilledButton(
onPressed: retry,
child: Text(buttonText ?? 'Retry'.tl),
),
],
),
],
),