bitnick
bitnick

Reputation: 2073

Does Dart 2.0 have extension methods?

in dart 2.0,types are mandatory,will dart 2.0 or 2.x add extension methods like

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

Upvotes: 1

Views: 1085

Answers (2)

Miguel Ruivo
Miguel Ruivo

Reputation: 17766

Updated answer

As of today, Dart 2.6, added extension methods support.

Upvotes: 0

Günter Zöchbauer
Günter Zöchbauer

Reputation: 658087

No, there won't be extension methods in 2.0.

There is a lot of work going on to be able to move faster after 2.0. I think extension methods is a popular wish, but there is no definitive statement Dart will get them.

Upvotes: 3

Related Questions