dispose method

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

Dispose the controller.

Once the controller is disposed, it cannot be used anymore.

Implementation

@override
Future<void> dispose() async {
  if (_isDisposed) {
    return;
  }

  _isDisposed = true;
  unawaited(_barcodesController.close());
  super.dispose();

  await MobileScannerPlatform.instance.dispose();
}