Answers for "dart switch with classes"

-1

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;
  }
}
Posted by: Guest on September-04-2020

Code answers related to "Dart"

Browse Popular Code Answers by Language