Merge remote-tracking branch 'origin/development' into feature/118-bearbeiten-und-löschen-von-gruppen
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m7s
Pull Request Pipeline / lint (pull_request) Successful in 2m9s

# Conflicts:
#	pubspec.yaml
This commit is contained in:
2026-01-17 16:05:08 +01:00
12 changed files with 46 additions and 10 deletions

View File

@@ -221,7 +221,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
void loadPlayerList() {
_allPlayersFuture = Future.wait([
db.playerDao.getAllPlayers(),
Future.delayed(Constants.minimumSkeletonDuration),
Future.delayed(Constants.MINIMUM_SKELETON_DURATION),
]).then((results) => results[0] as List<Player>);
if (mounted) {
_allPlayersFuture.then((loadedPlayers) {

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/constants.dart';
import 'package:game_tracker/core/custom_theme.dart';
class CustomSearchBar extends StatelessWidget {
@@ -49,6 +50,15 @@ class CustomSearchBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
/// Enforce maximum length on the input text
const maxLength = Constants.MAX_PLAYER_NAME_LENGTH;
if (controller.text.length > maxLength) {
controller.text = controller.text.substring(0, maxLength);
controller.selection = TextSelection.fromPosition(
TextPosition(offset: controller.text.length),
);
}
return SearchBar(
controller: controller,
constraints:

View File

@@ -4,29 +4,35 @@ import 'package:game_tracker/core/custom_theme.dart';
class TextInputField extends StatelessWidget {
/// A custom text input field widget that encapsulates a [TextField] with specific styling.
/// - [controller]: The controller for the text input field.
/// - [onChanged]: The callback invoked when the text in the field changes.
/// - [onChanged]: Optional callback invoked when the text in the field changes.
/// - [hintText]: The hint text displayed in the text input field when it is empty
/// - [maxLength]: Optional parameter for maximum length of the input text.
const TextInputField({
super.key,
required this.controller,
required this.hintText,
this.onChanged,
this.maxLength,
});
/// The controller for the text input field.
final TextEditingController controller;
/// The callback invoked when the text in the field changes.
/// Optional callback invoked when the text in the field changes.
final ValueChanged<String>? onChanged;
/// The hint text displayed in the text input field when it is empty.
final String hintText;
/// Optional parameter for maximum length of the input text.
final int? maxLength;
@override
Widget build(BuildContext context) {
return TextField(
controller: controller,
onChanged: onChanged,
maxLength: maxLength,
decoration: InputDecoration(
filled: true,
fillColor: CustomTheme.boxColor,