Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

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;
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dart #switch #classes
ADD COMMENT
Topic
Name
6+2 =