It is possible to pass a class type as a variable in Dart ?
I am trying to do something as follows:
class Dodo
{
void hello() {
print("hello dodo");
}
}
void main() {
var a = Dodo;
var b = new a();
b.hello();
}
in python similar code would work just fine. In Dart I get an error at new a()
complaining that a
is not a type.
Is is possible to use class objects as variables ? If not, what is the recommended work around ?