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:
BroodjeAap 2020-12-21 16:03:27 +01:00
parent a3945c6777
commit 20e3e5b6e1

View file

@ -25,29 +25,6 @@ class _PracticeSetupState extends State<PracticeSetupPage> {
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){
final typeString = practiceType.toString().split(".").last;
return TableRow(
@ -66,7 +43,7 @@ class _PracticeSetupState extends State<PracticeSetupPage> {
onLongPress: () {
Navigator.pushNamed(
context,
'/instructions/year'
'/instructions/' + practiceType.toString().split(".").last
);
},
),