londonappbrewery / quizzler-flutter-challenge-final

Completed version of the Quizzler project in the Complete Flutter Bootcamp
https://www.appbrewery.co
63 stars 137 forks source link

Is it possible to create a correct answer counter? #14

Closed shamshiyev closed 3 years ago

shamshiyev commented 3 years ago

Hi everyone! I've completed all of the TODO's and finished Quizzler App. Still, I wonder if it's possible to display a total number of all the correct answers in the final alert. Please let me know if you've found a solution to this issue.

Abdullah-Abusamra commented 3 years ago

Sure you can , the simplest form is by creating a variable called result and each time check for answer and putting a check icon make this result++ ,

then you will alert the final result :

Alert( context: context, title: 'Finished!', desc: 'You\'re score is $result out of ${brainObject.numberOfQuestions()}.', ).show();

then you would restart it with all other variables.

shamshiyev commented 3 years ago

@Abdullah-Abusamra Thank you, brother. Everything worked perfectly :) Without this little detail, the app looked incomplete.
Wish you all the best!