made getters non nullable and removed all null assertion operators
This commit is contained in:
@@ -97,7 +97,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
|
||||
CustomSearchBar(
|
||||
controller: _searchBarController,
|
||||
constraints: const BoxConstraints(maxHeight: 45, minHeight: 45),
|
||||
hintText: AppLocalizations.of(context)!.search_for_players,
|
||||
hintText: AppLocalizations.of(context).search_for_players,
|
||||
trailingButtonShown: true,
|
||||
trailingButtonicon: Icons.add_circle,
|
||||
trailingButtonEnabled: _searchBarController.text.trim().isNotEmpty,
|
||||
@@ -141,7 +141,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
|
||||
child: selectedPlayers.isEmpty
|
||||
? Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.no_players_selected,
|
||||
AppLocalizations.of(context).no_players_selected,
|
||||
),
|
||||
)
|
||||
: SingleChildScrollView(
|
||||
@@ -185,7 +185,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.all_players,
|
||||
AppLocalizations.of(context).all_players,
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -199,11 +199,11 @@ class _PlayerSelectionState extends State<PlayerSelection> {
|
||||
visible: suggestedPlayers.isNotEmpty,
|
||||
replacement: TopCenteredMessage(
|
||||
icon: Icons.info,
|
||||
title: AppLocalizations.of(context)!.info,
|
||||
title: AppLocalizations.of(context).info,
|
||||
message: allPlayers.isEmpty
|
||||
? AppLocalizations.of(context)!.no_players_created_yet
|
||||
? AppLocalizations.of(context).no_players_created_yet
|
||||
: (selectedPlayers.length == allPlayers.length)
|
||||
? AppLocalizations.of(context)!.all_players_selected
|
||||
? AppLocalizations.of(context).all_players_selected
|
||||
: AppLocalizations.of(
|
||||
context,
|
||||
)!.no_players_found_with_that_name,
|
||||
@@ -276,7 +276,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
|
||||
backgroundColor: CustomTheme.boxColor,
|
||||
content: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.could_not_add_player(playerName),
|
||||
AppLocalizations.of(context).could_not_add_player(playerName),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -98,7 +98,7 @@ class _MatchTileState extends State<MatchTile> {
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.winner(winner.name),
|
||||
AppLocalizations.of(context).winner(winner.name),
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -115,7 +115,7 @@ class _MatchTileState extends State<MatchTile> {
|
||||
|
||||
if (allPlayers.isNotEmpty) ...[
|
||||
Text(
|
||||
AppLocalizations.of(context)!.players,
|
||||
AppLocalizations.of(context).players,
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.grey,
|
||||
@@ -150,7 +150,7 @@ class _MatchTileState extends State<MatchTile> {
|
||||
context,
|
||||
)!.yesterday_at(DateFormat('HH:mm').format(dateTime));
|
||||
} else if (difference.inDays < 7) {
|
||||
return AppLocalizations.of(context)!.days_ago(difference.inDays);
|
||||
return AppLocalizations.of(context).days_ago(difference.inDays);
|
||||
} else {
|
||||
return DateFormat('MMM d, yyyy').format(dateTime);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class StatisticsTile extends StatelessWidget {
|
||||
visible: values.isNotEmpty,
|
||||
replacement: Center(
|
||||
heightFactor: 4,
|
||||
child: Text(AppLocalizations.of(context)!.no_data_available),
|
||||
child: Text(AppLocalizations.of(context).no_data_available),
|
||||
),
|
||||
child: Column(
|
||||
children: List.generate(min(values.length, itemCount), (index) {
|
||||
|
||||
Reference in New Issue
Block a user