isFeatureSupported static method

bool isFeatureSupported(
  1. String feature
)

Check if a feature is supported on current platform

Implementation

static bool isFeatureSupported(String feature) {
  switch (feature) {
    case 'camera':
      if (PlatformUtils.isWeb) return true;
      if (PlatformUtils.isIOS) {
        return IOSConfig.capabilities['camera'] ?? false;
      }
      if (PlatformUtils.isAndroid) {
        return AndroidConfig.permissions['camera'] ?? false;
      }
      return false;

    case 'notifications':
      if (PlatformUtils.isWeb) return WebConfig.enableWebNotifications;
      if (PlatformUtils.isIOS) return IOSConfig.enablePushNotifications;
      if (PlatformUtils.isAndroid) {
        return AndroidConfig.enableNotificationChannels;
      }
      return false;

    case 'storage':
      if (PlatformUtils.isWeb) return WebConfig.enableLocalStorageFallback;
      if (PlatformUtils.isMobile) return true;
      return false;

    case 'biometrics':
      if (PlatformUtils.isIOS) return IOSConfig.enableBiometrics;
      if (PlatformUtils.isAndroid) {
        return true; // Most Android devices support fingerprint
      }
      return false;

    default:
      return false;
  }
}