mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-05 02:24:52 +08:00
opt video bottomsheet
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -495,8 +495,7 @@ abstract final class PageUtils {
|
||||
static Future<void>? showVideoBottomSheet(
|
||||
BuildContext context, {
|
||||
required Widget child,
|
||||
required ValueGetter<bool> isFullScreen,
|
||||
double? padding,
|
||||
ValueGetter<EdgeInsets>? padding,
|
||||
double maxWidth = 500,
|
||||
}) {
|
||||
if (!context.mounted) {
|
||||
@@ -505,28 +504,17 @@ abstract final class PageUtils {
|
||||
return Get.key.currentState!.push(
|
||||
PublishRoute(
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
if (context.isPortrait) {
|
||||
return SafeArea(
|
||||
child: FractionallySizedBox(
|
||||
heightFactor: 0.7,
|
||||
widthFactor: 1.0,
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: isFullScreen() && padding != null
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(bottom: padding),
|
||||
child: child,
|
||||
)
|
||||
: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
final isPortrait = context.isPortrait;
|
||||
return SafeArea(
|
||||
child: CustomFractionallySizedBox(
|
||||
maxWidth: maxWidth,
|
||||
widthFactor: 0.5,
|
||||
heightFactor: 1.0,
|
||||
alignment: Alignment.centerRight,
|
||||
child: child,
|
||||
widthFactor: isPortrait ? 1.0 : 0.5,
|
||||
heightFactor: isPortrait ? 0.7 : 1.0,
|
||||
alignment: isPortrait ? .bottomCenter : .centerRight,
|
||||
child: Padding(
|
||||
padding: isPortrait ? padding?.call() ?? .zero : .zero,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user