detect method

  1. @override
Future<List<DetectionResult>> detect({
  1. required String imagePath,
})
override

Run detection on an image file.

Implementation

@override
Future<List<DetectionResult>> detect({required String imagePath}) async {
  final result = await methodChannel.invokeMethod<List<dynamic>>('detect', {'imagePath': imagePath});
  if (result == null) return [];
  return result.map((e) => DetectionResult.fromMap(e as Map<dynamic, dynamic>)).toList();
}