Skip to content

Instantly share code, notes, and snippets.

Created October 8, 2016 17:55
Show Gist options
  • Save anonymous/75b66d16842123886b445ee4f6c066e4 to your computer and use it in GitHub Desktop.
Save anonymous/75b66d16842123886b445ee4f6c066e4 to your computer and use it in GitHub Desktop.
fatdragon-dart
// shows how to use cascade method calls in Dart
class Cat {
String color;
Cat(this.color);
meow() { print("meow"); }
yawn() { print("yawn"); }
show() { print("furry ${color} hair"); }
}
void main() {
Cat dingdong = new Cat("grey");
dingdong
..meow()
..yawn()
..show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment