Jaime Blasco
Committed by GitHub

Merge pull request #207 from v7lin/master

fix: android edge to edge & clean: dart analysis
... ... @@ -7,15 +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,
... ... @@ -89,6 +89,7 @@ Future<T?> showAvatarModalBottomSheet<T>({
bool isDismissible = true,
bool enableDrag = true,
Duration? duration,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
... ... @@ -98,6 +99,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,
... ... @@ -89,6 +91,7 @@ Future<T?> showBarModalBottomSheet<T>({
Widget? topControl,
Duration? duration,
RouteSettings? settings,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
... ... @@ -103,6 +106,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;
}
... ... @@ -141,6 +143,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,
... ... @@ -164,6 +167,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
this.transitionBackgroundColor,
this.topRadius = _kDefaultTopRadius,
this.previousRouteAnimationCurve,
this.overlayStyle,
}) : super(
closeProgressThreshold: closeProgressThreshold,
scrollController: scrollController,
... ... @@ -215,6 +219,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
animationCurve: previousRouteAnimationCurve,
topRadius: topRadius,
backgroundColor: transitionBackgroundColor ?? Colors.black,
overlayStyle: overlayStyle,
);
}
}
... ... @@ -224,6 +229,7 @@ class _CupertinoModalTransition extends StatelessWidget {
final Radius topRadius;
final Curve? animationCurve;
final Color backgroundColor;
final SystemUiOverlayStyle? overlayStyle;
final Widget body;
... ... @@ -234,6 +240,7 @@ class _CupertinoModalTransition extends StatelessWidget {
required this.topRadius,
this.backgroundColor = Colors.black,
this.animationCurve,
this.overlayStyle,
}) : super(key: key);
@override
... ... @@ -251,7 +258,7 @@ class _CupertinoModalTransition extends StatelessWidget {
);
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
value: overlayStyle ?? SystemUiOverlayStyle.light,
child: AnimatedBuilder(
animation: curvedAnimation,
child: body,
... ... @@ -312,12 +319,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
... ... @@ -339,6 +348,7 @@ class CupertinoScaffold extends StatefulWidget {
Duration? duration,
RouteSettings? settings,
BoxShadow? shadow,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(debugCheckHasMediaQuery(context));
final isCupertinoApp =
... ... @@ -371,6 +381,7 @@ class CupertinoScaffold extends StatefulWidget {
previousRouteAnimationCurve: previousRouteAnimationCurve,
duration: duration,
settings: settings,
overlayStyle: overlayStyle,
));
return result;
}
... ... @@ -380,8 +391,6 @@ class _CupertinoScaffoldState extends State<CupertinoScaffold>
with TickerProviderStateMixin {
late AnimationController animationController;
SystemUiOverlayStyle? lastStyle;
@override
void initState() {
animationController =
... ... @@ -404,6 +413,7 @@ class _CupertinoScaffoldState extends State<CupertinoScaffold>
body: widget.body,
topRadius: widget.topRadius,
backgroundColor: widget.transitionBackgroundColor,
overlayStyle: widget.overlayStyle,
),
);
}
... ...