design: Move chatbackup in adaptive bottom sheet
This commit is contained in:
parent
8826815f8e
commit
195694a252
2 changed files with 9 additions and 15 deletions
|
|
@ -13,6 +13,7 @@ import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:fluffychat/config/themes.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
import 'package:fluffychat/widgets/adaptive_flat_button.dart';
|
import 'package:fluffychat/widgets/adaptive_flat_button.dart';
|
||||||
|
import '../../utils/adaptive_bottom_sheet.dart';
|
||||||
import '../key_verification/key_verification_dialog.dart';
|
import '../key_verification/key_verification_dialog.dart';
|
||||||
|
|
||||||
class BootstrapDialog extends StatefulWidget {
|
class BootstrapDialog extends StatefulWidget {
|
||||||
|
|
@ -24,19 +25,11 @@ class BootstrapDialog extends StatefulWidget {
|
||||||
required this.client,
|
required this.client,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
Future<bool?> show(BuildContext context) => PlatformInfos.isCupertinoStyle
|
Future<bool?> show(BuildContext context) => showAdaptiveBottomSheet(
|
||||||
? showCupertinoDialog(
|
context: context,
|
||||||
context: context,
|
builder: (context) => this,
|
||||||
builder: (context) => this,
|
maxHeight: 600,
|
||||||
barrierDismissible: true,
|
);
|
||||||
useRootNavigator: false,
|
|
||||||
)
|
|
||||||
: showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => this,
|
|
||||||
barrierDismissible: true,
|
|
||||||
useRootNavigator: false,
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
BootstrapDialogState createState() => BootstrapDialogState();
|
BootstrapDialogState createState() => BootstrapDialogState();
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ Future<T?> showAdaptiveBottomSheet<T>({
|
||||||
required Widget Function(BuildContext) builder,
|
required Widget Function(BuildContext) builder,
|
||||||
bool isDismissible = true,
|
bool isDismissible = true,
|
||||||
bool isScrollControlled = true,
|
bool isScrollControlled = true,
|
||||||
|
double maxHeight = 480.0,
|
||||||
}) =>
|
}) =>
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -16,8 +17,8 @@ Future<T?> showAdaptiveBottomSheet<T>({
|
||||||
useRootNavigator: !PlatformInfos.isMobile,
|
useRootNavigator: !PlatformInfos.isMobile,
|
||||||
isDismissible: isDismissible,
|
isDismissible: isDismissible,
|
||||||
isScrollControlled: isScrollControlled,
|
isScrollControlled: isScrollControlled,
|
||||||
constraints: const BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxHeight: 480,
|
maxHeight: maxHeight,
|
||||||
maxWidth: FluffyThemes.columnWidth * 1.5,
|
maxWidth: FluffyThemes.columnWidth * 1.5,
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue