MacosAppInstallSourceInfo.fromMap constructor

MacosAppInstallSourceInfo.fromMap(
  1. Map<String, Object?> map
)

Decodes install source indicators returned by the macOS plugin.

Implementation

factory MacosAppInstallSourceInfo.fromMap(Map<String, Object?> map) =>
    MacosAppInstallSourceInfo(
      source: switch (map['source']) {
        'macAppStore' => MacosAppInstallSource.macAppStore,
        'webDownload' => MacosAppInstallSource.webDownload,
        _ => MacosAppInstallSource.unknown,
      },
      hasAppStoreReceipt: map['hasAppStoreReceipt'] == true,
      quarantineAgentName: map['quarantineAgentName'] as String?,
      quarantineAgentBundleIdentifier:
          map['quarantineAgentBundleIdentifier'] as String?,
    );