Skip to content

Instantly share code, notes, and snippets.

@Sfshaza
Last active December 28, 2022 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Sfshaza/f176b4c31b4be8a454107d0946fe2fa3 to your computer and use it in GitHub Desktop.
Save Sfshaza/f176b4c31b4be8a454107d0946fe2fa3 to your computer and use it in GitHub Desktop.
Java-to-Dart codelab: Basic bicycle example
class Bicycle {
int cadence;
int speed;
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