parseRouteInformationWithDependencies method Null safety
- RouteInformation routeInformation,
- BuildContext context
Converts the given route information into parsed data to pass to a RouterDelegate.
The method should return a future which completes when the parsing is complete. The parsing may be asynchronous if, e.g., the parser needs to communicate with the OEM thread to obtain additional data about the route.
Consider using a SynchronousFuture if the result can be computed synchronously, so that the Router does not need to wait for the next microtask to pass the data to the RouterDelegate.
The input BuildContext can be used for looking up InheritedWidgets If one uses BuildContext.dependOnInheritedWidgetOfExactType, a dependency will be created. The Router will reparse the RouteInformation from its RouteInformationProvider if the dependency notifies its listeners.
One can also use BuildContext.getElementForInheritedWidgetOfExactType to look up InheritedWidgets without creating dependencies.
Implementation
Future<T> parseRouteInformationWithDependencies(RouteInformation routeInformation, BuildContext context) {
return parseRouteInformation(routeInformation);
}