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> { ...@@ -1010,14 +1010,12 @@ class CupertinoModalPopupRoute<T> extends PopupRoute<T> {
this.barrierLabel = 'Dismiss', this.barrierLabel = 'Dismiss',
this.barrierColor = kCupertinoModalBarrierColor, this.barrierColor = kCupertinoModalBarrierColor,
bool barrierDismissible = true, bool barrierDismissible = true,
bool? semanticsDismissible, bool semanticsDismissible = false,
super.filter, super.filter,
super.settings, super.settings,
this.anchorPoint, this.anchorPoint,
}) { }) : _barrierDismissible = barrierDismissible,
_barrierDismissible = barrierDismissible;
_semanticsDismissible = semanticsDismissible; _semanticsDismissible = semanticsDismissible;
}
/// A builder that builds the widget tree for the [CupertinoModalPopupRoute]. /// A builder that builds the widget tree for the [CupertinoModalPopupRoute].
/// ///
...@@ -1029,9 +1027,9 @@ class CupertinoModalPopupRoute<T> extends PopupRoute<T> { ...@@ -1029,9 +1027,9 @@ class CupertinoModalPopupRoute<T> extends PopupRoute<T> {
/// widget needs to update dynamically. /// widget needs to update dynamically.
final WidgetBuilder builder; final WidgetBuilder builder;
bool? _barrierDismissible; final bool _barrierDismissible;
bool? _semanticsDismissible; final bool _semanticsDismissible;
@override @override
final String barrierLabel; final String barrierLabel;
...@@ -1040,10 +1038,10 @@ class CupertinoModalPopupRoute<T> extends PopupRoute<T> { ...@@ -1040,10 +1038,10 @@ class CupertinoModalPopupRoute<T> extends PopupRoute<T> {
final Color? barrierColor; final Color? barrierColor;
@override @override
bool get barrierDismissible => _barrierDismissible ?? true; bool get barrierDismissible => _barrierDismissible;
@override @override
bool get semanticsDismissible => _semanticsDismissible ?? false; bool get semanticsDismissible => _semanticsDismissible;
@override @override
Duration get transitionDuration => _kModalPopupTransitionDuration; Duration get transitionDuration => _kModalPopupTransitionDuration;
...@@ -1167,7 +1165,7 @@ Future<T?> showCupertinoModalPopup<T>({ ...@@ -1167,7 +1165,7 @@ Future<T?> showCupertinoModalPopup<T>({
Color barrierColor = kCupertinoModalBarrierColor, Color barrierColor = kCupertinoModalBarrierColor,
bool barrierDismissible = true, bool barrierDismissible = true,
bool useRootNavigator = true, bool useRootNavigator = true,
bool? semanticsDismissible, bool semanticsDismissible = false,
RouteSettings? routeSettings, RouteSettings? routeSettings,
Offset? anchorPoint, Offset? anchorPoint,
}) { }) {
......
...@@ -175,13 +175,13 @@ class _CupertinoTabViewState extends State<CupertinoTabView> { ...@@ -175,13 +175,13 @@ class _CupertinoTabViewState extends State<CupertinoTabView> {
Route<dynamic>? _onGenerateRoute(RouteSettings settings) { Route<dynamic>? _onGenerateRoute(RouteSettings settings) {
final String? name = settings.name; final String? name = settings.name;
WidgetBuilder? routeBuilder; final WidgetBuilder? routeBuilder;
String? title; String? title;
if (name == Navigator.defaultRouteName && widget.builder != null) { if (name == Navigator.defaultRouteName && widget.builder != null) {
routeBuilder = widget.builder; routeBuilder = widget.builder;
title = widget.defaultTitle; title = widget.defaultTitle;
} else if (widget.routes != null) { } else {
routeBuilder = widget.routes![name]; routeBuilder = widget.routes?[name];
} }
if (routeBuilder != null) { if (routeBuilder != null) {
return CupertinoPageRoute<dynamic>( return CupertinoPageRoute<dynamic>(
...@@ -190,10 +190,7 @@ class _CupertinoTabViewState extends State<CupertinoTabView> { ...@@ -190,10 +190,7 @@ class _CupertinoTabViewState extends State<CupertinoTabView> {
settings: settings, settings: settings,
); );
} }
if (widget.onGenerateRoute != null) { return widget.onGenerateRoute?.call(settings);
return widget.onGenerateRoute!(settings);
}
return null;
} }
Route<dynamic>? _onUnknownRoute(RouteSettings 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