飞镖2.17.0:我如何启用“增强型”?
代码示例:
enum ShareType {
NONE('N'),
PUBLISH('P'),
SHARE('S');
final String key;
const ShareType(String keyToSet) {this.key = keyToSet;}
}
给出错误:
这需要启用“增强 - 启动”语言功能。
如何启用此功能? 必须设置在哪里?
Code example:
enum ShareType {
NONE('N'),
PUBLISH('P'),
SHARE('S');
final String key;
const ShareType(String keyToSet) {this.key = keyToSet;}
}
gives error:
This requires the 'enhanced-enums' language feature to be enabled.
How do I enable this feature?
Where must this be set?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
进入项目中的
pubspec.yaml
文件,并确保sdk
的最低版本是2.17.0
类似:这就是DART跟踪何时引入功能,并确保您的项目不利用不兼容的功能,而这些功能对于您的项目根据需要指定的版本范围不兼容。
Go into your
pubspec.yaml
file in your project and make sure that the minimum version for thesdk
are2.17.0
like:The reason for this is that Dart keeps track of when features are introduced and makes sure your project does not make use of features that would not be compatible for the range of versions your project have specified as required.