destroy method

  1. @override
Future<bool?> destroy()
override

Destroy the camera instance

Implementation

@override
Future<bool?> destroy() async {
  try {
    final bool result = await methodChannel.invokeMethod('destroy') ?? false;
    events?.cancel();
    isDestroyed = result;
    isRecording = false;
    return result;
  } catch (e) {
    return Future.error(e);
  }
}