Merge branch 'bug/37-getallgames-returnt-nicht-alle-attribute-von-der-game-klasse' into feature/31-json-import-fuer-testdaten
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m4s
Pull Request Pipeline / lint (pull_request) Successful in 2m6s

This commit is contained in:
2025-11-20 22:41:14 +01:00
5 changed files with 169 additions and 52 deletions

View File

@@ -6,11 +6,19 @@ class CustomSearchBar extends StatelessWidget {
final String hintText;
final ValueChanged<String>? onChanged;
final BoxConstraints? constraints;
final bool trailingButtonShown;
final bool trailingButtonEnabled;
final VoidCallback? onTrailingButtonPressed;
final IconData trailingButtonicon;
const CustomSearchBar({
super.key,
required this.controller,
required this.hintText,
this.trailingButtonShown = false,
this.trailingButtonicon = Icons.clear,
this.trailingButtonEnabled = true,
this.onTrailingButtonPressed,
this.onChanged,
this.constraints,
});
@@ -22,9 +30,24 @@ class CustomSearchBar extends StatelessWidget {
constraints:
constraints ?? const BoxConstraints(maxHeight: 45, minHeight: 45),
hintText: hintText,
onChanged: onChanged,
onChanged: trailingButtonEnabled ? onChanged : null,
hintStyle: WidgetStateProperty.all(const TextStyle(fontSize: 16)),
leading: const Icon(Icons.search),
trailing: [
Visibility(
visible: trailingButtonShown,
child: GestureDetector(
onTap: trailingButtonEnabled ? onTrailingButtonPressed : null,
child: Icon(
trailingButtonicon,
color: trailingButtonEnabled
? null
: Colors.grey.withValues(alpha: 0.2),
),
),
),
const SizedBox(width: 5),
],
backgroundColor: WidgetStateProperty.all(CustomTheme.boxColor),
side: WidgetStateProperty.all(BorderSide(color: CustomTheme.boxBorder)),
shape: WidgetStateProperty.all(