removed switch to decide what instruction to show, just use the PracticeType String to create the route and naviate to that
This commit is contained in:
parent
a3945c6777
commit
20e3e5b6e1
1 changed files with 1 additions and 24 deletions
|
@ -25,29 +25,6 @@ class _PracticeSetupState extends State<PracticeSetupPage> {
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleDialog getInstructionDialog(PracticeType practiceType){
|
|
||||||
switch(practiceType){
|
|
||||||
case PracticeType.month: {
|
|
||||||
return getMonthInstructionDialog();
|
|
||||||
}
|
|
||||||
case PracticeType.year: {
|
|
||||||
return SimpleDialog();
|
|
||||||
}
|
|
||||||
case PracticeType.century: {
|
|
||||||
return SimpleDialog();
|
|
||||||
}
|
|
||||||
case PracticeType.leap: {
|
|
||||||
return SimpleDialog();
|
|
||||||
}
|
|
||||||
case PracticeType.mod: {
|
|
||||||
return SimpleDialog();
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
return SimpleDialog();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TableRow getStatTableRow(AsyncSnapshot<Map<String, double>> snapshot, PracticeType practiceType){
|
TableRow getStatTableRow(AsyncSnapshot<Map<String, double>> snapshot, PracticeType practiceType){
|
||||||
final typeString = practiceType.toString().split(".").last;
|
final typeString = practiceType.toString().split(".").last;
|
||||||
return TableRow(
|
return TableRow(
|
||||||
|
@ -66,7 +43,7 @@ class _PracticeSetupState extends State<PracticeSetupPage> {
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context,
|
context,
|
||||||
'/instructions/year'
|
'/instructions/' + practiceType.toString().split(".").last
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Reference in a new issue