【发布时间】:2017-10-22 07:27:16
【问题描述】:
在 dart 2.0 中,types 是强制性的,dart 2.0 或 2.x 会添加类似的扩展方法
static int WordCount(this String str){
// custom String method here
}
【问题讨论】:
在 dart 2.0 中,types 是强制性的,dart 2.0 或 2.x 会添加类似的扩展方法
static int WordCount(this String str){
// custom String method here
}
【问题讨论】:
不,2.0 中不会有扩展方法。
要在 2.0 之后更快地移动,还有很多工作要做。 我认为扩展方法是一个普遍的愿望,但没有明确的说法 Dart 会得到它们。
【讨论】:
更新答案
截至今天,Dart 2.6 添加了扩展方法支持。
【讨论】: