NsfwMethodChannel class
Methods
availableModels ()
→ Future <List <ModelDescriptor > >
override
cachedResult (String localIdentifier , {String ? modelId })
→ Future <Map ? >
Look up a cached scan record for localIdentifier without triggering a
re-scan. Returns the wire-shape map (mirrors scanSingleAsset ) when a
row exists, or null on miss. Default throws.
override
cancelBackgroundSweep ()
→ Future <void >
Cancel any pending background sweep. Default no-op — safe to call
even if none was scheduled.
override
cancelScan ()
→ Future <void >
override
checkCameraPermission ()
→ Future <PermissionStatus >
override
checkPermission ()
→ Future <PhotoLibraryPermissionStatus >
override
checkPlatformSetup ()
→ Future <PlatformSetupReport >
override
clearScanCache ({String ? modelId })
→ Future <void >
Clear the persistent scan-result cache. Default no-op.
override
deleteModel (String modelId )
→ Future <void >
Delete a previously-downloaded model. Default no-op.
override
downloadModel (String modelId , {String ? url })
→ Future <bool >
Download a downloadable model. Default throws.
override
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pickMedia ({required String type , required bool multiple , int ? maxItems })
→ Future <List <Map > >
Pure media picker (no classification). Default throws.
override
prefetchAssets (List <String > localIdentifiers , {String ? modelId })
→ Future <void >
Pre-warm the native asset cache for the given local identifiers so the
next scanSingleAsset or library scan can decode them with less I/O
pressure. Default no-op — platforms without a meaningful warm-cache
implementation just return.
override
preloadModel (String modelId )
→ Future <void >
Compile / warm the model. Default no-op so test mocks don't need to stub.
override
redactBytes ({required Uint8List bytes , required List <Map <String , Object ? > > detections , required String mode , required double intensity , String ? outputFormat })
→ Future <Uint8List >
Redact the supplied image bytes against the given detection list. Mode
strings: "blur", "pixelate", "blackBox". Default throws.
override
redactFile ({required String inputPath , required List <Map <String , Object ? > > detections , required String mode , required double intensity , String ? outputPath })
→ Future <String >
Redact an image file on disk. outputPath when null writes to a sibling
temporary file. Returns the on-disk path of the redacted output. Default
throws.
override
registerModel (Map <String , Object ? > registration )
→ Future <String >
Register a custom model descriptor at runtime. Returns the resolved
asset path the native side will load from. Default throws.
override
requestCameraPermission ()
→ Future <PermissionStatus >
override
requestPermission ()
→ Future <PhotoLibraryPermissionStatus >
override
resetScan ()
→ Future <void >
Reset scan state (clears native checkpoints, etc.). Default no-op.
override
scanFilePath (String filePath , {String ? modelId , Map <String , double > ? roi })
→ Future <Map >
Scan an image file from path. Default throws. roi is a normalised
{x, y, width, height} map in [0, 1]; native implementations that
don't support cropping should ignore the key.
override
scanImageBytes (Uint8List bytes , {String ? modelId , Map <String , double > ? roi })
→ Future <Map >
Scan raw image bytes. Default throws. See scanFilePath for the
roi contract.
override
scanSingleAsset (String localIdentifier , {String ? modelId , Map <String , double > ? roi })
→ Future <Map >
override
scheduleBackgroundSweep (Map <String , Object ? > options )
→ Future <void >
Schedule a recurring background scan. Default throws — host-app
integration is required (Info.plist on iOS, WorkManager classpath
on Android — see BackgroundSweepOptions docs).
override
setLogging (bool enabled )
→ Future <void >
Toggle native logging. Default no-op.
override
setModelUrl (String modelId , String url )
→ Future <void >
Set a custom download URL for a model. Default no-op.
override
skipCurrentAsset ()
→ Future <void >
Signal the native scan loop to skip the next asset it would process.
Best-effort: one outstanding skip is consumed by the next per-asset
task that checks the flag. No effect when no scan is running.
override
startCameraScan (CameraConfiguration config )
→ Future <void >
override
startPickAndScan (ScanConfiguration config , int maxItems )
→ Future <void >
Picker scan. Default throws — enable by overriding in your native impl.
override
startScan (ScanConfiguration config )
→ Future <void >
override
stopCameraScan ()
→ Future <void >
override
toString ()
→ String
A string representation of this object.
inherited