createRouter function
Creates a Flutter router backed by core.createRouter.
Implementation
Unrouter createRouter({
required Iterable<Inlet> routes,
Iterable<core.Guard>? guards,
String base = '/',
int maxRedirectDepth = 8,
History? history,
HistoryStrategy strategy = HistoryStrategy.browser,
}) {
return core.createRouter<Widget>(
routes: routes,
guards: guards,
base: base,
maxRedirectDepth: maxRedirectDepth,
history: history,
strategy: strategy,
errorReporter: (error, stackTrace) {
FlutterError.reportError(
FlutterErrorDetails(
exception: error,
stack: stackTrace,
context: ErrorDescription('while processing history pop event'),
),
);
},
);
}