Skip to content

Instantly share code, notes, and snippets.

@RedBrogdon
Created October 24, 2019 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RedBrogdon/ce732b859c758e04ee74e4e40b517ced to your computer and use it in GitHub Desktop.
Save RedBrogdon/ce732b859c758e04ee74e4e40b517ced to your computer and use it in GitHub Desktop.
// 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