Created
October 24, 2019 22:12
-
-
Save RedBrogdon/ce732b859c758e04ee74e4e40b517ced to your computer and use it in GitHub Desktop.
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
// A simple extension method demo. | |
extension IntDoubler on int { | |
int doubleMe() => this * 2; | |
} | |
void main() { | |
for (int i = 0; i < 10; i++) { | |
print ('$i becomes ${i.doubleMe()}'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment