Unverified Commit 329f86a9 authored by LongCatIsLooong's avatar LongCatIsLooong Committed by GitHub

Make a few values non-nullable in cupertino (#119478)

parent 18c7f8a2
......@@ -1010,14 +1010,12 @@ class CupertinoModalPopupRoute<T> extends PopupRoute<T> {
this.barrierLabel = 'Dismiss',
this.barrierColor = kCupertinoModalBarrierColor,
bool barrierDismissible = true,
bool? semanticsDismissible,
bool semanticsDismissible = false,
super.filter,
super.settings,
this.anchorPoint,
}) {
_barrierDismissible = barrierDismissible;
_semanticsDismissible = semanticsDismissible;
}
}) : _barrierDismissible = barrierDismissible,
_semanticsDismissible = semanticsDismissible;
/// A builder that builds the widget tree for the [CupertinoModalPopupRoute].
///
......@@ -1029,9 +1027,9 @@ class CupertinoModalPopupRoute<T> extends PopupRoute<T> {
/// widget needs to update dynamically.
final WidgetBuilder builder;
bool? _barrierDismissible;
final bool _barrierDismissible;
bool? _semanticsDismissible;
final bool _semanticsDismissible;
@override
final String barrierLabel;
......@@ -1040,10 +1038,10 @@ class CupertinoModalPopupRoute<T> extends PopupRoute<T> {
final Color? barrierColor;
@override
bool get barrierDismissible => _barrierDismissible ?? true;
bool get barrierDismissible => _barrierDismissible;
@override
bool get semanticsDismissible => _semanticsDismissible ?? false;
bool get semanticsDismissible => _semanticsDismissible;
@override
Duration get transitionDuration => _kModalPopupTransitionDuration;
......@@ -1167,7 +1165,7 @@ Future<T?> showCupertinoModalPopup<T>({
Color barrierColor = kCupertinoModalBarrierColor,
bool barrierDismissible = true,
bool useRootNavigator = true,
bool? semanticsDismissible,
bool semanticsDismissible = false,
RouteSettings? routeSettings,
Offset? anchorPoint,
}) {
......
......@@ -175,13 +175,13 @@ class _CupertinoTabViewState extends State<CupertinoTabView> {
Route<dynamic>? _onGenerateRoute(RouteSettings settings) {
final String? name = settings.name;
WidgetBuilder? routeBuilder;
final WidgetBuilder? routeBuilder;
String? title;
if (name == Navigator.defaultRouteName && widget.builder != null) {
routeBuilder = widget.builder;
title = widget.defaultTitle;
} else if (widget.routes != null) {
routeBuilder = widget.routes![name];
} else {
routeBuilder = widget.routes?[name];
}
if (routeBuilder != null) {
return CupertinoPageRoute<dynamic>(
......@@ -190,10 +190,7 @@ class _CupertinoTabViewState extends State<CupertinoTabView> {
settings: settings,
);
}
if (widget.onGenerateRoute != null) {
return widget.onGenerateRoute!(settings);
}
return null;
return widget.onGenerateRoute?.call(settings);
}
Route<dynamic>? _onUnknownRoute(RouteSettings settings) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment