Skip to content

Instantly share code, notes, and snippets.

@faizan1947
Created January 5, 2023 14:03
Show Gist options
  • Save faizan1947/2e45da68fd56038f5560466e16a5f1fd to your computer and use it in GitHub Desktop.
Save faizan1947/2e45da68fd56038f5560466e16a5f1fd to your computer and use it in GitHub Desktop.
dart-mixin
void main() {
Duck().fly();
Duck().swim();
Duck().move();
}
class Animal{
void move(){
print('moving position');
}
}
mixin canSwim{
void swim(){
print('changing position by swimming');
}
}
mixin canFly{
void fly(){
print('changing position by Flying');
}
}
class Duck extends Animal with canSwim,canFly{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment