Skip to content

Instantly share code, notes, and snippets.

@shivanchalaeologic
Created July 3, 2020 10:57
Show Gist options
  • Select an option

  • Save shivanchalaeologic/20f6c53f92405ec05896934c82f4bbbe to your computer and use it in GitHub Desktop.

Select an option

Save shivanchalaeologic/20f6c53f92405ec05896934c82f4bbbe 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