fixe das problem: 

onScan: (code, _, listener) {
    if (code != null) {
        if (processingInProgress == false) {
            processingInProgress = true;
            widget.callback(ScanResult(code)).then((isValidCode) {
                if (!controllerDisposed && !isValidCode) {
                    processingInProgress = false;
                }
            });
        }
    }
},
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/patient_app_localizations.dart';
import 'package:patient_app/models/scan_result.dart';
import 'package:patient_app/modules/account_linking/account_linking_state_manager.dart';
import 'package:patient_app/modules/account_linking/widgets/qr_scanner.dart'
    if (dart.library.html) 'package:patient_app/modules/account_linking/widgets/qr_scanner_mock.dart';
import 'package:patient_app/modules/account_linking/widgets/qr_scanner_unmaintained.dart'
    as qr_code_scanner_unmaintained;
import 'package:patient_app/settings.dart' as settings;
import 'package:patient_app/theme/patient_app_theme.dart' as theme;
import 'package:provider/provider.dart';

class AccountLinkingQrCodeScannerScreen extends StatefulWidget {
  static MaterialPage page() {
    return const MaterialPage(
      name: "QrCodeScanner",
      key: ValueKey("QrCodeScanner"),
      child: AccountLinkingQrCodeScannerScreen(),
    );
  }

  const AccountLinkingQrCodeScannerScreen({Key? key}) : super(key: key);

  @override
  State<AccountLinkingQrCodeScannerScreen> createState() =>
      _AccountLinkingQrCodeScannerScreenState();
}

class _AccountLinkingQrCodeScannerScreenState
    extends State<AccountLinkingQrCodeScannerScreen> {
  late AppLocalizations _l10n;

  @override
  void didChangeDependencies() {
    _l10n = AppLocalizations.of(context)!;
    super.didChangeDependencies();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        alignment: Alignment.center,
        fit: StackFit.expand,
        children: <Widget>[
          _buildQrScannerArea(),
          _buildMainContent(),
        ],
      ),
    );
  }

  Widget _buildMainContent() {
    return Padding(
      padding: theme.commonEdgeInsets,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          const SizedBox(
            height: theme.extraLargeSpacing,
          ),
          Text(
            _l10n.accountLinking_QrCodeScannerScreenTitle,
            style: theme.lightHeadline1,
          ),
          const SizedBox(height: theme.extraSmallSpacing),
          Text(
            _l10n.accountLinking_QrCodeScannerScreenDescription,
            style: theme.lightBodyText2,
          ),
          const Spacer(),
          Center(
            child: ElevatedButton(
              onPressed: () {
                context.read<AccountLinkingStateManager>().deleteState();
              },
              style: Theme.of(context).elevatedButtonTheme.style,
              child: Text(_l10n.general_cancelButtonLabel),
            ),
          ),
        ],
      ),
    );
  }

  Widget _buildQrScannerArea() {
    Widget child = settings.useUnmaintainedQrScanner
        ? qr_code_scanner_unmaintained.QrScanner(
            callback: _handleResult, backButtonCallback: _backButtonCallback)
        : QrScanner(
            callback: _handleResult,
            backButtonCallback: _backButtonCallback,
          );
    return Positioned.fill(
      child: child,
    );
  }

  Future<bool> _handleResult(ScanResult scanResult) async {
    if (isValid(scanResult)) {
      context.read<AccountLinkingStateManager>().updateScanResult(scanResult);
      return true;
    } else {
      return false;
    }
  }

  // prevent qr code fragments to be accepted
  // Large qr codes could result in partially identified qr codes,
  // they are too short to be accepted
  bool isValid(ScanResult scanResult) => scanResult.qrCodeAsString.length > 16;

  void _backButtonCallback() {
    context.read<AccountLinkingStateManager>().deleteState();
  }
}
camera_controller.dart
  void _throwIfNotInitialized(String functionName) {
    if (!value.isInitialized) {
      throw CameraException(
        'Uninitialized CameraController',
        '$functionName() was called on an uninitialized CameraController.',
      );
    }
    if (_isDisposed) {
      throw CameraException(
        'Disposed CameraController',
        '$functionName() was called on a disposed CameraController.',
      );
    }
  }
code_scan.dart
  /// Stops the camera image controller and image stream.
  Future<void> stop() async {
    await imageController.close();
    if (controller.value.isStreamingImages) {
      await controller.stopImageStream();
    }
  }
  /// Alias of the `.stop()` method, for consistency with the flutter environment.
  Future<void> dispose() async => await stop();
erros_patch.dart
@patch
class Error {
  @patch
  static String _objectToString(Object object) {
    return Object._toString(object);
  }

  @patch
  static String _stringToSafeString(String string) {
    return json.encode(string);
  }

  @patch
  StackTrace? get stackTrace => _stackTrace;

  @pragma("vm:entry-point")
  StackTrace? _stackTrace;

  @patch
  @pragma("vm:external-name", "Error_throwWithStackTrace")
  external static Never _throw(Object error, StackTrace stackTrace);
}