made getters non nullable and removed all null assertion operators
This commit is contained in:
@@ -43,7 +43,7 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.choose_game,
|
||||
AppLocalizations.of(context).choose_game,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
centerTitle: true,
|
||||
@@ -54,7 +54,7 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: CustomSearchBar(
|
||||
controller: searchBarController,
|
||||
hintText: AppLocalizations.of(context)!.game_name,
|
||||
hintText: AppLocalizations.of(context).game_name,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
|
||||
@@ -52,7 +52,7 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.choose_group,
|
||||
AppLocalizations.of(context).choose_group,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
centerTitle: true,
|
||||
@@ -63,7 +63,7 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: CustomSearchBar(
|
||||
controller: controller,
|
||||
hintText: AppLocalizations.of(context)!.search_for_groups,
|
||||
hintText: AppLocalizations.of(context).search_for_groups,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
filterGroups(value);
|
||||
@@ -78,12 +78,12 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
visible: widget.groups.isNotEmpty,
|
||||
replacement: TopCenteredMessage(
|
||||
icon: Icons.info,
|
||||
title: AppLocalizations.of(context)!.info,
|
||||
message: AppLocalizations.of(context)!.no_groups_created_yet,
|
||||
title: AppLocalizations.of(context).info,
|
||||
message: AppLocalizations.of(context).no_groups_created_yet,
|
||||
),
|
||||
child: TopCenteredMessage(
|
||||
icon: Icons.info,
|
||||
title: AppLocalizations.of(context)!.info,
|
||||
title: AppLocalizations.of(context).info,
|
||||
message: AppLocalizations.of(
|
||||
context,
|
||||
)!.there_is_no_group_matching_your_search,
|
||||
|
||||
@@ -48,7 +48,7 @@ class _ChooseRulesetViewState extends State<ChooseRulesetView> {
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.choose_ruleset,
|
||||
AppLocalizations.of(context).choose_ruleset,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
centerTitle: true,
|
||||
|
||||
@@ -91,19 +91,19 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
||||
return [
|
||||
(
|
||||
Ruleset.singleWinner,
|
||||
AppLocalizations.of(context)!.ruleset_single_winner_desc,
|
||||
AppLocalizations.of(context).ruleset_single_winner_desc,
|
||||
),
|
||||
(
|
||||
Ruleset.singleLoser,
|
||||
AppLocalizations.of(context)!.ruleset_single_loser_desc,
|
||||
AppLocalizations.of(context).ruleset_single_loser_desc,
|
||||
),
|
||||
(
|
||||
Ruleset.mostPoints,
|
||||
AppLocalizations.of(context)!.ruleset_most_points_desc,
|
||||
AppLocalizations.of(context).ruleset_most_points_desc,
|
||||
),
|
||||
(
|
||||
Ruleset.leastPoints,
|
||||
AppLocalizations.of(context)!.ruleset_least_points_desc,
|
||||
AppLocalizations.of(context).ruleset_least_points_desc,
|
||||
),
|
||||
];
|
||||
}
|
||||
@@ -122,7 +122,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
||||
backgroundColor: CustomTheme.backgroundColor,
|
||||
scrolledUnderElevation: 0,
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.create_new_match,
|
||||
AppLocalizations.of(context).create_new_match,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
centerTitle: true,
|
||||
@@ -139,9 +139,9 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
||||
),
|
||||
),
|
||||
ChooseTile(
|
||||
title: AppLocalizations.of(context)!.game,
|
||||
title: AppLocalizations.of(context).game,
|
||||
trailingText: selectedGameIndex == -1
|
||||
? AppLocalizations.of(context)!.none
|
||||
? AppLocalizations.of(context).none
|
||||
: games[selectedGameIndex].$1,
|
||||
onPressed: () async {
|
||||
selectedGameIndex = await Navigator.of(context).push(
|
||||
@@ -167,9 +167,9 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
||||
},
|
||||
),
|
||||
ChooseTile(
|
||||
title: AppLocalizations.of(context)!.ruleset,
|
||||
title: AppLocalizations.of(context).ruleset,
|
||||
trailingText: selectedRuleset == null
|
||||
? AppLocalizations.of(context)!.none
|
||||
? AppLocalizations.of(context).none
|
||||
: translateRulesetToString(selectedRuleset!, context),
|
||||
onPressed: () async {
|
||||
final rulesets = _getRulesets(context);
|
||||
@@ -190,9 +190,9 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
||||
},
|
||||
),
|
||||
ChooseTile(
|
||||
title: AppLocalizations.of(context)!.group,
|
||||
title: AppLocalizations.of(context).group,
|
||||
trailingText: selectedGroup == null
|
||||
? AppLocalizations.of(context)!.none_group
|
||||
? AppLocalizations.of(context).none_group
|
||||
: selectedGroup!.name,
|
||||
onPressed: () async {
|
||||
selectedGroup = await Navigator.of(context).push(
|
||||
@@ -229,7 +229,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
||||
),
|
||||
),
|
||||
CustomWidthButton(
|
||||
text: AppLocalizations.of(context)!.create_match,
|
||||
text: AppLocalizations.of(context).create_match,
|
||||
sizeRelativeToWidth: 0.95,
|
||||
buttonType: ButtonType.primary,
|
||||
onPressed: _enableCreateGameButton()
|
||||
|
||||
Reference in New Issue
Block a user