dispose method Null safety

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

Releases the resources of this camera.

Implementation

@override
Future<void> dispose() async {
  if (_isDisposed) {
    return;
  }
  _unawaited(_deviceOrientationSubscription?.cancel());
  _isDisposed = true;
  super.dispose();
  if (_initCalled != null) {
    await _initCalled;
    await CameraPlatform.instance.dispose(_cameraId);
  }
}