Skip to content

Instantly share code, notes, and snippets.

@miquelbeltran
Forked from Sfshaza/main.dart
Last active March 3, 2021 16:24
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 miquelbeltran/72f12a5bcb1418b6e8f60026d260f8da to your computer and use it in GitHub Desktop.
Save miquelbeltran/72f12a5bcb1418b6e8f60026d260f8da to your computer and use it in GitHub Desktop.
Java-to-Dart codelab: Basic bicycle example
class Bicycle {
late int cadence;
late int speed;
late int gear;
Bicycle(this.cadence, this.speed, this.gear);
@override
String toString() => 'Bicycle: $speed mph';
}
void main() {
var bike = new Bicycle(2, 0, 1);
print(bike);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment