flutter - 切换到 dart 2 会导致 jaguar 序列化程序出现问题

标签 flutter

通过对 dart 2 的更新,jaguar 序列化程序会导致问题。

我的设置是:

Flutter Channel 测试版,v0.2.8

pubspec.yaml

dependencies:
  analyzer: "^0.31.2-alpha.1" ## i also tried to get the newest version
  intl: "^0.15.4"
  http: "^0.11.3+16"
  great_circle_distance: "^1.0.1"
  ####jaguar_serializer: "^1.0.0-dev5"
  jaguar_serializer: ^1.0.0-dev1

dev_dependencies:
  build_runner: ^0.8.0
  jaguar_serializer_cli: ^1.0.0-dev1

这是我收到的错误消息。似乎分析器包已更改..

DynamicTypeImpl 来自 package:analyzer/src/dart/element/type.dart

接口(interface)类型来自 package:analyzer/dart/element/type.dart

  [SEVERE] jaguar_serializer_cli on lib/foundation/dart/logic/raw/RawType.dart:
    Error running JaguarSerializerGenerator for nalisa_foundation|lib/foundation/dart/logic/raw/RawType.dart.
    type 'DynamicTypeImpl' is not a subtype of type 'InterfaceType' in type cast where
      DynamicTypeImpl is from package:analyzer/src/dart/element/type.dart
      InterfaceType is from package:analyzer/dart/element/type.dart

    [SEVERE] jaguar_serializer_cli on lib/foundation/dart/logic/Status.dart:
    Error running JaguarSerializerGenerator for nalisa_foundation|lib/foundation/dart/logic/Status.dart.
    type 'DynamicTypeImpl' is not a subtype of type 'InterfaceType' in type cast where
      DynamicTypeImpl is from package:analyzer/src/dart/element/type.dart
      InterfaceType is from package:analyzer/dart/element/type.dart

最佳答案

使用 jaguar_serialzier 2.2

dependencies:
  analyzer: "^0.32.0"
  intl: "^0.15.4"
  http: "^0.11.3+16"
  great_circle_distance: "^1.0.1"
  jaguar_serializer: ^2.2.0

dev_dependencies:
  build_runner: ^0.8.0
  jaguar_serializer_cli: ^2.2.0

此外,Jaguar gitter channel 是提问的好地方。

关于flutter - 切换到 dart 2 会导致 jaguar 序列化程序出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49761546/

相关文章:

image - 如何在 flutter 中将图像存储到缓存的网络图像

listview - Flutter ListView.builder() 动态列表 - 显示无限重复的条目

dart - 创建自己的 Flutter 小部件最佳实践

flutter - 整数列表的基本操作

firebase - Dart SDK 版本与 pubspec.yaml 的依赖项冲突

flutter - 无法在我的 flutter 项目中安装依赖项

dart - 我尝试使用 TextField 的 Controller ,但我收到错误 "NoSuchMethodError: The method ' 调用' was called on null"

dart - Flutter 执行顺序 : build and initState

flutter - 如何在 flutter 中停止 GIF 循环?

flutter - 当 Flutter TextField 中的键盘可见时,键盘顶部有很多空白区域