From 0c69ce0552b309a7c82625488260d62d98d17469 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 13 Aug 2023 13:17:53 +0200 Subject: [PATCH] chore: Follow up bootstrap buttons --- lib/pages/bootstrap/bootstrap_dialog.dart | 31 ++++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/pages/bootstrap/bootstrap_dialog.dart b/lib/pages/bootstrap/bootstrap_dialog.dart index c457d4c3..d99272e8 100644 --- a/lib/pages/bootstrap/bootstrap_dialog.dart +++ b/lib/pages/bootstrap/bootstrap_dialog.dart @@ -11,7 +11,6 @@ import 'package:matrix/matrix.dart'; import 'package:fluffychat/config/themes.dart'; import 'package:fluffychat/utils/fluffy_share.dart'; import 'package:fluffychat/utils/platform_infos.dart'; -import 'package:fluffychat/widgets/adaptive_flat_button.dart'; import '../../utils/adaptive_bottom_sheet.dart'; import '../key_verification/key_verification_dialog.dart'; @@ -89,7 +88,7 @@ class BootstrapDialogState extends State { @override Widget build(BuildContext context) { _wipe ??= widget.wipe; - final buttons = []; + final buttons = []; Widget body = const CircularProgressIndicator.adaptive(); titleText = L10n.of(context)!.loadingPleaseWait; @@ -411,12 +410,12 @@ class BootstrapDialogState extends State { break; case BootstrapState.error: titleText = L10n.of(context)!.oopsSomethingWentWrong; - body = const Icon(Icons.error_outline, color: Colors.red, size: 40); + body = const Icon(Icons.error_outline, color: Colors.red, size: 80); buttons.add( - AdaptiveFlatButton( - label: L10n.of(context)!.close, + OutlinedButton( onPressed: () => Navigator.of(context, rootNavigator: false).pop(false), + child: Text(L10n.of(context)!.close), ), ); break; @@ -430,10 +429,10 @@ class BootstrapDialogState extends State { ], ); buttons.add( - AdaptiveFlatButton( - label: L10n.of(context)!.close, + OutlinedButton( onPressed: () => Navigator.of(context, rootNavigator: false).pop(false), + child: Text(L10n.of(context)!.close), ), ); break; @@ -442,10 +441,24 @@ class BootstrapDialogState extends State { return Scaffold( appBar: AppBar( + leading: Center( + child: CloseButton( + onPressed: () => + Navigator.of(context, rootNavigator: false).pop(true), + ), + ), title: Text(titleText ?? L10n.of(context)!.loadingPleaseWait), ), - body: Center(child: body), - bottomNavigationBar: Row(children: buttons), + body: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + body, + const SizedBox(height: 8), + ...buttons, + ], + ), + ), ); } }