Unverified Commit d127f2c9 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Fix nullability for some routing related stuff (#67675)

parent 4042eb97
...@@ -2225,7 +2225,7 @@ class FollowerLayer extends ContainerLayer { ...@@ -2225,7 +2225,7 @@ class FollowerLayer extends ContainerLayer {
Matrix4? _invertedTransform; Matrix4? _invertedTransform;
bool _inverseDirty = true; bool _inverseDirty = true;
Offset? _transformOffset<S extends Object>(Offset localPosition) { Offset? _transformOffset(Offset localPosition) {
if (_inverseDirty) { if (_inverseDirty) {
_invertedTransform = Matrix4.tryInvert(getLastTransform()!); _invertedTransform = Matrix4.tryInvert(getLastTransform()!);
_inverseDirty = false; _inverseDirty = false;
...@@ -2245,7 +2245,7 @@ class FollowerLayer extends ContainerLayer { ...@@ -2245,7 +2245,7 @@ class FollowerLayer extends ContainerLayer {
} }
return false; return false;
} }
final Offset? transformedOffset = _transformOffset<S>(localPosition); final Offset? transformedOffset = _transformOffset(localPosition);
if (transformedOffset == null) { if (transformedOffset == null) {
return false; return false;
} }
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:io'; import 'dart:io';
import 'dart:ui'; import 'dart:ui';
...@@ -737,7 +736,7 @@ class RawKeyboard { ...@@ -737,7 +736,7 @@ class RawKeyboard {
} }
@immutable @immutable
class _ModifierSidePair extends Object { class _ModifierSidePair {
const _ModifierSidePair(this.modifier, this.side); const _ModifierSidePair(this.modifier, this.side);
final ModifierKey modifier; final ModifierKey modifier;
......
...@@ -131,7 +131,6 @@ class Draggable<T extends Object> extends StatefulWidget { ...@@ -131,7 +131,6 @@ class Draggable<T extends Object> extends StatefulWidget {
assert(maxSimultaneousDrags == null || maxSimultaneousDrags >= 0), assert(maxSimultaneousDrags == null || maxSimultaneousDrags >= 0),
super(key: key); super(key: key);
/// The data that will be dropped by this draggable. /// The data that will be dropped by this draggable.
final T? data; final T? data;
......
...@@ -881,7 +881,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T ...@@ -881,7 +881,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
/// The given [BuildContext] will be rebuilt if the state of the route changes /// The given [BuildContext] will be rebuilt if the state of the route changes
/// while it is visible (specifically, if [isCurrent] or [canPop] change value). /// while it is visible (specifically, if [isCurrent] or [canPop] change value).
@optionalTypeArgs @optionalTypeArgs
static ModalRoute<T>? of<T extends Object>(BuildContext context) { static ModalRoute<T>? of<T extends Object?>(BuildContext context) {
final _ModalScopeStatus? widget = context.dependOnInheritedWidgetOfExactType<_ModalScopeStatus>(); final _ModalScopeStatus? widget = context.dependOnInheritedWidgetOfExactType<_ModalScopeStatus>();
return widget?.route as ModalRoute<T>?; return widget?.route as ModalRoute<T>?;
} }
...@@ -1818,7 +1818,7 @@ class _DialogRoute<T> extends PopupRoute<T> { ...@@ -1818,7 +1818,7 @@ class _DialogRoute<T> extends PopupRoute<T> {
/// ///
/// * [showDialog], which displays a Material-style dialog. /// * [showDialog], which displays a Material-style dialog.
/// * [showCupertinoDialog], which displays an iOS-style dialog. /// * [showCupertinoDialog], which displays an iOS-style dialog.
Future<T> showGeneralDialog<T extends Object>({ Future<T> showGeneralDialog<T extends Object?>({
required BuildContext context, required BuildContext context,
required RoutePageBuilder pageBuilder, required RoutePageBuilder pageBuilder,
bool barrierDismissible = false, bool barrierDismissible = false,
......
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