fzyzcjy 431dfc8326
Tiny cleanup for Navigator code (without introducing dependency) (#125628)
Close https://github.com/flutter/flutter/issues/125724

> The `navigator.dart` has ~10 repeats of things like:
> 
> ```dart
>     final _RouteEntry? currentRouteEntry = _navigator!._history.cast<_RouteEntry?>().lastWhere(
>       (_RouteEntry? e) => e != null && _RouteEntry.isPresentPredicate(e),
>       orElse: () => null,
>     );
> ```
> 
> while it can be greatly simplified as:
> 
> ```dart
>     final _RouteEntry? currentRouteEntry = _navigator!._history.lastWhereOrNull(_RouteEntry.isPresentPredicate);
> ```
> 
> Thus, it seems that we can beautify the code a little bit.

Same as https://github.com/flutter/flutter/pull/125099, but without external dependency

For more detailed explanation why it does not introduce external dependency: https://github.com/flutter/flutter/pull/125099#discussion_r1174230502
2023-05-08 19:03:06 +00:00
..
2023-05-08 09:51:28 +02:00
2023-05-08 09:51:28 +02:00
2023-05-08 09:11:23 +00:00