Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 2.0是否有扩展方法?_Dart_Extension Methods - Fatal编程技术网

Dart 2.0是否有扩展方法?

Dart 2.0是否有扩展方法?,dart,extension-methods,Dart,Extension Methods,在dart 2.0中,类型是必需的,dart 2.0或2.x会添加扩展方法吗 static int WordCount(this String str){ // custom String method here } 不,2.0中不会有扩展方法 要想在2.0版之后更快地运行,还有很多工作要做。 我认为扩展方法是一个普遍的愿望,但Dart并没有明确的说法能够实现它们。更新的答案 到今天为止,Dart 2.6增加了扩展方法支持

在dart 2.0中,类型是必需的,dart 2.0或2.x会添加扩展方法吗

static int WordCount(this String str){
   // custom String method here
} 

不,2.0中不会有扩展方法

要想在2.0版之后更快地运行,还有很多工作要做。
我认为扩展方法是一个普遍的愿望,但Dart并没有明确的说法能够实现它们。

更新的答案

到今天为止,Dart 2.6增加了扩展方法支持