Compare commits
3 Commits
236a737fd1
...
b4ccb567b5
| Author | SHA1 | Date | |
|---|---|---|---|
| b4ccb567b5 | |||
| bcd7bf751b | |||
| 4dbc106e38 |
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:game_tracker/core/custom_theme.dart';
|
||||
import 'package:game_tracker/core/enums.dart';
|
||||
import 'package:game_tracker/presentation/widgets/text_input/custom_search_bar.dart';
|
||||
import 'package:game_tracker/presentation/widgets/tiles/title_description_list_tile.dart';
|
||||
|
||||
class ChooseGameView extends StatefulWidget {
|
||||
@@ -19,6 +20,7 @@ class ChooseGameView extends StatefulWidget {
|
||||
|
||||
class _ChooseGameViewState extends State<ChooseGameView> {
|
||||
late int selectedGameIndex;
|
||||
final TextEditingController searchBarController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -39,8 +41,15 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: ListView.builder(
|
||||
padding: const EdgeInsets.only(bottom: 85),
|
||||
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(
|
||||
@@ -60,6 +69,9 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ class _CreateGameViewState extends State<CreateGameView> {
|
||||
|
||||
/// List of available rulesets with their display names and descriptions
|
||||
/// as tuples of (Ruleset, String, String)
|
||||
/// TODO: Replace when rulesets are implemented
|
||||
List<(Ruleset, String, String)> rulesets = [
|
||||
(
|
||||
Ruleset.singleWinner,
|
||||
@@ -84,9 +85,10 @@ class _CreateGameViewState extends State<CreateGameView> {
|
||||
),
|
||||
];
|
||||
|
||||
// TODO: Replace when games are implemented
|
||||
List<(String, String, Ruleset)> games = [
|
||||
('Cabo', 'A memory card game', Ruleset.leastPoints),
|
||||
('Uno', 'The Classic', Ruleset.singleWinner),
|
||||
('Example Game 1', 'This is a discription', Ruleset.leastPoints),
|
||||
('Example Game 2', '', Ruleset.singleWinner),
|
||||
];
|
||||
|
||||
@override
|
||||
|
||||
@@ -32,7 +32,7 @@ class TitleDescriptionListTile extends StatelessWidget {
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -70,10 +70,12 @@ class TitleDescriptionListTile extends StatelessWidget {
|
||||
],
|
||||
],
|
||||
),
|
||||
if (description.isNotEmpty) ...[
|
||||
const SizedBox(height: 5),
|
||||
Text(description, style: const TextStyle(fontSize: 14)),
|
||||
const SizedBox(height: 2.5),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user