redactFile method

  1. @override
Future<String> redactFile({
  1. required String inputPath,
  2. required List<Map<String, Object?>> detections,
  3. required String mode,
  4. required double intensity,
  5. String? outputPath,
})
override

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.

Implementation

@override
Future<String> redactFile({
  required String inputPath,
  required List<Map<String, Object?>> detections,
  required String mode,
  required double intensity,
  String? outputPath,
}) async {
  final result = await _methodChannel.invokeMethod<String>(
    'redactFile',
    {
      'inputPath': inputPath,
      'detections': detections,
      'mode': mode,
      'intensity': intensity,
      if (outputPath != null) 'outputPath': outputPath,
    },
  );
  if (result == null || result.isEmpty) {
    throw StateError('redactFile returned no output path');
  }
  return result;
}