Hi,
How do I do a instantiation of an a abstract class or interface?
Eg:
Java
interface Callback<T> {
void execute(T arg0);
}
Callback<String> cs = new Callback<String>() {
void execute(String arg0) {
;
}
}
Dart
abstract class Callback<T> {
abstract void execute(T arg0);
}
or
interface Callback<T> {
void execute(T arg0);
}
If I do:
var callback = new Callback<String>() {
void execute(String arg0) {
;
}
}
I get the markers in the Dart Editor: Instantiation of a abstract class or New expression does not resolve to a constructor
There is a better approach to this?
Which is the Dart way?
Thanks in advance.