chore: Follow up bootstrap buttons

This commit is contained in:
krille-chan 2023-08-13 13:17:53 +02:00
parent fb384462e0
commit 0c69ce0552
No known key found for this signature in database

View file

@ -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<BootstrapDialog> {
@override
Widget build(BuildContext context) {
_wipe ??= widget.wipe;
final buttons = <AdaptiveFlatButton>[];
final buttons = <Widget>[];
Widget body = const CircularProgressIndicator.adaptive();
titleText = L10n.of(context)!.loadingPleaseWait;
@ -411,12 +410,12 @@ class BootstrapDialogState extends State<BootstrapDialog> {
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<bool>(false),
child: Text(L10n.of(context)!.close),
),
);
break;
@ -430,10 +429,10 @@ class BootstrapDialogState extends State<BootstrapDialog> {
],
);
buttons.add(
AdaptiveFlatButton(
label: L10n.of(context)!.close,
OutlinedButton(
onPressed: () =>
Navigator.of(context, rootNavigator: false).pop<bool>(false),
child: Text(L10n.of(context)!.close),
),
);
break;
@ -442,10 +441,24 @@ class BootstrapDialogState extends State<BootstrapDialog> {
return Scaffold(
appBar: AppBar(
leading: Center(
child: CloseButton(
onPressed: () =>
Navigator.of(context, rootNavigator: false).pop<bool>(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,
],
),
),
);
}
}