CreateGameView erstellen #67
@@ -35,13 +35,24 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: CustomTheme.backgroundColor,
|
backgroundColor: CustomTheme.backgroundColor,
|
||||||
scrolledUnderElevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
|
leading: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back_ios),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(
|
||||||
|
context,
|
||||||
|
).pop(selectedGameIndex == -1 ? null : selectedGameIndex);
|
||||||
|
},
|
||||||
|
),
|
||||||
title: const Text(
|
title: const Text(
|
||||||
'Choose Game',
|
'Choose Game',
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Container(
|
||||||
|
decoration: CustomTheme.standardBoxDecoration,
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CustomSearchBar(
|
CustomSearchBar(
|
||||||
controller: searchBarController,
|
controller: searchBarController,
|
||||||
@@ -61,10 +72,6 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
selectedGameIndex = index;
|
selectedGameIndex = index;
|
||||||
});
|
});
|
||||||
Future.delayed(const Duration(milliseconds: 500), () {
|
|
||||||
if (!context.mounted) return;
|
|
||||||
Navigator.of(context).pop(selectedGameIndex);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -72,6 +79,7 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,16 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: CustomTheme.backgroundColor,
|
backgroundColor: CustomTheme.backgroundColor,
|
||||||
scrolledUnderElevation: 0,
|
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(
|
title: const Text(
|
||||||
'Choose Group',
|
'Choose Group',
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||||
@@ -46,12 +56,11 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
|
flixcoo marked this conversation as resolved
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
if (selectedGroupIndex == index) {
|
||||||
|
selectedGroupIndex = -1;
|
||||||
|
} else {
|
||||||
selectedGroupIndex = index;
|
selectedGroupIndex = index;
|
||||||
});
|
}
|
||||||
|
|
||||||
Future.delayed(const Duration(milliseconds: 500), () {
|
|
||||||
if (!context.mounted) return;
|
|
||||||
Navigator.of(context).pop(widget.groups[index]);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: GroupTile(
|
child: GroupTile(
|
||||||
|
|||||||
@@ -36,6 +36,16 @@ class _ChooseRulesetViewState extends State<ChooseRulesetView> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: CustomTheme.backgroundColor,
|
backgroundColor: CustomTheme.backgroundColor,
|
||||||
scrolledUnderElevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
|
leading: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back_ios),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop(
|
||||||
|
selectedRulesetIndex == -1
|
||||||
|
? null
|
||||||
|
: widget.rulesets[selectedRulesetIndex].$1,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
title: const Text(
|
title: const Text(
|
||||||
'Choose Ruleset',
|
'Choose Ruleset',
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||||
@@ -49,11 +59,11 @@ class _ChooseRulesetViewState extends State<ChooseRulesetView> {
|
|||||||
return TitleDescriptionListTile(
|
return TitleDescriptionListTile(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
if (selectedRulesetIndex == index) {
|
||||||
|
selectedRulesetIndex = -1;
|
||||||
|
} else {
|
||||||
selectedRulesetIndex = index;
|
selectedRulesetIndex = index;
|
||||||
});
|
}
|
||||||
Future.delayed(const Duration(milliseconds: 500), () {
|
|
||||||
if (!context.mounted) return;
|
|
||||||
Navigator.of(context).pop(widget.rulesets[index].$1);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: widget.rulesets[index].$2,
|
title: widget.rulesets[index].$2,
|
||||||
|
|||||||
Reference in New Issue
Block a user
Warum lässt sich in Choose Game View suchen, im Choose Group View aber nicht? Können beides ja potenziell sehr lange Listen sein
Erledigt (So würde dass dann auch für die Games funktionieren)