@JsonCodable() 在 Dart 3.4 中抛出错误

问题描述 投票:0回答:1

我已将 JsonCodable 添加到 JsonData 类的最新 flutter 版本 3.22.0 中。但 Dart 分析服务器如何抛出错误。我还在 pubspec.yaml 中添加了宏,并对这个文件进行了启用实验。

Pubspec.yaml

pubspec.yaml

分析选项.yaml

analysis_options.yaml

我的代码.dart

sample.dart

flutter dart
1个回答
0
投票

我使用的是 Flutter 3.22.0,文档说我需要使用 Flutter 主通道。

https://dart.dev/language/macros#the-jsoncodable-macro

© www.soinside.com 2019 - 2024. All rights reserved.