Skip to content

Commit

Permalink
Results screen total moved to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
karpev98 committed May 25, 2023
1 parent d1b19a1 commit 6116ee1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/results_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class _ResultsScreenState extends State<ResultsScreen> {
);

Widget _buildRow(BuildContext context, int index) {
if (index == 0) {
if (index >= widget.results.values.length) {
final int score = widget.results.values
.fold(0, (previousValue, element) => previousValue + element.score);
final int time = widget.results.values
Expand All @@ -182,6 +182,10 @@ class _ResultsScreenState extends State<ResultsScreen> {
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width / 4,
child: Text(
CATLocalizations.of(context).total,
textAlign: TextAlign.center,
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 4,
Expand Down Expand Up @@ -212,7 +216,7 @@ class _ResultsScreenState extends State<ResultsScreen> {
],
);
}
final ResultsRecord record = widget.results.values.toList()[index - 1];
final ResultsRecord record = widget.results.values.toList()[index];

return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
Expand Down
2 changes: 2 additions & 0 deletions lib/utility/localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ class CATLocalizations {

String get column5 => _localizedValues[_locale.languageCode]!["column5"]!;

String get total => _localizedValues[_locale.languageCode]!["total"]!;

String get resultCorrect =>
_localizedValues[_locale.languageCode]!["resultCorrect"]!;

Expand Down
1 change: 1 addition & 0 deletions lib/utility/translations/de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const Map<String, String> _resultsScreen = <String, String>{
"column3": "CAT-score",
"column4": "Ergebnis",
"column5": "Time",
"total": "Totale",
"resultCorrect": "Richtig",
"resultSkip": "Kapitulation",
"resultWrong": "Falsch",
Expand Down
1 change: 1 addition & 0 deletions lib/utility/translations/en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const Map<String, String> _resultsScreen = <String, String>{
"column3": "CAT-score",
"column4": "Result",
"column5": "Time",
"total": "Total",
"resultCorrect": "Correct",
"resultSkip": "Given up",
"resultWrong": "Wrong",
Expand Down
1 change: 1 addition & 0 deletions lib/utility/translations/fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const Map<String, String> _resultsScreen = <String, String>{
"column3": "CAT-score",
"column4": "Résultat",
"column5": "Time",
"total": "Totale",
"resultCorrect": "Correct",
"resultSkip": "Abandonné",
"resultWrong": "Faux",
Expand Down
1 change: 1 addition & 0 deletions lib/utility/translations/it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const Map<String, String> _resultsScreen = <String, String>{
"column3": "CAT-score",
"column4": "Risultato",
"column5": "Tempo",
"total": "Totale",
"resultCorrect": "Giusto",
"resultSkip": "Rinuncia",
"resultWrong": "Sbagliato",
Expand Down

0 comments on commit 6116ee1

Please sign in to comment.