diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index b70dabd679..cc34e2810b 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -1610,8 +1610,8 @@ abstract class PopupRoute extends ModalRoute { /// be given with their type arguments. Since the [Route] class and its /// subclasses have a type argument, this includes the arguments passed to this /// class. Consider using `dynamic` to specify the entire class of routes rather -/// than only specific subtypes. For example, to watch for all [PageRoute] -/// variants, the `RouteObserver>` type may be used. +/// than only specific subtypes. For example, to watch for all [ModalRoute] +/// variants, the `RouteObserver>` type may be used. /// /// {@tool snippet} /// @@ -1620,7 +1620,7 @@ abstract class PopupRoute extends ModalRoute { /// /// ```dart /// // Register the RouteObserver as a navigation observer. -/// final RouteObserver routeObserver = RouteObserver(); +/// final RouteObserver routeObserver = RouteObserver(); /// void main() { /// runApp(MaterialApp( /// home: Container(), @@ -1638,7 +1638,7 @@ abstract class PopupRoute extends ModalRoute { /// @override /// void didChangeDependencies() { /// super.didChangeDependencies(); -/// routeObserver.subscribe(this, ModalRoute.of(context)); +/// routeObserver.subscribe(this, ModalRoute.of(context)!); /// } /// /// @override