CreateGroupView erstellt #28

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

View File

@@ -1,16 +1,16 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
class IconListTile extends StatelessWidget {
class TextIconListTile 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;
final VoidCallback onPressed;
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 bool iconEnabled;
const IconListTile({
const TextIconListTile({
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,
required this.onPressed,
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
this.iconEnabled = true,
});
@override
@@ -28,13 +28,23 @@ class IconListTile extends StatelessWidget {
mainAxisSize: MainAxisSize.max,
children: [
Flexible(
child: Text(
text,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
child: Container(
padding: const EdgeInsets.symmetric(vertical: 12.5),
child: Text(
text,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
IconButton(icon: Icon(icon, size: 20), onPressed: onPressed),
if (iconEnabled)
IconButton(
icon: const Icon(Icons.add, size: 20),
onPressed: onPressed,
),
],
),
);

View File

@@ -3,14 +3,14 @@ import 'package:game_tracker/core/custom_theme.dart';
class TextIconTile extends StatelessWidget {
final String text;
final IconData? icon;
final bool iconEnabled;
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,
this.iconEnabled = true,
});
@override
@@ -25,7 +25,7 @@ class TextIconTile extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: [
if (icon != null) const SizedBox(width: 3),
if (iconEnabled) const SizedBox(width: 3),
Flexible(
child: Text(
text,
@@ -33,9 +33,12 @@ class TextIconTile extends StatelessWidget {
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
),
),
if (icon != null) ...<Widget>[
if (iconEnabled) ...<Widget>[
const SizedBox(width: 3),
GestureDetector(onTap: onIconTap, child: Icon(icon, size: 20)),
GestureDetector(
onTap: onIconTap,
child: const Icon(Icons.close, size: 20),
),
],
],
),