v7lin

fix: android edge to edge

... ... @@ -7,14 +7,15 @@ import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class AvatarBottomSheet extends StatelessWidget {
final Widget child;
final Animation<double> animation;
final SystemUiOverlayStyle? overlayStyle;
const AvatarBottomSheet({Key? key, required this.child, required this.animation})
const AvatarBottomSheet({Key? key, required this.child, required this.animation, this.overlayStyle})
: super(key: key);
@override
Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
value: overlayStyle ?? SystemUiOverlayStyle.light,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
... ... @@ -81,6 +82,7 @@ Future<T?> showAvatarModalBottomSheet<T>({
bool isDismissible = true,
bool enableDrag = true,
Duration? duration,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
... ... @@ -90,6 +92,7 @@ Future<T?> showAvatarModalBottomSheet<T>({
containerBuilder: (_, animation, child) => AvatarBottomSheet(
child: child,
animation: animation,
overlayStyle: overlayStyle,
),
bounce: bounce,
secondAnimationController: secondAnimation,
... ...
... ... @@ -14,6 +14,7 @@ class BarBottomSheet extends StatelessWidget {
final Clip? clipBehavior;
final double? elevation;
final ShapeBorder? shape;
final SystemUiOverlayStyle? overlayStyle;
const BarBottomSheet({
Key? key,
... ... @@ -22,12 +23,13 @@ class BarBottomSheet extends StatelessWidget {
this.clipBehavior,
this.shape,
this.elevation,
this.overlayStyle,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
value: overlayStyle ?? SystemUiOverlayStyle.light,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
... ... @@ -88,6 +90,7 @@ Future<T?> showBarModalBottomSheet<T>({
bool enableDrag = true,
Widget? topControl,
Duration? duration,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
... ... @@ -102,6 +105,7 @@ Future<T?> showBarModalBottomSheet<T>({
clipBehavior: clipBehavior,
shape: shape,
elevation: elevation,
overlayStyle: overlayStyle,
),
secondAnimationController: secondAnimation,
expanded: expand,
... ...
... ... @@ -91,6 +91,7 @@ Future<T?> showCupertinoModalBottomSheet<T>({
RouteSettings? settings,
Color? transitionBackgroundColor,
BoxShadow? shadow,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(debugCheckHasMediaQuery(context));
final hasMaterialLocalizations =
... ... @@ -126,7 +127,8 @@ Future<T?> showCupertinoModalBottomSheet<T>({
previousRouteAnimationCurve: previousRouteAnimationCurve,
duration: duration,
settings: settings,
transitionBackgroundColor: transitionBackgroundColor ?? Colors.black),
transitionBackgroundColor: transitionBackgroundColor ?? Colors.black,
overlayStyle: overlayStyle),
);
return result;
}
... ... @@ -142,6 +144,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
// Background color behind all routes
// Black by default
final Color? transitionBackgroundColor;
final SystemUiOverlayStyle? overlayStyle;
CupertinoModalBottomSheetRoute({
required WidgetBuilder builder,
... ... @@ -165,6 +168,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
this.transitionBackgroundColor,
this.topRadius = _kDefaultTopRadius,
this.previousRouteAnimationCurve,
this.overlayStyle,
}) : super(
closeProgressThreshold: closeProgressThreshold,
scrollController: scrollController,
... ... @@ -217,6 +221,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
animationCurve: previousRouteAnimationCurve,
topRadius: topRadius,
backgroundColor: transitionBackgroundColor ?? Colors.black,
overlayStyle: overlayStyle,
);
}
}
... ... @@ -227,6 +232,7 @@ class _CupertinoModalTransition extends StatelessWidget {
final Curve? animationCurve;
final Color backgroundColor;
final BoxShadow? boxShadow;
final SystemUiOverlayStyle? overlayStyle;
final Widget body;
... ... @@ -238,6 +244,7 @@ class _CupertinoModalTransition extends StatelessWidget {
this.backgroundColor = Colors.black,
this.animationCurve,
this.boxShadow,
this.overlayStyle,
}) : super(key: key);
@override
... ... @@ -255,10 +262,7 @@ class _CupertinoModalTransition extends StatelessWidget {
);
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.dark,
),
value: overlayStyle ?? SystemUiOverlayStyle.light,
child: AnimatedBuilder(
animation: curvedAnimation,
child: body,
... ... @@ -319,12 +323,14 @@ class CupertinoScaffold extends StatefulWidget {
final Widget body;
final Radius topRadius;
final Color transitionBackgroundColor;
final SystemUiOverlayStyle? overlayStyle;
const CupertinoScaffold({
Key? key,
required this.body,
this.topRadius = _kDefaultTopRadius,
this.transitionBackgroundColor = Colors.black,
this.overlayStyle,
}) : super(key: key);
@override
... ... @@ -346,6 +352,7 @@ class CupertinoScaffold extends StatefulWidget {
Duration? duration,
RouteSettings? settings,
BoxShadow? shadow,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(debugCheckHasMediaQuery(context));
final isCupertinoApp =
... ... @@ -378,6 +385,7 @@ class CupertinoScaffold extends StatefulWidget {
previousRouteAnimationCurve: previousRouteAnimationCurve,
duration: duration,
settings: settings,
overlayStyle: overlayStyle,
));
return result;
}
... ... @@ -409,6 +417,7 @@ class _CupertinoScaffoldState extends State<CupertinoScaffold>
body: widget.body,
topRadius: widget.topRadius,
backgroundColor: widget.transitionBackgroundColor,
overlayStyle: widget.overlayStyle,
),
);
}
... ...