ToPathCallback typedef
A callback function to convert an index and a base path into a full
route path string, considering a list of available routes.
This is typically used in indexed navigation scenarios (e.g., tabs, bottom navigation bars) to determine the URL path corresponding to a selected index.
index: The numerical index of the desired route.base: The base path for the indexed routes (e.g.,/settings).path: The specific path segment for the givenindexfrom therouteslist.routes: A list of path segments corresponding to each index.
Returns the fully resolved path string (e.g., /settings/profile if base is
/settings and the route for the index is profile), or null if
a path cannot be determined.
Implementation
typedef ToPathCallback = String? Function(
int index,
String base,
String path,
List<String> routes,
);