Fix typos related to Navigator (#147221)

This PR fixes some typos and improves readability in the documentation for the Navigator and NavigatorObserver classes.

</br>
This commit is contained in:
ChoiYS
2024-04-24 04:13:12 +09:00
committed by GitHub
parent b0198426b5
commit 47ce800c14

View File

@@ -703,7 +703,7 @@ class NavigatorObserver {
/// The [Navigator]'s routes are being moved by a user gesture.
///
/// For example, this is called when an iOS back gesture starts, and is used
/// to disabled hero animations during such interactions.
/// to disable hero animations during such interactions.
void didStartUserGesture(Route<dynamic> route, Route<dynamic>? previousRoute) { }
/// User gesture is no longer controlling the [Navigator].
@@ -1573,7 +1573,7 @@ class Navigator extends StatefulWidget {
/// * [Navigator], which explains under the heading "state restoration"
/// how and under what conditions the navigator restores its state.
/// * [Navigator.restorablePush], which includes an example showcasing how
/// to push a restorable route unto the navigator.
/// to push a restorable route onto the navigator.
/// {@endtemplate}
final String? restorationScopeId;
@@ -1609,7 +1609,7 @@ class Navigator extends StatefulWidget {
/// The callback must return a list of [Route] objects with which the history
/// will be primed.
///
/// When parsing the initialRoute, if there's any chance that the it may
/// When parsing the initialRoute, if there's any chance that it may
/// contain complex characters, it's best to use the
/// [characters](https://pub.dev/packages/characters) API. This will ensure
/// that extended grapheme clusters and surrogate pairs are treated as single
@@ -1837,7 +1837,7 @@ class Navigator extends StatefulWidget {
/// [NavigatorObserver.didReplace]). The removed route is notified once the
/// new route has finished animating (see [Route.didComplete]). The removed
/// route's exit animation is not run (see [popAndPushNamed] for a variant
/// that does animated the removed route).
/// that animates the removed route).
///
/// Ongoing gestures within the current route are canceled when a new route is
/// pushed.
@@ -2667,7 +2667,7 @@ class Navigator extends StatefulWidget {
/// this class is given instead. Useful for pushing contents above all
/// subsequent instances of [Navigator].
///
/// If there is no [Navigator] in the give `context`, this function will throw
/// If there is no [Navigator] in the given `context`, this function will throw
/// a [FlutterError] in debug mode, and an exception in release mode.
///
/// This method can be expensive (it walks the element tree).
@@ -2801,7 +2801,7 @@ class Navigator extends StatefulWidget {
// Null route might be a result of gap in initialRouteName
//
// For example, routes = ['A', 'A/B/C'], and initialRouteName = 'A/B/C'
// This should result in result = ['A', null,'A/B/C'] where 'A/B' produces
// This should result in result = ['A', null, 'A/B/C'] where 'A/B' produces
// the null. In this case, we want to filter out the null and return
// result = ['A', 'A/B/C'].
result.removeWhere((Route<dynamic>? route) => route == null);