Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix showCupertinoModalBottomSheet expanding to full screen #272

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ class _CupertinoBottomSheetContainer extends StatelessWidget {
final Color? backgroundColor;
final Radius topRadius;
final BoxShadow? shadow;
final bool? expand;

const _CupertinoBottomSheetContainer({
Key? key,
required this.child,
this.backgroundColor,
required this.topRadius,
this.shadow,
this.expand,
}) : super(key: key);

@override
Expand All @@ -59,7 +61,7 @@ class _CupertinoBottomSheetContainer extends StatelessWidget {
final backgroundColor = this.backgroundColor ??
CupertinoTheme.of(context).scaffoldBackgroundColor;
return Padding(
padding: EdgeInsets.only(top: topPadding),
padding: EdgeInsets.only(top: expand ?? false ? 0.0 : topPadding),
child: ClipRRect(
borderRadius: BorderRadius.vertical(top: topRadius),
child: Container(
Expand Down Expand Up @@ -121,6 +123,7 @@ Future<T?> showCupertinoModalBottomSheet<T>({
backgroundColor: backgroundColor,
topRadius: topRadius,
shadow: shadow,
expand: expand,
),
secondAnimationController: secondAnimation,
expanded: expand,
Expand Down Expand Up @@ -461,6 +464,7 @@ class CupertinoScaffold extends StatefulWidget {
backgroundColor: backgroundColor,
topRadius: topRadius ?? _kDefaultTopRadius,
shadow: shadow,
expand: expand,
),
expanded: expand,
barrierLabel: barrierLabel,
Expand Down