mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 09:35:12 +00:00
chore: Follow up bootstrap buttons
This commit is contained in:
parent
fb384462e0
commit
0c69ce0552
1 changed files with 22 additions and 9 deletions
|
@ -11,7 +11,6 @@ import 'package:matrix/matrix.dart';
|
||||||
import 'package:fluffychat/config/themes.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/utils/fluffy_share.dart';
|
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
import 'package:fluffychat/widgets/adaptive_flat_button.dart';
|
|
||||||
import '../../utils/adaptive_bottom_sheet.dart';
|
import '../../utils/adaptive_bottom_sheet.dart';
|
||||||
import '../key_verification/key_verification_dialog.dart';
|
import '../key_verification/key_verification_dialog.dart';
|
||||||
|
|
||||||
|
@ -89,7 +88,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
_wipe ??= widget.wipe;
|
_wipe ??= widget.wipe;
|
||||||
final buttons = <AdaptiveFlatButton>[];
|
final buttons = <Widget>[];
|
||||||
Widget body = const CircularProgressIndicator.adaptive();
|
Widget body = const CircularProgressIndicator.adaptive();
|
||||||
titleText = L10n.of(context)!.loadingPleaseWait;
|
titleText = L10n.of(context)!.loadingPleaseWait;
|
||||||
|
|
||||||
|
@ -411,12 +410,12 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
break;
|
break;
|
||||||
case BootstrapState.error:
|
case BootstrapState.error:
|
||||||
titleText = L10n.of(context)!.oopsSomethingWentWrong;
|
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(
|
buttons.add(
|
||||||
AdaptiveFlatButton(
|
OutlinedButton(
|
||||||
label: L10n.of(context)!.close,
|
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
||||||
|
child: Text(L10n.of(context)!.close),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
@ -430,10 +429,10 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
buttons.add(
|
buttons.add(
|
||||||
AdaptiveFlatButton(
|
OutlinedButton(
|
||||||
label: L10n.of(context)!.close,
|
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
||||||
|
child: Text(L10n.of(context)!.close),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
@ -442,10 +441,24 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
leading: Center(
|
||||||
|
child: CloseButton(
|
||||||
|
onPressed: () =>
|
||||||
|
Navigator.of(context, rootNavigator: false).pop<bool>(true),
|
||||||
|
),
|
||||||
|
),
|
||||||
title: Text(titleText ?? L10n.of(context)!.loadingPleaseWait),
|
title: Text(titleText ?? L10n.of(context)!.loadingPleaseWait),
|
||||||
),
|
),
|
||||||
body: Center(child: body),
|
body: Center(
|
||||||
bottomNavigationBar: Row(children: buttons),
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
body,
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
...buttons,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue