CreateGameView erstellen #67
@@ -35,42 +35,50 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
||||
appBar: AppBar(
|
||||
backgroundColor: CustomTheme.backgroundColor,
|
||||
scrolledUnderElevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios),
|
||||
onPressed: () {
|
||||
Navigator.of(
|
||||
context,
|
||||
).pop(selectedGameIndex == -1 ? null : selectedGameIndex);
|
||||
},
|
||||
),
|
||||
title: const Text(
|
||||
'Choose Game',
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
CustomSearchBar(
|
||||
controller: searchBarController,
|
||||
hintText: 'Game Name',
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: widget.games.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return TitleDescriptionListTile(
|
||||
title: widget.games[index].$1,
|
||||
description: widget.games[index].$2,
|
||||
badgeText: translateRulesetToString(widget.games[index].$3),
|
||||
isHighlighted: selectedGameIndex == index,
|
||||
onPressed: () async {
|
||||
setState(() {
|
||||
selectedGameIndex = index;
|
||||
});
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
if (!context.mounted) return;
|
||||
Navigator.of(context).pop(selectedGameIndex);
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
body: Container(
|
||||
decoration: CustomTheme.standardBoxDecoration,
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
CustomSearchBar(
|
||||
controller: searchBarController,
|
||||
hintText: 'Game Name',
|
||||
|
flixcoo marked this conversation as resolved
Outdated
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 5),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: widget.games.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return TitleDescriptionListTile(
|
||||
title: widget.games[index].$1,
|
||||
description: widget.games[index].$2,
|
||||
badgeText: translateRulesetToString(widget.games[index].$3),
|
||||
isHighlighted: selectedGameIndex == index,
|
||||
onPressed: () async {
|
||||
setState(() {
|
||||
selectedGameIndex = index;
|
||||
});
|
||||
|
flixcoo marked this conversation as resolved
Outdated
sneeex
commented
warum ist unselecten hier nicht implementiert, beim choose group view aber schon? warum ist unselecten hier nicht implementiert, beim choose group view aber schon?
flixcoo
commented
ups, vergessen ups, vergessen
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,16 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
appBar: AppBar(
|
||||
backgroundColor: CustomTheme.backgroundColor,
|
||||
scrolledUnderElevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(
|
||||
selectedGroupIndex == -1
|
||||
? null
|
||||
: widget.groups[selectedGroupIndex],
|
||||
);
|
||||
},
|
||||
),
|
||||
title: const Text(
|
||||
'Choose Group',
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
@@ -46,12 +56,11 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
return GestureDetector(
|
||||
|
flixcoo marked this conversation as resolved
sneeex
commented
Warum lässt sich in Choose Game View suchen, im Choose Group View aber nicht? Können beides ja potenziell sehr lange Listen sein Warum lässt sich in Choose Game View suchen, im Choose Group View aber nicht? Können beides ja potenziell sehr lange Listen sein
flixcoo
commented
Erledigt (So würde dass dann auch für die Games funktionieren) Erledigt (So würde dass dann auch für die Games funktionieren)
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedGroupIndex = index;
|
||||
});
|
||||
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
if (!context.mounted) return;
|
||||
Navigator.of(context).pop(widget.groups[index]);
|
||||
if (selectedGroupIndex == index) {
|
||||
selectedGroupIndex = -1;
|
||||
} else {
|
||||
selectedGroupIndex = index;
|
||||
}
|
||||
});
|
||||
},
|
||||
child: GroupTile(
|
||||
|
||||
@@ -36,6 +36,16 @@ class _ChooseRulesetViewState extends State<ChooseRulesetView> {
|
||||
appBar: AppBar(
|
||||
backgroundColor: CustomTheme.backgroundColor,
|
||||
scrolledUnderElevation: 0,
|
||||
leading: IconButton(
|
||||
|
sneeex marked this conversation as resolved
Outdated
sneeex
commented
Macht keinen Sinn, da gametype und rulesets ausgewählt werden können Macht keinen Sinn, da gametype und rulesets ausgewählt werden können
flixcoo
commented
Habs jetzt zu Habs jetzt zu `Choose Ruleset` geändert, da man mit den Gametypes ja auch im Prinzip nur n Ruleset festlegt
|
||||
icon: const Icon(Icons.arrow_back_ios),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(
|
||||
selectedRulesetIndex == -1
|
||||
? null
|
||||
: widget.rulesets[selectedRulesetIndex].$1,
|
||||
);
|
||||
},
|
||||
),
|
||||
title: const Text(
|
||||
'Choose Ruleset',
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
|
sneeex marked this conversation as resolved
Outdated
sneeex
commented
warum so viele comments? ist doch klar wofür die settings jeweils sind, also label indicator, divider etc warum so viele comments? ist doch klar wofür die settings jeweils sind, also label indicator, divider etc
flixcoo
commented
Wollte das einfach bisschen klarer aufteilen Wollte das einfach bisschen klarer aufteilen
|
||||
@@ -49,11 +59,11 @@ class _ChooseRulesetViewState extends State<ChooseRulesetView> {
|
||||
return TitleDescriptionListTile(
|
||||
onPressed: () async {
|
||||
setState(() {
|
||||
selectedRulesetIndex = index;
|
||||
});
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
if (!context.mounted) return;
|
||||
Navigator.of(context).pop(widget.rulesets[index].$1);
|
||||
if (selectedRulesetIndex == index) {
|
||||
selectedRulesetIndex = -1;
|
||||
} else {
|
||||
selectedRulesetIndex = index;
|
||||
}
|
||||
});
|
||||
},
|
||||
title: widget.rulesets[index].$2,
|
||||
|
||||
Reference in New Issue
Block a user
Es ist kein OnChanged implementiert, die search functionality ist insgesamt nicht gegeben hier.
Note: Das onChanged sollte aber vllt. auch required sein in der CustomSearchBar (weiß gerade nicht ob ich das aus nem grund optional gelassen habe, macht aber ja glaube keinen sinn oder?)
Also ich habs explizit weggelassen, weil ich der einfachhalt halber das aktuell ausgesuchte Spiel über einen Index markiere. Wenn ich das jetzt implementieren würde, müsste ich dass unnötig kompliziert implementieren, weil die Games am Ende eh eine ID haben über die ich das markierte Identifizieren kann, deswegen würd ich das an dieser Stelle weglassen
dann mach die searchbar weg, entweder searchbar und functionality oder nicht, aber nicht so halbe sachen.
Ja aber das ist ja auch kacke, das layout an sich soll ja schon stehen
dann mach die functionality rein, entweder oder.
Du hast ja nur kein bock