dispose method

Future<void> dispose()

Disposed the platform camera and resets the whole system.

Implementation

Future<void> dispose() async {
  try {
    await _platform.dispose();
    state._previewConfig = null;
    state.eventNotifier.value = CameraEvent.uninitialized;
  } catch (error, stack) {
    state._error = error;
    state.eventNotifier.value = CameraEvent.error;
    debugPrint(error.toString());
    debugPrintStack(stackTrace: stack);
  }
}