CreateGroupView erstellt #28

Merged
flixcoo merged 37 commits from feature/5-creategroupview-erstellen into development 2025-11-19 17:32:44 +00:00
4 changed files with 160 additions and 0 deletions
Showing only changes of commit 1882d0007b - Show all commits

View File

@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
class CustomSearchBar extends StatelessWidget {
final TextEditingController controller;
final String hintText;
final ValueChanged<String>? onChanged;
final BoxConstraints? constraints;
const CustomSearchBar({
super.key,
required this.controller,
required this.hintText,
this.onChanged,
this.constraints,
});
@override
Widget build(BuildContext context) {
return SearchBar(
controller: controller,
constraints:
constraints ?? const BoxConstraints(maxHeight: 45, minHeight: 45),
hintText: hintText,
onChanged: onChanged,
hintStyle: MaterialStateProperty.all(const TextStyle(fontSize: 16)),
sneeex marked this conversation as resolved Outdated

MaterialStateProperty ist deprecated

`MaterialStateProperty` ist deprecated
leading: const Icon(Icons.search),
backgroundColor: MaterialStateProperty.all(CustomTheme.boxColor),
sneeex marked this conversation as resolved Outdated

MaterialStateProperty ist deprecated

MaterialStateProperty ist deprecated
side: MaterialStateProperty.all(BorderSide(color: CustomTheme.boxBorder)),
sneeex marked this conversation as resolved Outdated

MaterialStateProperty ist deprecated

MaterialStateProperty ist deprecated
shape: MaterialStateProperty.all(
sneeex marked this conversation as resolved Outdated

MaterialStateProperty ist deprecated

MaterialStateProperty ist deprecated
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
),
elevation: MaterialStateProperty.all(0),
sneeex marked this conversation as resolved Outdated

MaterialStateProperty ist deprecated

MaterialStateProperty ist deprecated
);
}
}

View File

@@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
class TextInputField extends StatelessWidget {
final TextEditingController controller;
final ValueChanged<String>? onChanged;
final String hintText;
const TextInputField({
super.key,
required this.controller,
required this.hintText,
this.onChanged,
});
@override
Widget build(BuildContext context) {
return TextField(
controller: controller,
onChanged: onChanged,
decoration: InputDecoration(
filled: true,
fillColor: CustomTheme.boxColor,
hintText: hintText,
hintStyle: const TextStyle(fontSize: 18),
enabledBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(Radius.circular(12)),
borderSide: BorderSide(color: CustomTheme.boxBorder),
),
focusedBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(Radius.circular(12)),
borderSide: BorderSide(color: CustomTheme.boxBorder),
),
floatingLabelBehavior: FloatingLabelBehavior.never,
),
);
}
}

View File

@@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
class IconListTile extends StatelessWidget {
sneeex marked this conversation as resolved Outdated

Klassenname stimmt nicht mit Dateiname überein

Klassenname stimmt nicht mit Dateiname überein
final String text;
final IconData icon;
sneeex marked this conversation as resolved Outdated

Falls das Icon bisher nur ein Icon ist, ggf. nur das Icon deaktivierbar machen anstatt es komplett selbst zu setzen

Falls das Icon bisher nur ein Icon ist, ggf. nur das Icon deaktivierbar machen anstatt es komplett selbst zu setzen
final VoidCallback onPressed;
const IconListTile({
sneeex marked this conversation as resolved
Review

grafik.png

Alignment irgendwie komisch, Abstand vom Button zum Rand viel größer als vom Namen zum rand

![grafik.png](/attachments/a1c43803-f0d1-4a01-9ab5-e2e43c651ee5) Alignment irgendwie komisch, Abstand vom Button zum Rand viel größer als vom Namen zum rand
8.6 KiB
super.key,
required this.text,
required this.icon,
sneeex marked this conversation as resolved Outdated

onPressed sollte nich required sein wenn das icon nicht immer zu sehen ist

onPressed sollte nich required sein wenn das icon nicht immer zu sehen ist
required this.onPressed,
});
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
padding: const EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: CustomTheme.boxColor,
border: Border.all(color: CustomTheme.boxBorder),
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: [
Flexible(
child: Text(
text,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
),
),
IconButton(icon: Icon(icon, size: 20), onPressed: onPressed),
],
),
);
}
}

View File

@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
class TextIconTile extends StatelessWidget {
final String text;
final IconData? icon;
sneeex marked this conversation as resolved Outdated

Falls das Icon bisher nur ein Icon ist, ggf. nur das Icon deaktivierbar machen anstatt es komplett selbst zu setzen

Falls das Icon bisher nur ein Icon ist, ggf. nur das Icon deaktivierbar machen anstatt es komplett selbst zu setzen
final VoidCallback? onIconTap;
const TextIconTile({
super.key,
required this.text,
this.icon,
this.onIconTap,
});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(5),
decoration: BoxDecoration(
color: CustomTheme.onBoxColor,
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: [
if (icon != null) const SizedBox(width: 3),
Flexible(
child: Text(
text,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
),
),
if (icon != null) ...<Widget>[
const SizedBox(width: 3),
GestureDetector(onTap: onIconTap, child: Icon(icon, size: 20)),
],
],
),
);
}
}