Skip to content

Commit

Permalink
Remove non null safe libraries and migrate the app
Browse files Browse the repository at this point in the history
  • Loading branch information
rajoriaakash committed Jan 2, 2022
1 parent 2f75231 commit fe1d943
Show file tree
Hide file tree
Showing 41 changed files with 438 additions and 470 deletions.
2 changes: 1 addition & 1 deletion lib/QuizScreens/Question1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Question1 extends StatefulWidget {
}

class _Question1State extends State<Question1> {
String chosen;
String? chosen;
bool answered = false;
String option1 = 'Bold, fierce, strong headed';
String option2 = 'Lively, Extrovert, Cheerful';
Expand Down
20 changes: 10 additions & 10 deletions lib/QuizScreens/Question2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:test_app/model/QuizDataModel.dart';

//ignore: must_be_immutable
class Question2 extends StatefulWidget {
QuizData quizData = QuizData();
QuizData? quizData = QuizData();
Question2({this.quizData});

@override
Expand All @@ -17,7 +17,7 @@ class Question2 extends StatefulWidget {
}

class _Question2State extends State<Question2> {
String chosen;
String? chosen;
bool answered = false;
String option1 = 'Fancy restaurant';
String option2 = 'Backpacking through Europe';
Expand Down Expand Up @@ -79,7 +79,7 @@ class _Question2State extends State<Question2> {
chosen = option1;
answered = true;
widget.tug += 1;
widget.quizData.tug += widget.tug;
widget.quizData!.tug += widget.tug;
});
}
},
Expand Down Expand Up @@ -109,7 +109,7 @@ class _Question2State extends State<Question2> {
chosen = option2;
answered = true;
widget.pfo += 1;
widget.quizData.pfo += widget.pfo;
widget.quizData!.pfo += widget.pfo;
});
}
},
Expand Down Expand Up @@ -139,7 +139,7 @@ class _Question2State extends State<Question2> {
chosen = option3;
answered = true;
widget.hppa += 1;
widget.quizData.hppa += widget.hppa;
widget.quizData!.hppa += widget.hppa;
});
}
},
Expand Down Expand Up @@ -169,7 +169,7 @@ class _Question2State extends State<Question2> {
chosen = option4;
answered = true;
widget.tgdt += 1;
widget.quizData.tgdt += widget.tgdt;
widget.quizData!.tgdt += widget.tgdt;
});
}
},
Expand Down Expand Up @@ -201,13 +201,13 @@ class _Question2State extends State<Question2> {
onPressed: () {
setState(() {
if (chosen == option1) {
widget.quizData.tug -= 1;
widget.quizData!.tug -= 1;
} else if (chosen == option2) {
widget.quizData.pfo -= 1;
widget.quizData!.pfo -= 1;
} else if (chosen == option3) {
widget.quizData.hppa -= 1;
widget.quizData!.hppa -= 1;
} else if (chosen == option4) {
widget.quizData.tgdt -= 1;
widget.quizData!.tgdt -= 1;
}
chosen = '';
answered = false;
Expand Down
20 changes: 10 additions & 10 deletions lib/QuizScreens/Question3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:test_app/model/QuizDataModel.dart';

//ignore: must_be_immutable
class Question3 extends StatefulWidget {
QuizData quizData = QuizData();
QuizData? quizData = QuizData();
Question3({this.quizData});

@override
Expand All @@ -17,7 +17,7 @@ class Question3 extends StatefulWidget {
}

class _Question3State extends State<Question3> {
String chosen;
String? chosen;
bool answered = false;
String option1 = 'I believe in soulmates';
String option2 = 'A love triangle because I\'m\nconfused';
Expand Down Expand Up @@ -79,7 +79,7 @@ class _Question3State extends State<Question3> {
chosen = option1;
answered = true;
widget.pfo += 1;
widget.quizData.pfo += widget.pfo;
widget.quizData!.pfo += widget.pfo;
});
}
},
Expand Down Expand Up @@ -109,7 +109,7 @@ class _Question3State extends State<Question3> {
chosen = option2;
answered = true;
widget.ts += 1;
widget.quizData.ts += widget.ts;
widget.quizData!.ts += widget.ts;
});
}
},
Expand Down Expand Up @@ -139,7 +139,7 @@ class _Question3State extends State<Question3> {
chosen = option3;
answered = true;
widget.aad += 1;
widget.quizData.aad += widget.aad;
widget.quizData!.aad += widget.aad;
});
}
},
Expand Down Expand Up @@ -169,7 +169,7 @@ class _Question3State extends State<Question3> {
chosen = option4;
answered = true;
widget.fsg += 1;
widget.quizData.fsg += widget.fsg;
widget.quizData!.fsg += widget.fsg;
});
}
},
Expand Down Expand Up @@ -201,13 +201,13 @@ class _Question3State extends State<Question3> {
onPressed: () {
setState(() {
if (chosen == option1) {
widget.quizData.pfo -= 1;
widget.quizData!.pfo -= 1;
} else if (chosen == option2) {
widget.quizData.ts -= 1;
widget.quizData!.ts -= 1;
} else if (chosen == option3) {
widget.quizData.aad -= 1;
widget.quizData!.aad -= 1;
} else if (chosen == option4) {
widget.quizData.fsg -= 1;
widget.quizData!.fsg -= 1;
}
chosen = '';
answered = false;
Expand Down
28 changes: 14 additions & 14 deletions lib/QuizScreens/Question4.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:test_app/model/QuizDataModel.dart';

//ignore: must_be_immutable
class Question4 extends StatefulWidget {
QuizData quizData = QuizData();
QuizData? quizData = QuizData();
Question4({this.quizData});

@override
Expand All @@ -19,7 +19,7 @@ class Question4 extends StatefulWidget {
}

class _Question4State extends State<Question4> {
String chosen;
String? chosen;
bool answered = false;
String option1 = 'Fall in love with a\nbillionaire';
String option2 =
Expand Down Expand Up @@ -83,7 +83,7 @@ class _Question4State extends State<Question4> {
chosen = option1;
answered = true;
widget.fsg += 1;
widget.quizData.fsg += widget.fsg;
widget.quizData!.fsg += widget.fsg;
});
}
},
Expand Down Expand Up @@ -113,7 +113,7 @@ class _Question4State extends State<Question4> {
chosen = option2;
answered = true;
widget.tgdt += 1;
widget.quizData.tgdt += widget.tgdt;
widget.quizData!.tgdt += widget.tgdt;
});
}
},
Expand Down Expand Up @@ -143,7 +143,7 @@ class _Question4State extends State<Question4> {
chosen = option3;
answered = true;
widget.aad += 1;
widget.quizData.aad += widget.aad;
widget.quizData!.aad += widget.aad;
});
}
},
Expand Down Expand Up @@ -175,9 +175,9 @@ class _Question4State extends State<Question4> {
widget.pw += 1;
widget.csms += 1;
widget.eu += 1;
widget.quizData.pw += widget.pw;
widget.quizData.csms += widget.csms;
widget.quizData.eu += widget.eu;
widget.quizData!.pw += widget.pw;
widget.quizData!.csms += widget.csms;
widget.quizData!.eu += widget.eu;
});
}
},
Expand Down Expand Up @@ -209,15 +209,15 @@ class _Question4State extends State<Question4> {
onPressed: () {
setState(() {
if (chosen == option1) {
widget.quizData.fsg -= 1;
widget.quizData!.fsg -= 1;
} else if (chosen == option2) {
widget.quizData.tgdt -= 1;
widget.quizData!.tgdt -= 1;
} else if (chosen == option3) {
widget.quizData.aad -= 1;
widget.quizData!.aad -= 1;
} else if (chosen == option4) {
widget.quizData.pw -= 1;
widget.quizData.csms -= 1;
widget.quizData.eu -= 1;
widget.quizData!.pw -= 1;
widget.quizData!.csms -= 1;
widget.quizData!.eu -= 1;
}
chosen = '';
answered = false;
Expand Down
24 changes: 12 additions & 12 deletions lib/QuizScreens/Question5.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:test_app/model/QuizDataModel.dart';

//ignore: must_be_immutable
class Question5 extends StatefulWidget {
QuizData quizData = QuizData();
QuizData? quizData = QuizData();
Question5({this.quizData});

@override
Expand All @@ -18,7 +18,7 @@ class Question5 extends StatefulWidget {
}

class _Question5State extends State<Question5> {
String chosen;
String? chosen;
bool answered = false;
String option1 = 'A closely knit group of 3-5 people';
String option2 =
Expand Down Expand Up @@ -81,7 +81,7 @@ class _Question5State extends State<Question5> {
chosen = option1;
answered = true;
widget.hppa += 1;
widget.quizData.hppa += widget.hppa;
widget.quizData!.hppa += widget.hppa;
});
}
},
Expand Down Expand Up @@ -111,7 +111,7 @@ class _Question5State extends State<Question5> {
chosen = option2;
answered = true;
widget.ts += 1;
widget.quizData.ts += widget.ts;
widget.quizData!.ts += widget.ts;
});
}
},
Expand Down Expand Up @@ -142,8 +142,8 @@ class _Question5State extends State<Question5> {
answered = true;
widget.eu += 1;
widget.csms += 1;
widget.quizData.eu += widget.eu;
widget.quizData.csms += widget.csms;
widget.quizData!.eu += widget.eu;
widget.quizData!.csms += widget.csms;
});
}
},
Expand Down Expand Up @@ -173,7 +173,7 @@ class _Question5State extends State<Question5> {
chosen = option4;
answered = true;
widget.kr += 1;
widget.quizData.kr += widget.kr;
widget.quizData!.kr += widget.kr;
});
}
},
Expand Down Expand Up @@ -205,14 +205,14 @@ class _Question5State extends State<Question5> {
onPressed: () {
setState(() {
if (chosen == option1) {
widget.quizData.hppa -= 1;
widget.quizData!.hppa -= 1;
} else if (chosen == option2) {
widget.quizData.ts -= 1;
widget.quizData!.ts -= 1;
} else if (chosen == option3) {
widget.quizData.csms -= 1;
widget.quizData.eu -= 1;
widget.quizData!.csms -= 1;
widget.quizData!.eu -= 1;
} else if (chosen == option4) {
widget.quizData.kr -= 1;
widget.quizData!.kr -= 1;
}
chosen = '';
answered = false;
Expand Down
20 changes: 10 additions & 10 deletions lib/QuizScreens/Question6.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:test_app/model/QuizDataModel.dart';

//ignore: must_be_immutable
class Question6 extends StatefulWidget {
QuizData quizData = QuizData();
QuizData? quizData = QuizData();
Question6({this.quizData});

@override
Expand All @@ -17,7 +17,7 @@ class Question6 extends StatefulWidget {
}

class _Question6State extends State<Question6> {
String chosen;
String? chosen;
bool answered = false;
String option1 = 'Sweden';
String option2 = 'A lavish castle in a dystopian world';
Expand Down Expand Up @@ -79,7 +79,7 @@ class _Question6State extends State<Question6> {
chosen = option1;
answered = true;
widget.tgdt += 1;
widget.quizData.tgdt += widget.tgdt;
widget.quizData!.tgdt += widget.tgdt;
});
}
},
Expand Down Expand Up @@ -109,7 +109,7 @@ class _Question6State extends State<Question6> {
chosen = option2;
answered = true;
widget.ts += 1;
widget.quizData.ts += widget.ts;
widget.quizData!.ts += widget.ts;
});
}
},
Expand Down Expand Up @@ -139,7 +139,7 @@ class _Question6State extends State<Question6> {
chosen = option3;
answered = true;
widget.kr += 1;
widget.quizData.kr += widget.kr;
widget.quizData!.kr += widget.kr;
});
}
},
Expand Down Expand Up @@ -169,7 +169,7 @@ class _Question6State extends State<Question6> {
chosen = option4;
answered = true;
widget.aad += 1;
widget.quizData.aad += widget.aad;
widget.quizData!.aad += widget.aad;
});
}
},
Expand Down Expand Up @@ -201,13 +201,13 @@ class _Question6State extends State<Question6> {
onPressed: () {
setState(() {
if (chosen == option1) {
widget.quizData.tgdt -= 1;
widget.quizData!.tgdt -= 1;
} else if (chosen == option2) {
widget.quizData.ts -= 1;
widget.quizData!.ts -= 1;
} else if (chosen == option3) {
widget.quizData.kr -= 1;
widget.quizData!.kr -= 1;
} else if (chosen == option4) {
widget.quizData.aad -= 1;
widget.quizData!.aad -= 1;
}
chosen = '';
answered = false;
Expand Down
Loading

0 comments on commit fe1d943

Please sign in to comment.