init static method

Initialize FastOverlays with a NavigatorState key

Call in the MaterialApp constructor

A GlobalKey can only be registered once. Subsequent calls will return the existing GlobalKey.

Implementation

static GlobalKey<NavigatorState> init([GlobalKey<NavigatorState>? key]) {
  return _navigatorKey ??= key ?? GlobalKey<NavigatorState>();
}