instance static method

Future<MenuContext> instance()

Implementation

static Future<MenuContext> instance() {
  return _mutex.protect(() async {
    if (_instance == null) {
      if (!kIsWeb &&
          (defaultTargetPlatform == TargetPlatform.android ||
              defaultTargetPlatform == TargetPlatform.windows)) {
        _instance = FlutterMenuContext();
      } else {
        _instance = MenuContextImpl();
      }
      await _instance!.initialize();
    }
    return _instance!;
  });
}