isSupported property

bool get isSupported

Whether a native handler ships on this platform. Web-safe (uses defaultTargetPlatform, never dart:io) and cheap — it does not touch the channel. Note this returns true under flutter test on a macOS/iOS host even though no plugin is registered there, so a call throws MissingPluginException — callers must treat that as a fallback signal, the same as any native error.

Implementation

static bool get isSupported {
  if (kIsWeb) return false;
  switch (defaultTargetPlatform) {
    case TargetPlatform.android:
    case TargetPlatform.iOS:
    case TargetPlatform.macOS:
    case TargetPlatform.windows:
      return true;
    default:
      return false;
  }
}