Skip to content

Instantly share code, notes, and snippets.

@shivanchalaeologic
Created July 3, 2020 10:57
Show Gist options
  • Save shivanchalaeologic/8143db19617c9ee33c19081c7c59d717 to your computer and use it in GitHub Desktop.
Save shivanchalaeologic/8143db19617c9ee33c19081c7c59d717 to your computer and use it in GitHub Desktop.
mixin Hunt on Reptile {
void hunt(food) {
print('${this.runtimeType}');
swim();
crawl();
bite();
print('Eat $food');
}
}
abstract class Reptile with Swim, Crawl, Bite {}
class Alligator extends Reptile with Hunt {
}
class Crocodile extends Reptile with Hunt {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment