dispose method

  1. @override
Future<void> dispose(
  1. int cameraId
)

Releases the resources of this camera.

Implementation

@override
Future<void> dispose(int cameraId) async {
  if (_channels.containsKey(cameraId)) {
    final MethodChannel? cameraChannel = _channels[cameraId];
    cameraChannel?.setMethodCallHandler(null);
    _channels.remove(cameraId);
  }

  await _channel.invokeMethod<void>(
    'dispose',
    <String, dynamic>{'cameraId': cameraId},
  );
}