Compare commits
12 Commits
52b78e44e4
...
feature/13
| Author | SHA1 | Date | |
|---|---|---|---|
| ddf32797aa | |||
| df1bc4bf32 | |||
| 36fda30f27 | |||
| 1ab869ec26 | |||
| 9b2fcf1860 | |||
| f0c575d2c9 | |||
| d5a7bb320f | |||
| 84b8541822 | |||
| 544e55c4fd | |||
| c50ad288fa | |||
| 494dec8c61 | |||
| 975679b048 |
@@ -1,5 +1,9 @@
|
|||||||
include: package:flutter_lints/flutter.yaml
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
|
analyzer:
|
||||||
|
exclude:
|
||||||
|
- lib/presentation/views/main_menu/settings_view/licenses/oss_licenses.dart
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
rules:
|
rules:
|
||||||
avoid_print: false
|
avoid_print: false
|
||||||
@@ -12,7 +16,3 @@ linter:
|
|||||||
unnecessary_const: true
|
unnecessary_const: true
|
||||||
lines_longer_than_80_chars: false
|
lines_longer_than_80_chars: false
|
||||||
constant_identifier_names: false
|
constant_identifier_names: false
|
||||||
|
|
||||||
analyzer:
|
|
||||||
exclude:
|
|
||||||
- lib/presentation/views/main_menu/settings_view/licenses/oss_licenses.dart
|
|
||||||
|
|||||||
@@ -85,21 +85,21 @@ class CustomTheme {
|
|||||||
);
|
);
|
||||||
|
|
||||||
static const SearchBarThemeData searchBarTheme = SearchBarThemeData(
|
static const SearchBarThemeData searchBarTheme = SearchBarThemeData(
|
||||||
textStyle: WidgetStatePropertyAll(TextStyle(color: CustomTheme.textColor)),
|
textStyle: WidgetStatePropertyAll(TextStyle(color: textColor)),
|
||||||
hintStyle: WidgetStatePropertyAll(TextStyle(color: CustomTheme.hintColor)),
|
hintStyle: WidgetStatePropertyAll(TextStyle(color: hintColor)),
|
||||||
);
|
);
|
||||||
|
|
||||||
static final RadioThemeData radioTheme = RadioThemeData(
|
static final RadioThemeData radioTheme = RadioThemeData(
|
||||||
fillColor: WidgetStateProperty.resolveWith<Color>((states) {
|
fillColor: WidgetStateProperty.resolveWith<Color>((states) {
|
||||||
if (states.contains(WidgetState.selected)) {
|
if (states.contains(WidgetState.selected)) {
|
||||||
return CustomTheme.primaryColor;
|
return primaryColor;
|
||||||
}
|
}
|
||||||
return CustomTheme.textColor;
|
return textColor;
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
static const InputDecorationTheme inputDecorationTheme = InputDecorationTheme(
|
static const InputDecorationTheme inputDecorationTheme = InputDecorationTheme(
|
||||||
labelStyle: TextStyle(color: CustomTheme.textColor),
|
labelStyle: TextStyle(color: textColor),
|
||||||
hintStyle: TextStyle(color: CustomTheme.hintColor),
|
hintStyle: TextStyle(color: hintColor),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
"days_ago": "vor {count} Tagen",
|
"days_ago": "vor {count} Tagen",
|
||||||
"delete": "Löschen",
|
"delete": "Löschen",
|
||||||
"delete_all_data": "Alle Daten löschen",
|
"delete_all_data": "Alle Daten löschen",
|
||||||
"delete_group": "Diese Gruppe löschen",
|
"delete_group": "Gruppe löschen",
|
||||||
"delete_match": "Spiel löschen",
|
"delete_match": "Spiel löschen",
|
||||||
"edit_group": "Gruppe bearbeiten",
|
"edit_group": "Gruppe bearbeiten",
|
||||||
"edit_match": "Gruppe bearbeiten",
|
"edit_match": "Gruppe bearbeiten",
|
||||||
|
"enter_points": "Punkte eingeben",
|
||||||
"enter_results": "Ergebnisse eintragen",
|
"enter_results": "Ergebnisse eintragen",
|
||||||
"error_creating_group": "Fehler beim Erstellen der Gruppe, bitte erneut versuchen",
|
"error_creating_group": "Fehler beim Erstellen der Gruppe, bitte erneut versuchen",
|
||||||
"error_deleting_group": "Fehler beim Löschen der Gruppe, bitte erneut versuchen",
|
"error_deleting_group": "Fehler beim Löschen der Gruppe, bitte erneut versuchen",
|
||||||
@@ -74,6 +75,7 @@
|
|||||||
"player_name": "Spieler:innenname",
|
"player_name": "Spieler:innenname",
|
||||||
"players": "Spieler:innen",
|
"players": "Spieler:innen",
|
||||||
"players_count": "{count} Spieler",
|
"players_count": "{count} Spieler",
|
||||||
|
"points": "Punkte",
|
||||||
"privacy_policy": "Datenschutzerklärung",
|
"privacy_policy": "Datenschutzerklärung",
|
||||||
"quick_create": "Schnellzugriff",
|
"quick_create": "Schnellzugriff",
|
||||||
"recent_matches": "Letzte Spiele",
|
"recent_matches": "Letzte Spiele",
|
||||||
@@ -87,12 +89,14 @@
|
|||||||
"save_changes": "Änderungen speichern",
|
"save_changes": "Änderungen speichern",
|
||||||
"search_for_groups": "Nach Gruppen suchen",
|
"search_for_groups": "Nach Gruppen suchen",
|
||||||
"search_for_players": "Nach Spieler:innen suchen",
|
"search_for_players": "Nach Spieler:innen suchen",
|
||||||
"select_winner": "Gewinner:in wählen:",
|
"select_winner": "Gewinner:in wählen",
|
||||||
|
"select_loser": "Verlierer:in wählen",
|
||||||
"selected_players": "Ausgewählte Spieler:innen",
|
"selected_players": "Ausgewählte Spieler:innen",
|
||||||
"settings": "Einstellungen",
|
"settings": "Einstellungen",
|
||||||
"single_loser": "Ein:e Verlierer:in",
|
"single_loser": "Ein:e Verlierer:in",
|
||||||
"single_winner": "Ein:e Gewinner:in",
|
"single_winner": "Ein:e Gewinner:in",
|
||||||
"highest_score": "Höchste Punkte",
|
"highest_score": "Höchste Punkte",
|
||||||
|
"loser": "Verlierer:in",
|
||||||
"lowest_score": "Niedrigste Punkte",
|
"lowest_score": "Niedrigste Punkte",
|
||||||
"multiple_winners": "Mehrere Gewinner:innen",
|
"multiple_winners": "Mehrere Gewinner:innen",
|
||||||
"statistics": "Statistiken",
|
"statistics": "Statistiken",
|
||||||
|
|||||||
@@ -83,6 +83,9 @@
|
|||||||
"@edit_match": {
|
"@edit_match": {
|
||||||
"description": "Button & Appbar label for editing a match"
|
"description": "Button & Appbar label for editing a match"
|
||||||
},
|
},
|
||||||
|
"@enter_points": {
|
||||||
|
"description": "Label to enter players points"
|
||||||
|
},
|
||||||
"@enter_results": {
|
"@enter_results": {
|
||||||
"description": "Button text to enter match results"
|
"description": "Button text to enter match results"
|
||||||
},
|
},
|
||||||
@@ -232,6 +235,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@points": {
|
||||||
|
"description": "Points label"
|
||||||
|
},
|
||||||
"@privacy_policy": {
|
"@privacy_policy": {
|
||||||
"description": "Privacy policy menu item"
|
"description": "Privacy policy menu item"
|
||||||
},
|
},
|
||||||
@@ -271,6 +277,9 @@
|
|||||||
"@select_winner": {
|
"@select_winner": {
|
||||||
"description": "Label to select the winner"
|
"description": "Label to select the winner"
|
||||||
},
|
},
|
||||||
|
"@select_loser": {
|
||||||
|
"description": "Label to select the loser"
|
||||||
|
},
|
||||||
"@selected_players": {
|
"@selected_players": {
|
||||||
"description": "Shows the number of selected players"
|
"description": "Shows the number of selected players"
|
||||||
},
|
},
|
||||||
@@ -351,6 +360,7 @@
|
|||||||
"delete_match": "Delete Match",
|
"delete_match": "Delete Match",
|
||||||
"edit_group": "Edit Group",
|
"edit_group": "Edit Group",
|
||||||
"edit_match": "Edit Match",
|
"edit_match": "Edit Match",
|
||||||
|
"enter_points": "Enter points",
|
||||||
"enter_results": "Enter Results",
|
"enter_results": "Enter Results",
|
||||||
"error_creating_group": "Error while creating group, please try again",
|
"error_creating_group": "Error while creating group, please try again",
|
||||||
"error_deleting_group": "Error while deleting group, please try again",
|
"error_deleting_group": "Error while deleting group, please try again",
|
||||||
@@ -399,6 +409,7 @@
|
|||||||
"player_name": "Player name",
|
"player_name": "Player name",
|
||||||
"players": "Players",
|
"players": "Players",
|
||||||
"players_count": "{count} Players",
|
"players_count": "{count} Players",
|
||||||
|
"points": "Points",
|
||||||
"privacy_policy": "Privacy Policy",
|
"privacy_policy": "Privacy Policy",
|
||||||
"quick_create": "Quick Create",
|
"quick_create": "Quick Create",
|
||||||
"recent_matches": "Recent Matches",
|
"recent_matches": "Recent Matches",
|
||||||
@@ -411,12 +422,14 @@
|
|||||||
"save_changes": "Save Changes",
|
"save_changes": "Save Changes",
|
||||||
"search_for_groups": "Search for groups",
|
"search_for_groups": "Search for groups",
|
||||||
"search_for_players": "Search for players",
|
"search_for_players": "Search for players",
|
||||||
"select_winner": "Select Winner:",
|
"select_winner": "Select Winner",
|
||||||
|
"select_loser": "Select Loser",
|
||||||
"selected_players": "Selected players",
|
"selected_players": "Selected players",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"single_loser": "Single Loser",
|
"single_loser": "Single Loser",
|
||||||
"single_winner": "Single Winner",
|
"single_winner": "Single Winner",
|
||||||
"highest_score": "Highest Score",
|
"highest_score": "Highest Score",
|
||||||
|
"loser": "Loser",
|
||||||
"lowest_score": "Lowest Score",
|
"lowest_score": "Lowest Score",
|
||||||
"multiple_winners": "Multiple Winners",
|
"multiple_winners": "Multiple Winners",
|
||||||
"statistics": "Statistics",
|
"statistics": "Statistics",
|
||||||
|
|||||||
@@ -254,6 +254,12 @@ abstract class AppLocalizations {
|
|||||||
/// **'Edit Match'**
|
/// **'Edit Match'**
|
||||||
String get edit_match;
|
String get edit_match;
|
||||||
|
|
||||||
|
/// Label to enter players points
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Enter points'**
|
||||||
|
String get enter_points;
|
||||||
|
|
||||||
/// Button text to enter match results
|
/// Button text to enter match results
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
@@ -542,6 +548,12 @@ abstract class AppLocalizations {
|
|||||||
/// **'{count} Players'**
|
/// **'{count} Players'**
|
||||||
String players_count(int count);
|
String players_count(int count);
|
||||||
|
|
||||||
|
/// Points label
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Points'**
|
||||||
|
String get points;
|
||||||
|
|
||||||
/// Privacy policy menu item
|
/// Privacy policy menu item
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
@@ -617,9 +629,15 @@ abstract class AppLocalizations {
|
|||||||
/// Label to select the winner
|
/// Label to select the winner
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'Select Winner:'**
|
/// **'Select Winner'**
|
||||||
String get select_winner;
|
String get select_winner;
|
||||||
|
|
||||||
|
/// Label to select the loser
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Select Loser'**
|
||||||
|
String get select_loser;
|
||||||
|
|
||||||
/// Shows the number of selected players
|
/// Shows the number of selected players
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
@@ -650,6 +668,12 @@ abstract class AppLocalizations {
|
|||||||
/// **'Highest Score'**
|
/// **'Highest Score'**
|
||||||
String get highest_score;
|
String get highest_score;
|
||||||
|
|
||||||
|
/// No description provided for @loser.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Loser'**
|
||||||
|
String get loser;
|
||||||
|
|
||||||
/// No description provided for @lowest_score.
|
/// No description provided for @lowest_score.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||||||
String get delete_all_data => 'Alle Daten löschen';
|
String get delete_all_data => 'Alle Daten löschen';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get delete_group => 'Diese Gruppe löschen';
|
String get delete_group => 'Gruppe löschen';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get delete_match => 'Spiel löschen';
|
String get delete_match => 'Spiel löschen';
|
||||||
@@ -90,6 +90,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get edit_match => 'Gruppe bearbeiten';
|
String get edit_match => 'Gruppe bearbeiten';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get enter_points => 'Punkte eingeben';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get enter_results => 'Ergebnisse eintragen';
|
String get enter_results => 'Ergebnisse eintragen';
|
||||||
|
|
||||||
@@ -240,6 +243,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||||||
return '$count Spieler';
|
return '$count Spieler';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get points => 'Punkte';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get privacy_policy => 'Datenschutzerklärung';
|
String get privacy_policy => 'Datenschutzerklärung';
|
||||||
|
|
||||||
@@ -281,7 +287,10 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||||||
String get search_for_players => 'Nach Spieler:innen suchen';
|
String get search_for_players => 'Nach Spieler:innen suchen';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get select_winner => 'Gewinner:in wählen:';
|
String get select_winner => 'Gewinner:in wählen';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get select_loser => 'Verlierer:in wählen';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get selected_players => 'Ausgewählte Spieler:innen';
|
String get selected_players => 'Ausgewählte Spieler:innen';
|
||||||
@@ -298,6 +307,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get highest_score => 'Höchste Punkte';
|
String get highest_score => 'Höchste Punkte';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get loser => 'Verlierer:in';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get lowest_score => 'Niedrigste Punkte';
|
String get lowest_score => 'Niedrigste Punkte';
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get edit_match => 'Edit Match';
|
String get edit_match => 'Edit Match';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get enter_points => 'Enter points';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get enter_results => 'Enter Results';
|
String get enter_results => 'Enter Results';
|
||||||
|
|
||||||
@@ -240,6 +243,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
return '$count Players';
|
return '$count Players';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get points => 'Points';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get privacy_policy => 'Privacy Policy';
|
String get privacy_policy => 'Privacy Policy';
|
||||||
|
|
||||||
@@ -281,7 +287,10 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
String get search_for_players => 'Search for players';
|
String get search_for_players => 'Search for players';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get select_winner => 'Select Winner:';
|
String get select_winner => 'Select Winner';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get select_loser => 'Select Loser';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get selected_players => 'Selected players';
|
String get selected_players => 'Selected players';
|
||||||
@@ -298,6 +307,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get highest_score => 'Highest Score';
|
String get highest_score => 'Highest Score';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get loser => 'Loser';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get lowest_score => 'Lowest Score';
|
String get lowest_score => 'Lowest Score';
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:tallee/core/adaptive_page_route.dart';
|
import 'package:tallee/core/adaptive_page_route.dart';
|
||||||
import 'package:tallee/core/common.dart';
|
import 'package:tallee/core/common.dart';
|
||||||
import 'package:tallee/core/custom_theme.dart';
|
import 'package:tallee/core/custom_theme.dart';
|
||||||
|
import 'package:tallee/core/enums.dart';
|
||||||
import 'package:tallee/data/db/database.dart';
|
import 'package:tallee/data/db/database.dart';
|
||||||
import 'package:tallee/data/models/match.dart';
|
import 'package:tallee/data/models/match.dart';
|
||||||
import 'package:tallee/l10n/generated/app_localizations.dart';
|
import 'package:tallee/l10n/generated/app_localizations.dart';
|
||||||
@@ -175,37 +176,7 @@ class _MatchDetailViewState extends State<MatchDetailView> {
|
|||||||
vertical: 4,
|
vertical: 4,
|
||||||
horizontal: 8,
|
horizontal: 8,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: getResultWidget(loc),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
/// TODO: Implement different ruleset results display
|
|
||||||
if (match.winner != null) ...[
|
|
||||||
Text(
|
|
||||||
loc.winner,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
color: CustomTheme.textColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
match.winner!.name,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: CustomTheme.primaryColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
] else ...[
|
|
||||||
Text(
|
|
||||||
loc.no_results_entered_yet,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: CustomTheme.textColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -264,4 +235,91 @@ class _MatchDetailViewState extends State<MatchDetailView> {
|
|||||||
});
|
});
|
||||||
widget.onMatchUpdate.call();
|
widget.onMatchUpdate.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the widget to be displayed in the result [InfoTile]
|
||||||
|
/// TODO: Update when score logic is overhauled
|
||||||
|
Widget getResultWidget(AppLocalizations loc) {
|
||||||
|
if (isSingleRowResult()) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: getResultRow(loc),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
for (var player in match.players)
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
player.name,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: CustomTheme.textColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'0 ${loc.points}',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: CustomTheme.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the result row for single winner/loser rulesets or a placeholder
|
||||||
|
/// if no result is entered yet
|
||||||
|
/// TODO: Update when score logic is overhauled
|
||||||
|
List<Widget> getResultRow(AppLocalizations loc) {
|
||||||
|
if (match.winner != null && match.game.ruleset == Ruleset.singleWinner) {
|
||||||
|
return [
|
||||||
|
Text(
|
||||||
|
loc.winner,
|
||||||
|
style: const TextStyle(fontSize: 16, color: CustomTheme.textColor),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
match.winner!.name,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: CustomTheme.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
} else if (match.game.ruleset == Ruleset.singleLoser) {
|
||||||
|
return [
|
||||||
|
Text(
|
||||||
|
loc.loser,
|
||||||
|
style: const TextStyle(fontSize: 16, color: CustomTheme.textColor),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
match.winner!.name,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: CustomTheme.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
Text(
|
||||||
|
loc.no_results_entered_yet,
|
||||||
|
style: const TextStyle(fontSize: 14, color: CustomTheme.textColor),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns if the result can be displayed in a single row
|
||||||
|
bool isSingleRowResult() {
|
||||||
|
return match.game.ruleset == Ruleset.singleWinner ||
|
||||||
|
match.game.ruleset == Ruleset.singleLoser;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,33 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tallee/core/custom_theme.dart';
|
import 'package:tallee/core/custom_theme.dart';
|
||||||
|
import 'package:tallee/core/enums.dart';
|
||||||
import 'package:tallee/data/db/database.dart';
|
import 'package:tallee/data/db/database.dart';
|
||||||
import 'package:tallee/data/models/match.dart';
|
import 'package:tallee/data/models/match.dart';
|
||||||
import 'package:tallee/data/models/player.dart';
|
import 'package:tallee/data/models/player.dart';
|
||||||
import 'package:tallee/l10n/generated/app_localizations.dart';
|
import 'package:tallee/l10n/generated/app_localizations.dart';
|
||||||
|
import 'package:tallee/presentation/widgets/buttons/custom_width_button.dart';
|
||||||
import 'package:tallee/presentation/widgets/tiles/custom_radio_list_tile.dart';
|
import 'package:tallee/presentation/widgets/tiles/custom_radio_list_tile.dart';
|
||||||
|
import 'package:tallee/presentation/widgets/tiles/score_list_tile.dart';
|
||||||
|
|
||||||
class MatchResultView extends StatefulWidget {
|
class MatchResultView extends StatefulWidget {
|
||||||
/// A view that allows selecting and saving the winner of a match
|
/// A view that allows selecting and saving the winner of a match
|
||||||
/// [match]: The match for which the winner is to be selected
|
/// [match]: The match for which the winner is to be selected
|
||||||
/// [onWinnerChanged]: Optional callback invoked when the winner is changed
|
/// [onWinnerChanged]: Optional callback invoked when the winner is changed
|
||||||
const MatchResultView({super.key, required this.match, this.onWinnerChanged});
|
const MatchResultView({
|
||||||
|
super.key,
|
||||||
|
required this.match,
|
||||||
|
this.ruleset = Ruleset.singleWinner,
|
||||||
|
this.onWinnerChanged,
|
||||||
|
});
|
||||||
|
|
||||||
/// The match for which the winner is to be selected
|
/// The match for which the winner is to be selected
|
||||||
final Match match;
|
final Match match;
|
||||||
|
|
||||||
|
/// The ruleset of the match, determines how the winner is selected or how
|
||||||
|
/// scores are entered
|
||||||
|
final Ruleset ruleset;
|
||||||
|
|
||||||
/// Optional callback invoked when the winner is changed
|
/// Optional callback invoked when the winner is changed
|
||||||
final VoidCallback? onWinnerChanged;
|
final VoidCallback? onWinnerChanged;
|
||||||
|
|
||||||
@@ -29,6 +41,9 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
/// List of all players who participated in the match
|
/// List of all players who participated in the match
|
||||||
late final List<Player> allPlayers;
|
late final List<Player> allPlayers;
|
||||||
|
|
||||||
|
/// List of text controllers for score entry, one for each player
|
||||||
|
late final List<TextEditingController> controller;
|
||||||
|
|
||||||
/// Currently selected winner player
|
/// Currently selected winner player
|
||||||
Player? _selectedPlayer;
|
Player? _selectedPlayer;
|
||||||
|
|
||||||
@@ -39,10 +54,19 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
allPlayers = widget.match.players;
|
allPlayers = widget.match.players;
|
||||||
allPlayers.sort((a, b) => a.name.compareTo(b.name));
|
allPlayers.sort((a, b) => a.name.compareTo(b.name));
|
||||||
|
|
||||||
|
controller = List.generate(
|
||||||
|
allPlayers.length,
|
||||||
|
(index) => TextEditingController(),
|
||||||
|
);
|
||||||
|
|
||||||
if (widget.match.winner != null) {
|
if (widget.match.winner != null) {
|
||||||
|
if (rulesetSupportsWinnerSelection()) {
|
||||||
_selectedPlayer = allPlayers.firstWhere(
|
_selectedPlayer = allPlayers.firstWhere(
|
||||||
(p) => p.id == widget.match.winner!.id,
|
(p) => p.id == widget.match.winner!.id,
|
||||||
);
|
);
|
||||||
|
} else if (rulesetSupportsScoreEntry()) {
|
||||||
|
/// TODO: Update when score logic is overhauled
|
||||||
|
}
|
||||||
}
|
}
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
@@ -50,6 +74,7 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final loc = AppLocalizations.of(context);
|
final loc = AppLocalizations.of(context);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: CustomTheme.backgroundColor,
|
backgroundColor: CustomTheme.backgroundColor,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
@@ -85,13 +110,14 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
loc.select_winner,
|
'${getTitleForRuleset(loc)}:',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
|
if (rulesetSupportsWinnerSelection())
|
||||||
Expanded(
|
Expanded(
|
||||||
child: RadioGroup<Player>(
|
child: RadioGroup<Player>(
|
||||||
groupValue: _selectedPlayer,
|
groupValue: _selectedPlayer,
|
||||||
@@ -99,7 +125,6 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_selectedPlayer = value;
|
_selectedPlayer = value;
|
||||||
});
|
});
|
||||||
await _handleWinnerSaving();
|
|
||||||
},
|
},
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: allPlayers.length,
|
itemCount: allPlayers.length,
|
||||||
@@ -118,17 +143,44 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
(_selectedPlayer = value);
|
(_selectedPlayer = value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
await _handleWinnerSaving();
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (rulesetSupportsScoreEntry())
|
||||||
|
Expanded(
|
||||||
|
child: ListView.separated(
|
||||||
|
itemCount: allPlayers.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
print(allPlayers[index].name);
|
||||||
|
return ScoreListTile(
|
||||||
|
text: allPlayers[index].name,
|
||||||
|
controller: controller[index],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 8.0),
|
||||||
|
child: Divider(indent: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
CustomWidthButton(
|
||||||
|
text: loc.save_changes,
|
||||||
|
sizeRelativeToWidth: 0.95,
|
||||||
|
onPressed: () async {
|
||||||
|
await _handleSaving();
|
||||||
|
if (!context.mounted) return;
|
||||||
|
Navigator.of(context).pop(_selectedPlayer);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -137,7 +189,20 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
|
|
||||||
/// Handles saving or removing the winner in the database
|
/// Handles saving or removing the winner in the database
|
||||||
/// based on the current selection.
|
/// based on the current selection.
|
||||||
Future<void> _handleWinnerSaving() async {
|
Future<void> _handleSaving() async {
|
||||||
|
if (widget.ruleset == Ruleset.singleWinner) {
|
||||||
|
await _handleWinner();
|
||||||
|
} else if (widget.ruleset == Ruleset.singleLoser) {
|
||||||
|
await _handleLoser();
|
||||||
|
} else if (widget.ruleset == Ruleset.lowestScore ||
|
||||||
|
widget.ruleset == Ruleset.highestScore) {
|
||||||
|
await _handleScores();
|
||||||
|
}
|
||||||
|
|
||||||
|
widget.onWinnerChanged?.call();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> _handleWinner() async {
|
||||||
if (_selectedPlayer == null) {
|
if (_selectedPlayer == null) {
|
||||||
await db.scoreEntryDao.removeWinner(matchId: widget.match.id);
|
await db.scoreEntryDao.removeWinner(matchId: widget.match.id);
|
||||||
} else {
|
} else {
|
||||||
@@ -146,6 +211,53 @@ class _MatchResultViewState extends State<MatchResultView> {
|
|||||||
playerId: _selectedPlayer!.id,
|
playerId: _selectedPlayer!.id,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
widget.onWinnerChanged?.call();
|
}
|
||||||
|
|
||||||
|
Future<bool> _handleLoser() async {
|
||||||
|
if (_selectedPlayer == null) {
|
||||||
|
/// TODO: Update when score logic is overhauled
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
/// TODO: Update when score logic is overhauled
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Handles saving the scores for each player in the database.
|
||||||
|
Future<bool> _handleScores() async {
|
||||||
|
for (int i = 0; i < allPlayers.length; i++) {
|
||||||
|
var text = controller[i].text;
|
||||||
|
if (text.isEmpty) {
|
||||||
|
text = '0';
|
||||||
|
}
|
||||||
|
final score = int.parse(text);
|
||||||
|
await db.playerMatchDao.updatePlayerScore(
|
||||||
|
matchId: widget.match.id,
|
||||||
|
playerId: allPlayers[i].id,
|
||||||
|
newScore: score,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getTitleForRuleset(AppLocalizations loc) {
|
||||||
|
switch (widget.ruleset) {
|
||||||
|
case Ruleset.singleWinner:
|
||||||
|
return loc.select_winner;
|
||||||
|
case Ruleset.singleLoser:
|
||||||
|
return loc.select_loser;
|
||||||
|
default:
|
||||||
|
return loc.enter_points;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rulesetSupportsWinnerSelection() {
|
||||||
|
return widget.ruleset == Ruleset.singleWinner ||
|
||||||
|
widget.ruleset == Ruleset.singleLoser;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rulesetSupportsScoreEntry() {
|
||||||
|
return widget.ruleset == Ruleset.lowestScore ||
|
||||||
|
widget.ruleset == Ruleset.highestScore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ const allDependencies = <Package>[
|
|||||||
_http_parser,
|
_http_parser,
|
||||||
_intl,
|
_intl,
|
||||||
_io,
|
_io,
|
||||||
|
_jni,
|
||||||
|
_jni_flutter,
|
||||||
_js,
|
_js,
|
||||||
_json_annotation,
|
_json_annotation,
|
||||||
_json_schema,
|
_json_schema,
|
||||||
@@ -360,13 +362,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// async 2.13.0
|
/// async 2.13.1
|
||||||
const _async = Package(
|
const _async = Package(
|
||||||
name: 'async',
|
name: 'async',
|
||||||
description: "Utility functions and classes related to the 'dart:async' library.",
|
description: "Utility functions and classes related to the 'dart:async' library.",
|
||||||
repository: 'https://github.com/dart-lang/core/tree/main/pkgs/async',
|
repository: 'https://github.com/dart-lang/core/tree/main/pkgs/async',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '2.13.0',
|
version: '2.13.1',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -442,13 +444,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// build 4.0.4
|
/// build 4.0.5
|
||||||
const _build = Package(
|
const _build = Package(
|
||||||
name: 'build',
|
name: 'build',
|
||||||
description: 'A package for authoring build_runner compatible code generators.',
|
description: 'A package for authoring build_runner compatible code generators.',
|
||||||
repository: 'https://github.com/dart-lang/build/tree/master/build',
|
repository: 'https://github.com/dart-lang/build/tree/master/build',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '4.0.4',
|
version: '4.0.5',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -565,13 +567,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// build_runner 2.12.2
|
/// build_runner 2.13.1
|
||||||
const _build_runner = Package(
|
const _build_runner = Package(
|
||||||
name: 'build_runner',
|
name: 'build_runner',
|
||||||
description: 'A build system for Dart code generation and modular compilation.',
|
description: 'A build system for Dart code generation and modular compilation.',
|
||||||
repository: 'https://github.com/dart-lang/build/tree/master/build_runner',
|
repository: 'https://github.com/dart-lang/build/tree/master/build_runner',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '2.12.2',
|
version: '2.13.1',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -649,14 +651,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// built_value 8.12.4
|
/// built_value 8.12.5
|
||||||
const _built_value = Package(
|
const _built_value = Package(
|
||||||
name: 'built_value',
|
name: 'built_value',
|
||||||
description: '''Value types with builders, Dart classes as enums, and serialization. This library is the runtime dependency.
|
description: '''Value types with builders, Dart classes as enums, and serialization. This library is the runtime dependency.
|
||||||
''',
|
''',
|
||||||
repository: 'https://github.com/google/built_value.dart/tree/master/built_value',
|
repository: 'https://github.com/google/built_value.dart/tree/master/built_value',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '8.12.4',
|
version: '8.12.5',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -1436,18 +1438,18 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// cupertino_icons 1.0.8
|
/// cupertino_icons 1.0.9
|
||||||
const _cupertino_icons = Package(
|
const _cupertino_icons = Package(
|
||||||
name: 'cupertino_icons',
|
name: 'cupertino_icons',
|
||||||
description: 'Default icons asset for Cupertino widgets based on Apple styled icons',
|
description: 'Default icons asset for Cupertino widgets based on Apple styled icons',
|
||||||
repository: 'https://github.com/flutter/packages/tree/main/third_party/packages/cupertino_icons',
|
repository: 'https://github.com/flutter/packages/tree/main/third_party/packages/cupertino_icons',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '1.0.8',
|
version: '1.0.9',
|
||||||
spdxIdentifiers: ['MIT'],
|
spdxIdentifiers: ['MIT'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
devDependencies: [PackageRef('flutter'), PackageRef('flutter_test')],
|
devDependencies: [PackageRef('collection'), PackageRef('flutter'), PackageRef('flutter_test'), PackageRef('path')],
|
||||||
license: '''The MIT License (MIT)
|
license: '''The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 Vladimir Kharlampidi
|
Copyright (c) 2016 Vladimir Kharlampidi
|
||||||
@@ -2627,13 +2629,13 @@ const _flutter_localizations = Package(
|
|||||||
devDependencies: [PackageRef('flutter_test')],
|
devDependencies: [PackageRef('flutter_test')],
|
||||||
);
|
);
|
||||||
|
|
||||||
/// flutter_plugin_android_lifecycle 2.0.33
|
/// flutter_plugin_android_lifecycle 2.0.34
|
||||||
const _flutter_plugin_android_lifecycle = Package(
|
const _flutter_plugin_android_lifecycle = Package(
|
||||||
name: 'flutter_plugin_android_lifecycle',
|
name: 'flutter_plugin_android_lifecycle',
|
||||||
description: 'Flutter plugin for accessing an Android Lifecycle within other plugins.',
|
description: 'Flutter plugin for accessing an Android Lifecycle within other plugins.',
|
||||||
repository: 'https://github.com/flutter/packages/tree/main/packages/flutter_plugin_android_lifecycle',
|
repository: 'https://github.com/flutter/packages/tree/main/packages/flutter_plugin_android_lifecycle',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '2.0.33',
|
version: '2.0.34',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -3173,6 +3175,88 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// jni 1.0.0
|
||||||
|
const _jni = Package(
|
||||||
|
name: 'jni',
|
||||||
|
description: 'A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen.',
|
||||||
|
repository: 'https://github.com/dart-lang/native/tree/main/pkgs/jni',
|
||||||
|
authors: [],
|
||||||
|
version: '1.0.0',
|
||||||
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
|
isMarkdown: false,
|
||||||
|
isSdk: false,
|
||||||
|
dependencies: [PackageRef('args'), PackageRef('collection'), PackageRef('ffi'), PackageRef('meta'), PackageRef('package_config'), PackageRef('path'), PackageRef('plugin_platform_interface')],
|
||||||
|
devDependencies: [PackageRef('dart_style'), PackageRef('logging'), PackageRef('test')],
|
||||||
|
license: '''Copyright 2022, the Dart project authors.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
* Neither the name of Google LLC nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
|
);
|
||||||
|
|
||||||
|
/// jni_flutter 1.0.1
|
||||||
|
const _jni_flutter = Package(
|
||||||
|
name: 'jni_flutter',
|
||||||
|
description: 'A library to access Flutter Android specific APIs from Dart.',
|
||||||
|
repository: 'https://github.com/dart-lang/native/tree/main/pkgs/jni_flutter',
|
||||||
|
authors: [],
|
||||||
|
version: '1.0.1',
|
||||||
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
|
isMarkdown: false,
|
||||||
|
isSdk: false,
|
||||||
|
dependencies: [PackageRef('flutter'), PackageRef('jni')],
|
||||||
|
devDependencies: [PackageRef('flutter_test')],
|
||||||
|
license: '''Copyright 2026, the Dart project authors.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
* Neither the name of Google LLC nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
|
);
|
||||||
|
|
||||||
/// js 0.7.2
|
/// js 0.7.2
|
||||||
const _js = Package(
|
const _js = Package(
|
||||||
name: 'js',
|
name: 'js',
|
||||||
@@ -3511,13 +3595,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// markdown 7.3.0
|
/// markdown 7.3.1
|
||||||
const _markdown = Package(
|
const _markdown = Package(
|
||||||
name: 'markdown',
|
name: 'markdown',
|
||||||
description: 'A portable Markdown library written in Dart that can parse Markdown into HTML.',
|
description: 'A portable Markdown library written in Dart that can parse Markdown into HTML.',
|
||||||
repository: 'https://github.com/dart-lang/tools/tree/main/pkgs/markdown',
|
repository: 'https://github.com/dart-lang/tools/tree/main/pkgs/markdown',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '7.3.0',
|
version: '7.3.1',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -3890,13 +3974,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// native_toolchain_c 0.17.5
|
/// native_toolchain_c 0.17.6
|
||||||
const _native_toolchain_c = Package(
|
const _native_toolchain_c = Package(
|
||||||
name: 'native_toolchain_c',
|
name: 'native_toolchain_c',
|
||||||
description: 'A library to invoke the native C compiler installed on the host machine.',
|
description: 'A library to invoke the native C compiler installed on the host machine.',
|
||||||
repository: 'https://github.com/dart-lang/native/tree/main/pkgs/native_toolchain_c',
|
repository: 'https://github.com/dart-lang/native/tree/main/pkgs/native_toolchain_c',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '0.17.5',
|
version: '0.17.6',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -4110,14 +4194,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// package_info_plus 9.0.0
|
/// package_info_plus 9.0.1
|
||||||
const _package_info_plus = Package(
|
const _package_info_plus = Package(
|
||||||
name: 'package_info_plus',
|
name: 'package_info_plus',
|
||||||
description: 'Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android.',
|
description: 'Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android.',
|
||||||
homepage: 'https://github.com/fluttercommunity/plus_plugins',
|
homepage: 'https://github.com/fluttercommunity/plus_plugins',
|
||||||
repository: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus/package_info_plus',
|
repository: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus/package_info_plus',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '9.0.0',
|
version: '9.0.1',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -4194,13 +4278,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// pana 0.23.10
|
/// pana 0.23.11
|
||||||
const _pana = Package(
|
const _pana = Package(
|
||||||
name: 'pana',
|
name: 'pana',
|
||||||
description: 'PAckage aNAlyzer - produce a report summarizing the health and quality of a Dart package.',
|
description: 'PAckage aNAlyzer - produce a report summarizing the health and quality of a Dart package.',
|
||||||
repository: 'https://github.com/dart-lang/pana',
|
repository: 'https://github.com/dart-lang/pana',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '0.23.10',
|
version: '0.23.11',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -4315,17 +4399,17 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// path_provider_android 2.2.22
|
/// path_provider_android 2.3.1
|
||||||
const _path_provider_android = Package(
|
const _path_provider_android = Package(
|
||||||
name: 'path_provider_android',
|
name: 'path_provider_android',
|
||||||
description: 'Android implementation of the path_provider plugin.',
|
description: 'Android implementation of the path_provider plugin.',
|
||||||
repository: 'https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android',
|
repository: 'https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '2.2.22',
|
version: '2.3.1',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
dependencies: [PackageRef('flutter'), PackageRef('path_provider_platform_interface')],
|
dependencies: [PackageRef('flutter'), PackageRef('jni'), PackageRef('jni_flutter'), PackageRef('path_provider_platform_interface')],
|
||||||
devDependencies: [PackageRef('flutter_test'), PackageRef('test')],
|
devDependencies: [PackageRef('flutter_test'), PackageRef('test')],
|
||||||
license: '''Copyright 2013 The Flutter Authors
|
license: '''Copyright 2013 The Flutter Authors
|
||||||
|
|
||||||
@@ -36119,13 +36203,13 @@ Copyright (C) 2009-2017, International Business Machines Corporation,
|
|||||||
Google, and others. All Rights Reserved.''',
|
Google, and others. All Rights Reserved.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// source_gen 4.2.0
|
/// source_gen 4.2.2
|
||||||
const _source_gen = Package(
|
const _source_gen = Package(
|
||||||
name: 'source_gen',
|
name: 'source_gen',
|
||||||
description: 'Source code generation builders and utilities for the Dart build system',
|
description: 'Source code generation builders and utilities for the Dart build system',
|
||||||
repository: 'https://github.com/dart-lang/source_gen/tree/master/source_gen',
|
repository: 'https://github.com/dart-lang/source_gen/tree/master/source_gen',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '4.2.0',
|
version: '4.2.2',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -36835,13 +36919,13 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// url_launcher_android 6.3.28
|
/// url_launcher_android 6.3.29
|
||||||
const _url_launcher_android = Package(
|
const _url_launcher_android = Package(
|
||||||
name: 'url_launcher_android',
|
name: 'url_launcher_android',
|
||||||
description: 'Android implementation of the url_launcher plugin.',
|
description: 'Android implementation of the url_launcher plugin.',
|
||||||
repository: 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android',
|
repository: 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '6.3.28',
|
version: '6.3.29',
|
||||||
spdxIdentifiers: ['BSD-3-Clause'],
|
spdxIdentifiers: ['BSD-3-Clause'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
@@ -37796,12 +37880,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.''',
|
SOFTWARE.''',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// tallee 0.0.19+253
|
/// tallee 0.0.20+254
|
||||||
const _tallee = Package(
|
const _tallee = Package(
|
||||||
name: 'tallee',
|
name: 'tallee',
|
||||||
description: 'Tracking App for Card Games',
|
description: 'Tracking App for Card Games',
|
||||||
authors: [],
|
authors: [],
|
||||||
version: '0.0.19+253',
|
version: '0.0.20+254',
|
||||||
spdxIdentifiers: ['LGPL-3.0'],
|
spdxIdentifiers: ['LGPL-3.0'],
|
||||||
isMarkdown: false,
|
isMarkdown: false,
|
||||||
isSdk: false,
|
isSdk: false,
|
||||||
|
|||||||
@@ -79,6 +79,24 @@ class _MatchTileState extends State<MatchTile> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: CustomTheme.primaryColor,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||||
|
child: Text(
|
||||||
|
translateRulesetToString(match.game.ruleset, context),
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
|
|
||||||
if (group != null) ...[
|
if (group != null) ...[
|
||||||
|
|||||||
91
lib/presentation/widgets/tiles/score_list_tile.dart
Normal file
91
lib/presentation/widgets/tiles/score_list_tile.dart
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:tallee/core/custom_theme.dart';
|
||||||
|
import 'package:tallee/l10n/generated/app_localizations.dart';
|
||||||
|
|
||||||
|
class ScoreListTile extends StatelessWidget {
|
||||||
|
/// A custom list tile widget that has a text field for inputting a score.
|
||||||
|
/// - [text]: The leading text to be displayed.
|
||||||
|
/// - [controller]: The controller for the text field to input the score.
|
||||||
|
const ScoreListTile({
|
||||||
|
super.key,
|
||||||
|
required this.text,
|
||||||
|
required this.controller,
|
||||||
|
/*
|
||||||
|
required this.onContainerTap,
|
||||||
|
*/
|
||||||
|
});
|
||||||
|
|
||||||
|
/// The text to display next to the radio button.
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
final TextEditingController controller;
|
||||||
|
|
||||||
|
/// The callback invoked when the container is tapped.
|
||||||
|
/*
|
||||||
|
final ValueChanged<T> onContainerTap;
|
||||||
|
*/
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final loc = AppLocalizations.of(context);
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
decoration: const BoxDecoration(color: CustomTheme.boxColor),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
text,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 100,
|
||||||
|
height: 40,
|
||||||
|
child: TextField(
|
||||||
|
controller: controller,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
maxLength: 4,
|
||||||
|
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: CustomTheme.textColor,
|
||||||
|
),
|
||||||
|
cursorColor: CustomTheme.textColor,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: loc.points,
|
||||||
|
counterText: '',
|
||||||
|
filled: true,
|
||||||
|
fillColor: CustomTheme.onBoxColor,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 0,
|
||||||
|
vertical: 0,
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: CustomTheme.textColor.withAlpha(100),
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: CustomTheme.primaryColor,
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
name: tallee
|
name: tallee
|
||||||
description: "Tracking App for Card Games"
|
description: "Tracking App for Card Games"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 0.0.19+253
|
version: 0.0.20+254
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.8.1
|
sdk: ^3.8.1
|
||||||
|
|||||||
Reference in New Issue
Block a user