Is there a way to add a static extension method on a class directly in Dart?

Dart doesn’t support static extension methods.

An extension method acts like an instance method, not like a static method. There is currently no way to add static methods to a class from outside the class.

You can declare static methods in an extension, but they are static on the extension itself (you call them using ExtensionName.methodName()).

There is a discussion about adding extension static methods in https://github.com/dart-lang/language/issues/723.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)