Renamed folder & fixed gesture detector
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
import 'package:cabo_counter/data/game_session.dart';
|
||||||
|
|
||||||
class Globals {
|
class Globals {
|
||||||
static Map<int, GameSession> gamesMap = <int, GameSession>{};
|
static Map<int, GameSession> gamesMap = <int, GameSession>{};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
import 'package:cabo_counter/data/game_session.dart';
|
||||||
import 'package:cabo_counter/utility/theme.dart' as theme;
|
import 'package:cabo_counter/utility/theme.dart' as theme;
|
||||||
import 'package:cabo_counter/views/round_view.dart';
|
import 'package:cabo_counter/views/round_view.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@@ -70,7 +70,16 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
|||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: widget.gameSession.playerScores[0].length,
|
itemCount: widget.gameSession.playerScores[0].length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return GestureDetector(
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(1),
|
||||||
|
child: CupertinoListTile(
|
||||||
|
title: Text(
|
||||||
|
'Runde ${index + 1}',
|
||||||
|
),
|
||||||
|
trailing:
|
||||||
|
index + 1 == widget.gameSession.playerScores[0].length
|
||||||
|
? Text('⏳', style: TextStyle(fontSize: 22))
|
||||||
|
: Text('✅', style: TextStyle(fontSize: 22)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
@@ -82,14 +91,6 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: CupertinoListTile(
|
|
||||||
title: Text(
|
|
||||||
'Runde ${index + 1}',
|
|
||||||
),
|
|
||||||
trailing:
|
|
||||||
index + 1 == widget.gameSession.playerScores[0].length
|
|
||||||
? Text('⏳', style: TextStyle(fontSize: 22))
|
|
||||||
: Text('✅', style: TextStyle(fontSize: 22)),
|
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
import 'package:cabo_counter/data/game_session.dart';
|
||||||
import 'package:cabo_counter/utility/styles.dart';
|
import 'package:cabo_counter/utility/styles.dart';
|
||||||
import 'package:cabo_counter/views/active_game_view.dart';
|
import 'package:cabo_counter/views/active_game_view.dart';
|
||||||
import 'package:cabo_counter/views/mode_selection_view.dart';
|
import 'package:cabo_counter/views/mode_selection_view.dart';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
import 'package:cabo_counter/data/game_session.dart';
|
||||||
import 'package:cabo_counter/views/active_game_view.dart';
|
import 'package:cabo_counter/views/active_game_view.dart';
|
||||||
import 'package:cabo_counter/views/create_game_view.dart';
|
import 'package:cabo_counter/views/create_game_view.dart';
|
||||||
import 'package:cabo_counter/views/information_view.dart';
|
import 'package:cabo_counter/views/information_view.dart';
|
||||||
@@ -73,21 +73,18 @@ class _MainMenuViewState extends State<MainMenuView> {
|
|||||||
itemCount: gameSessionArray.length,
|
itemCount: gameSessionArray.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final session = gameSessionArray[index];
|
final session = gameSessionArray[index];
|
||||||
return GestureDetector(
|
return Padding(
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||||
child: CupertinoListTile(
|
child: CupertinoListTile(
|
||||||
title: Text(session.gameTitle),
|
title: Text(session.gameTitle),
|
||||||
leading: session.gameMode.toInt() == 0
|
subtitle:
|
||||||
? Icon(CupertinoIcons.hare_fill)
|
Text('Modus: ${_translateGameMode(session.gameMode)}'),
|
||||||
: Icon(CupertinoIcons.time_solid),
|
|
||||||
subtitle: Text('Gewinner*in: ${session.winner}'),
|
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
children: [
|
children: [
|
||||||
Text('${session.round}'),
|
Text('${session.round}'),
|
||||||
SizedBox(width: 3),
|
SizedBox(width: 3),
|
||||||
Icon(CupertinoIcons.arrow_2_circlepath_circle_fill),
|
Icon(CupertinoIcons.arrow_2_circlepath_circle_fill),
|
||||||
SizedBox(width: 6),
|
SizedBox(width: 15),
|
||||||
Text('${session.players.length}'),
|
Text('${session.players.length}'),
|
||||||
SizedBox(width: 3),
|
SizedBox(width: 3),
|
||||||
Icon(CupertinoIcons.person_2_fill),
|
Icon(CupertinoIcons.person_2_fill),
|
||||||
@@ -102,7 +99,7 @@ class _MainMenuViewState extends State<MainMenuView> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
)));
|
));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -110,6 +107,17 @@ class _MainMenuViewState extends State<MainMenuView> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _translateGameMode(int gameMode) {
|
||||||
|
switch (gameMode) {
|
||||||
|
case 0:
|
||||||
|
return '101 Punkte';
|
||||||
|
case 1:
|
||||||
|
return 'Unendlich';
|
||||||
|
default:
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void randomizeRoundNumbers() {
|
void randomizeRoundNumbers() {
|
||||||
var random = Random();
|
var random = Random();
|
||||||
for (var s in gameSessionArray) {
|
for (var s in gameSessionArray) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
import 'package:cabo_counter/data/game_session.dart';
|
||||||
import 'package:cabo_counter/utility/theme.dart' as theme;
|
import 'package:cabo_counter/utility/theme.dart' as theme;
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|||||||
Reference in New Issue
Block a user