Skip to content

Instantly share code, notes, and snippets.

@horaceho
Created March 13, 2019 04:21
Show Gist options
  • Select an option

  • Save horaceho/15d77ff257253e46996ac119e9838779 to your computer and use it in GitHub Desktop.

Select an option

Save horaceho/15d77ff257253e46996ac119e9838779 to your computer and use it in GitHub Desktop.
HIIT class
class Hiit {
String name;
int warm;
int work;
int rest;
int sets;
int cool;
Hiit(this.name, this.warm, this.work, this.rest, this.sets, this.cool) {
// Initialization code goes here.
}
Hiit.tabata() : this('Tabata', 10, 20, 10, 8, 10);
void describe() {
print('$name: ${warm}s warm-up, $sets sets of ${work}s work & ${rest}s rest intervals, ${cool}s cool-down.');
}
}
void main() {
var daily = Hiit('Daily', 10, 30, 10, 5, 10);
daily.describe();
var tabata = Hiit.tabata();
tabata.describe();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment