init static method

dynamic init()

Implementation

static init() {
  // This is to manually endorse Dart implementations until automatic
  // registration of Dart plugins is implemented. For details see
  // https://github.com/flutter/flutter/issues/52267.
  if (_manualDartRegistrationNeeded) {
    // Only do the initial registration if it hasn't already been overridden
    // with a non-default instance.
    if (!kIsWeb && SystemNetworkProxyPlatform.instance is MethodChannelSystemNetworkProxy) {
      if (Platform.isMacOS) {
        SystemNetworkProxyPlatform.instance = SystemNetworkProxyMacos();
      } else if (Platform.isLinux) {
        SystemNetworkProxyPlatform.instance = SystemNetworkProxyLinux();
      } else if (Platform.isWindows) {
        SystemNetworkProxyPlatform.instance = SystemNetworkProxyWindows();
      }
    }
    _manualDartRegistrationNeeded = false;
  }
}