Some last changes
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m16s
Pull Request Pipeline / lint (pull_request) Successful in 2m21s

This commit is contained in:
2025-12-30 21:22:07 +01:00
parent 58fe38fd72
commit 5428064c53

View File

@@ -29,7 +29,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
late final AppDatabase db;
/// Controller for the match name input field
final TextEditingController _gameNameController = TextEditingController();
final TextEditingController _matchNameController = TextEditingController();
/// List of all groups from the database
List<Group> groupsList = [];
@@ -95,7 +95,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
@override
void initState() {
super.initState();
_gameNameController.addListener(() {
_matchNameController.addListener(() {
setState(() {});
});
@@ -119,7 +119,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
backgroundColor: CustomTheme.backgroundColor,
scrolledUnderElevation: 0,
title: const Text(
'Create new game',
'Create new match',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
centerTitle: true,
@@ -131,7 +131,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
Container(
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
child: TextInputField(
controller: _gameNameController,
controller: _matchNameController,
hintText: 'Match name',
),
),
@@ -222,13 +222,13 @@ class _CreateMatchViewState extends State<CreateMatchView> {
),
),
CustomWidthButton(
text: 'Create game',
text: 'Create match',
sizeRelativeToWidth: 0.95,
buttonType: ButtonType.primary,
onPressed: _enableCreateGameButton()
? () async {
Match match = Match(
name: _gameNameController.text.trim(),
name: _matchNameController.text.trim(),
createdAt: DateTime.now(),
group: selectedGroup,
players: selectedPlayers,
@@ -258,7 +258,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
/// Determines whether the "Create Game" button should be enabled based on
/// the current state of the input fields.
bool _enableCreateGameButton() {
return _gameNameController.text.isNotEmpty &&
return _matchNameController.text.isNotEmpty &&
(selectedGroup != null ||
(selectedPlayers != null && selectedPlayers!.length > 1)) &&
selectedRuleset != null;