dart switch class type code example
Example: dart switch with classes
class Foo {
Foo getAnother(Foo foo) {
switch (foo.runtimeType) {
case Bar:
return new Bar();
case Baz:
return new Baz();
}
return null;
}
}