Created
November 25, 2019 23:38
-
-
Save r3dm1ke/bd480952cbe40765fe94a61ca88e79c2 to your computer and use it in GitHub Desktop.
Mixins in Dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mixin Battery { | |
int level = 100; | |
void die() { | |
this.level = 0; | |
} | |
} | |
class Laptop extends Computer with Battery { | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment