在 Flutter 3.10.0 上运行有漂移的包中运行 build_runner 2.4.2 时出现错误

Cam*_*lli 4 drift dart flutter

更新到 Flutter 3.10.0 后,在有漂移的包中出现以下错误:

Failed to build build_runner:build_runner:
../../../../../.pub-cache/hosted/pub.dev/matcher-0.12.13/lib/src/error_matchers.dart:19:49: Error: 'CyclicInitializationError' isn't a type.
const isCyclicInitializationError = TypeMatcher<CyclicInitializationError>();
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/matcher-0.12.13/lib/src/error_matchers.dart:31:39: Error: 'NullThrownError' isn't a type.
const isNullThrownError = TypeMatcher<NullThrownError>();
Run Code Online (Sandbox Code Playgroud)

我找不到与之相关的任何内容,我不知道它是否是漂移,但依赖项如下:

  # dependecy injection
  get_it: ^7.6.0
  injectable: ^2.1.1

  # Storage
  drift: ^2.8.0
  encrypted_drift:
    git:
      url: https://github.com/simolus3/drift.git
      path: extras/encryption

  uuid: ^3.0.7
Run Code Online (Sandbox Code Playgroud)

我跑flutter pub run build_runner build --delete-conflicting-outputs

我有以下错误:

Failed to build build_runner:build_runner:
../../../../../.pub-cache/hosted/pub.dev/matcher-0.12.13/lib/src/error_matchers.dart:19:49: Error: 'CyclicInitializationError' isn't a type.
const isCyclicInitializationError = TypeMatcher<CyclicInitializationError>();
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/matcher-0.12.13/lib/src/error_matchers.dart:31:39: Error: 'NullThrownError' isn't a type.
const isNullThrownError = TypeMatcher<NullThrownError>();
Run Code Online (Sandbox Code Playgroud)

小智 13

这个命令对我有用。

flutter pub upgrade
Run Code Online (Sandbox Code Playgroud)