Create a static Extension method in Dart
As of now January 2020, Dart 2.7 officially introduced extension methods. To extend a class, this can be done:
extension NewExtension on double {
int get myMethod {
return (1/this*10).toInt();
}
}
As of now January 2020, Dart 2.7 officially introduced extension methods. To extend a class, this can be done:
extension NewExtension on double {
int get myMethod {
return (1/this*10).toInt();
}
}