setModel method

  1. @override
Future<void> setModel(
  1. int viewId,
  2. String modelPath,
  3. String task
)
override

Sets the model for an existing YOLO view.

This method allows switching the model on an existing YOLO view instance without recreating the entire view.

Parameters:

  • viewId: The unique identifier of the YOLO view
  • modelPath: The path to the new model file
  • task: The YOLO task type for the new model

Throws:

  • UnimplementedError if not implemented by the platform
  • Platform-specific exceptions if the model switch fails

Implementation

@override
Future<void> setModel(int viewId, String modelPath, String task) async {
  await methodChannel.invokeMethod<void>('setModel', {
    'viewId': viewId,
    'modelPath': modelPath,
    'task': task,
  });
}