RestorableRouteBuilder<T> typedef Null safety

Route<T> RestorableRouteBuilder<T>(
  1. BuildContext context,
  2. Object? arguments
)

Creates a Route that is to be added to a Navigator.

The route can be configured with the provided arguments. The provided context is the BuildContext of the Navigator to which the route is added.

Used by the restorable methods of the Navigator that add anonymous routes (e.g. NavigatorState.restorablePush). For this use case, the RestorableRouteBuilder must be static function as the Navigator will call it again during state restoration to re-create the route.

Implementation

typedef RestorableRouteBuilder<T> = Route<T> Function(BuildContext context, Object? arguments);