PlatformSetupReport class

Snapshot of host-app platform setup. Returned by NsfwDetector.instance.checkPlatformSetup() so apps can verify their Info.plist (iOS) / AndroidManifest.xml declarations are in place before invoking any media API — the alternative on iOS is SIGABRT the first time the OS sees a missing NSPhotoLibraryUsageDescription.

Each field is true when the corresponding usage description / manifest permission is declared by the host app, false when it is missing.

Constructors

PlatformSetupReport({required bool photoLibraryUsageDescription, required bool cameraUsageDescription})
const
PlatformSetupReport.allOk()
All-ok constant. Used as the default-implementation return value so platforms / test mocks that don't override checkPlatformSetup don't surface false negatives.
const
PlatformSetupReport.fromMap(Map map)
factory

Properties

cameraUsageDescription bool
iOS: NSCameraUsageDescription present in Info.plist. Android: CAMERA declared in the manifest.
final
hashCode int
The hash code for this object.
no setterinherited
isComplete bool
true when every checked key is present. Apps can short-circuit on this in production and only inspect individual fields when surfacing a setup-guide UI in development builds.
no setter
missingKeys List<String>
The keys whose declarations are missing on the host app. Empty when isComplete is true. Useful for building "add these to Info.plist" hint UIs.
no setter
photoLibraryUsageDescription bool
iOS: NSPhotoLibraryUsageDescription present in Info.plist. Android: READ_MEDIA_IMAGES/READ_MEDIA_VIDEO (API 33+) or READ_EXTERNAL_STORAGE (API ≤ 32) declared in the manifest.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited