升级到 3.0.0 后应用无法构建

App does not build after upgrading to 3.0.0

将我的 flutter 升级到新的 3.0.0 后 qr_code_scanner 库出现问题

e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (23, 1): Class 'QRView' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (216, 26): Null can not be a value of a non-null type String
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (247, 26): Null can not be a value of a non-null type String
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (310, 5): 'onRequestPermissionsResult' overrides nothing
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt: (10, 1): Class 'QRViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt: (13, 5): 'create' overrides nothing

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':qr_code_scanner:compileDebugKotlin'.
> Compilation error. See log for more details

使用备选方案mobile_scanner。这个库在 Flutter 3.0 中不起作用。要不然 如果你想使用 qr_code_scanner 库,那不是官方的创作者仓库,但你可以使用它。

dependency_overrides:
    qr_code_scanner:
        git:
            url: https://github.com/X-SLAYER/qr_code_scanner.git
            ref: flutter-beta