Compare commits
2 Commits
527f163346
...
10aad47124
| Author | SHA1 | Date | |
|---|---|---|---|
| 10aad47124 | |||
| 75b62d0854 |
@@ -35,42 +35,50 @@ 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(
|
||||||
children: [
|
decoration: CustomTheme.standardBoxDecoration,
|
||||||
CustomSearchBar(
|
padding: const EdgeInsets.all(10),
|
||||||
controller: searchBarController,
|
child: Column(
|
||||||
hintText: 'Game Name',
|
children: [
|
||||||
),
|
CustomSearchBar(
|
||||||
const SizedBox(height: 5),
|
controller: searchBarController,
|
||||||
Expanded(
|
hintText: 'Game Name',
|
||||||
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);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
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;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedGroupIndex = index;
|
if (selectedGroupIndex == index) {
|
||||||
});
|
selectedGroupIndex = -1;
|
||||||
|
} else {
|
||||||
Future.delayed(const Duration(milliseconds: 500), () {
|
selectedGroupIndex = index;
|
||||||
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(() {
|
||||||
selectedRulesetIndex = index;
|
if (selectedRulesetIndex == index) {
|
||||||
});
|
selectedRulesetIndex = -1;
|
||||||
Future.delayed(const Duration(milliseconds: 500), () {
|
} else {
|
||||||
if (!context.mounted) return;
|
selectedRulesetIndex = index;
|
||||||
Navigator.of(context).pop(widget.rulesets[index].$1);
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: widget.rulesets[index].$2,
|
title: widget.rulesets[index].$2,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import 'package:game_tracker/data/db/database.dart';
|
|||||||
import 'package:game_tracker/data/dto/game.dart';
|
import 'package:game_tracker/data/dto/game.dart';
|
||||||
import 'package:game_tracker/data/dto/group.dart';
|
import 'package:game_tracker/data/dto/group.dart';
|
||||||
import 'package:game_tracker/data/dto/player.dart';
|
import 'package:game_tracker/data/dto/player.dart';
|
||||||
import 'package:game_tracker/presentation/views/main_menu/create_group_view.dart';
|
import 'package:game_tracker/presentation/views/main_menu/create_game/create_game_view.dart';
|
||||||
import 'package:game_tracker/presentation/views/main_menu/game_result_view.dart';
|
import 'package:game_tracker/presentation/views/main_menu/game_result_view.dart';
|
||||||
import 'package:game_tracker/presentation/widgets/app_skeleton.dart';
|
import 'package:game_tracker/presentation/widgets/app_skeleton.dart';
|
||||||
import 'package:game_tracker/presentation/widgets/buttons/custom_width_button.dart';
|
import 'package:game_tracker/presentation/widgets/buttons/custom_width_button.dart';
|
||||||
@@ -133,7 +133,7 @@ class _GameHistoryViewState extends State<GameHistoryView> {
|
|||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return const CreateGroupView();
|
return const CreateGameView();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user