Skip to content

Instantly share code, notes, and snippets.

@zoechi
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoechi/28a51cfb570f790146a2 to your computer and use it in GitHub Desktop.
Save zoechi/28a51cfb570f790146a2 to your computer and use it in GitHub Desktop.
// SO 29334843
main() {
var a = new A()..doSomething();
print('`a:` $a');
var b = new B()..doSomething();
print('`b:` $b');
var c = new C()..doSomething();
print('`c:` $c');
}
abstract class A {
void doSomething() => print('Do something..');
factory A() => new B();
A.protected();
}
class B implements A {
@override
void doSomething() => print('Do something already..');
}
class C extends A {
C() : super.protected();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment