init static method
Registers the navigator key or context used by shared widgets.
Implementation
static void init({
GlobalKey<NavigatorState>? navigatorKey,
BuildContext? context,
}) {
if (navigatorKey == null && context == null) {
throw ArgumentError('Provide a navigatorKey or BuildContext.');
}
instance
.._navigatorKey = navigatorKey
.._context = context;
}