initial commit
This commit is contained in:
20
lib/app.dart
Normal file
20
lib/app.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:cabo_counter/utility/styles.dart';
|
||||
import 'package:cabo_counter/views/main_menu_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class App extends StatelessWidget {
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoApp(
|
||||
theme: CupertinoThemeData(
|
||||
primaryColor: Styles.primaryColor,
|
||||
textTheme: CupertinoTextThemeData(
|
||||
primaryColor: Styles.primaryColor,
|
||||
)),
|
||||
home: MainMenuView(),
|
||||
debugShowCheckedModeBanner: false,
|
||||
);
|
||||
}
|
||||
}
|
||||
38
lib/data_classes/game_session.dart
Normal file
38
lib/data_classes/game_session.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
class GameSession {
|
||||
final String gameTitle;
|
||||
final List<String> players;
|
||||
final int gameMode;
|
||||
int round = 1;
|
||||
String? winner;
|
||||
|
||||
GameSession({
|
||||
required this.gameTitle,
|
||||
required this.players,
|
||||
required this.winner,
|
||||
required this.gameMode,
|
||||
});
|
||||
List<List<int>> playerScores = [
|
||||
[7, 1, 4, 2],
|
||||
[7, 0, 3, 4],
|
||||
[5, 5, 0, 0],
|
||||
[10, 3, 3, 2]
|
||||
];
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
print('GameSession: [gameTitle: $gameTitle, '
|
||||
'players: $players, winner: $winner, '
|
||||
'round: $round, gameMode: $gameMode, '
|
||||
'playerScores: $playerScores]');
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
void sumPoints() {
|
||||
for (int i = 0; i < playerScores.length; i++) {
|
||||
playerScores[i][0] = 0;
|
||||
for (int j = 1; j < playerScores[i].length; i++) {
|
||||
playerScores[i][0] += playerScores[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
lib/main.dart
Normal file
6
lib/main.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
import 'package:cabo_counter/app.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const App());
|
||||
}
|
||||
5
lib/utility/globals.dart
Normal file
5
lib/utility/globals.dart
Normal file
@@ -0,0 +1,5 @@
|
||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
||||
|
||||
class Globals {
|
||||
static Map<int, GameSession> gamesMap = <int, GameSession>{};
|
||||
}
|
||||
21
lib/utility/styles.dart
Normal file
21
lib/utility/styles.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
abstract class Styles {
|
||||
static Color primaryColor = CupertinoColors.systemGreen;
|
||||
|
||||
static TextStyle modeTitle = TextStyle(
|
||||
color: primaryColor,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
|
||||
static const TextStyle modeDescription = TextStyle(
|
||||
fontSize: 16,
|
||||
);
|
||||
|
||||
static TextStyle createGameTitle = TextStyle(
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
}
|
||||
130
lib/views/active_game_view.dart
Normal file
130
lib/views/active_game_view.dart
Normal file
@@ -0,0 +1,130 @@
|
||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
||||
import 'package:cabo_counter/utility/styles.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class ActiveGameView extends StatefulWidget {
|
||||
final GameSession gameSession;
|
||||
const ActiveGameView({super.key, required this.gameSession});
|
||||
|
||||
@override
|
||||
// ignore: library_private_types_in_public_api
|
||||
_ActiveGameViewState createState() => _ActiveGameViewState();
|
||||
}
|
||||
|
||||
class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
List<int> sortedPlayerIndices = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
sortedPlayerIndices = _getSortedPlayerIndices();
|
||||
print('Aktuelle Runde: ${widget.gameSession.playerScores[0].length}');
|
||||
print('playerScores: ${widget.gameSession.playerScores}');
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text(widget.gameSession.gameTitle),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spieler:innen',
|
||||
style: Styles.createGameTitle,
|
||||
),
|
||||
),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: widget.gameSession.players.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
int playerIndex = sortedPlayerIndices[index];
|
||||
return CupertinoListTile(
|
||||
title: Row(
|
||||
children: [
|
||||
_getPlayerPlacement(index),
|
||||
SizedBox(width: 5),
|
||||
Text(
|
||||
widget.gameSession.players[playerIndex],
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
trailing: Row(
|
||||
children: [
|
||||
SizedBox(width: 5),
|
||||
Text(
|
||||
'${widget.gameSession.playerScores[playerIndex][0]} Punkte')
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Runden',
|
||||
style: Styles.createGameTitle,
|
||||
),
|
||||
),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: widget.gameSession.playerScores[0].length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return CupertinoListTile(
|
||||
title: Text(
|
||||
'Runde ${index + 1}',
|
||||
),
|
||||
trailing:
|
||||
index + 1 == widget.gameSession.playerScores[0].length
|
||||
? Text('⏳', style: TextStyle(fontSize: 22))
|
||||
: Text('✅', style: TextStyle(fontSize: 22)),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<int> _getSortedPlayerIndices() {
|
||||
// Erstelle eine Liste von Indizes der Spieler
|
||||
List<int> playerIndices =
|
||||
List<int>.generate(widget.gameSession.players.length, (index) => index);
|
||||
print('playerIndices: $playerIndices');
|
||||
// Sortiere die Indizes basierend auf den summierten Punkten (playerScores[i][0])
|
||||
playerIndices.sort((a, b) {
|
||||
int scoreA = widget.gameSession.playerScores[a][0];
|
||||
int scoreB = widget.gameSession.playerScores[b][0];
|
||||
return scoreB.compareTo(scoreA); // Absteigende Sortierung
|
||||
});
|
||||
print('playerIndices sortiert: $playerIndices');
|
||||
return playerIndices;
|
||||
}
|
||||
|
||||
Widget _getPlayerPlacement(int index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return Text(
|
||||
'🥇',
|
||||
style: TextStyle(fontSize: 22),
|
||||
);
|
||||
case 1:
|
||||
return Text(
|
||||
'🥈',
|
||||
style: TextStyle(fontSize: 22),
|
||||
);
|
||||
case 2:
|
||||
return Text(
|
||||
'🥉',
|
||||
style: TextStyle(fontSize: 22),
|
||||
);
|
||||
default:
|
||||
return Text(
|
||||
' ${index + 1}.',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
301
lib/views/create_game_view.dart
Normal file
301
lib/views/create_game_view.dart
Normal file
@@ -0,0 +1,301 @@
|
||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
||||
import 'package:cabo_counter/utility/styles.dart';
|
||||
import 'package:cabo_counter/views/active_game_view.dart';
|
||||
import 'package:cabo_counter/views/mode_selection_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class CreateGame extends StatefulWidget {
|
||||
const CreateGame({super.key});
|
||||
|
||||
@override
|
||||
// ignore: library_private_types_in_public_api
|
||||
_CreateGameState createState() => _CreateGameState();
|
||||
}
|
||||
|
||||
class _CreateGameState extends State<CreateGame> {
|
||||
final List<TextEditingController> _playerNameTextControllers = [
|
||||
TextEditingController()
|
||||
];
|
||||
final TextEditingController _gameTitleTextController =
|
||||
TextEditingController();
|
||||
final int maxPlayers = 5;
|
||||
String? selectedMode; // Variable für den ausgewählten Spielmodus
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
previousPageTitle: 'Übersicht',
|
||||
middle: const Text('Neues Spiel'),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spiel',
|
||||
style: Styles.createGameTitle,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: CupertinoTextField(
|
||||
prefix: Text('Name'),
|
||||
textAlign: TextAlign.right,
|
||||
placeholder: 'Titel des Spiels',
|
||||
controller: _gameTitleTextController,
|
||||
),
|
||||
),
|
||||
// Spielmodus-Auswahl mit Chevron
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: CupertinoTextField(
|
||||
readOnly: true,
|
||||
prefix: Text('Modus'),
|
||||
suffix: Row(
|
||||
children: [
|
||||
Text(
|
||||
selectedMode ?? 'Wähle einen Modus',
|
||||
),
|
||||
SizedBox(width: 3),
|
||||
CupertinoListTileChevron(),
|
||||
],
|
||||
),
|
||||
onTap: () async {
|
||||
// Öffne das Modus-Auswahlmenü
|
||||
final selected = await Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ModeSelectionMenu(),
|
||||
),
|
||||
);
|
||||
|
||||
// Aktualisiere den ausgewählten Modus
|
||||
if (selected != null) {
|
||||
setState(() {
|
||||
selectedMode = selected;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spieler:innen',
|
||||
style: Styles.createGameTitle,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: _playerNameTextControllers.length +
|
||||
1, // +1 für den + Button
|
||||
itemBuilder: (context, index) {
|
||||
if (index == _playerNameTextControllers.length) {
|
||||
// + Button als letztes Element
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Icon(
|
||||
CupertinoIcons.add_circled,
|
||||
color: CupertinoColors.activeGreen,
|
||||
size: 25,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'Spieler hinzufügen',
|
||||
style: TextStyle(
|
||||
color: CupertinoColors.activeGreen,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
if (_playerNameTextControllers.length < maxPlayers) {
|
||||
setState(() {
|
||||
_playerNameTextControllers
|
||||
.add(TextEditingController());
|
||||
});
|
||||
} else {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Maximale Spielerzahl erreicht'),
|
||||
content: Text(
|
||||
'Es können maximal 5 Spieler hinzugefügt werden.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Spieler-Einträge
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: CupertinoTextField(
|
||||
controller: _playerNameTextControllers[index],
|
||||
placeholder: 'Spieler:in ${index + 1}',
|
||||
padding: const EdgeInsets.all(12),
|
||||
),
|
||||
),
|
||||
CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Icon(
|
||||
CupertinoIcons.minus_circle_fill,
|
||||
color: CupertinoColors.destructiveRed,
|
||||
size: 25,
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_playerNameTextControllers[index].dispose();
|
||||
_playerNameTextControllers.removeAt(index);
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Text(
|
||||
'Spiel erstellen ',
|
||||
style: TextStyle(
|
||||
color: CupertinoColors.activeGreen,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
if (_gameTitleTextController.text == '') {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Fehler'),
|
||||
content: Text(
|
||||
'Es muss ein Titel für das Spiel eingegeben werden.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (selectedMode == null) {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Fehler'),
|
||||
content:
|
||||
Text('Es muss ein Spielmodus ausgewählt werden.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (_playerNameTextControllers.length < 2) {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Fehler'),
|
||||
content: Text(
|
||||
'Es müssen mindestens 2 Spieler hinzugefügt werden.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!everyPlayerHasAName()) {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Fehler'),
|
||||
content: Text('Jeder Spieler muss einen Namen haben.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> players = [];
|
||||
for (var controller in _playerNameTextControllers) {
|
||||
players.add(controller.text);
|
||||
}
|
||||
GameSession gameSession = GameSession(
|
||||
gameTitle: _gameTitleTextController.text,
|
||||
players: players,
|
||||
winner: players[0],
|
||||
gameMode: selectedMode == '101 Pkt.' ? 0 : 1,
|
||||
);
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) =>
|
||||
ActiveGameView(gameSession: gameSession)));
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
))));
|
||||
}
|
||||
|
||||
bool everyPlayerHasAName() {
|
||||
for (var controller in _playerNameTextControllers) {
|
||||
if (controller.text == '') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
for (var controller in _playerNameTextControllers) {
|
||||
controller.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
108
lib/views/main_menu_view.dart
Normal file
108
lib/views/main_menu_view.dart
Normal file
@@ -0,0 +1,108 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:cabo_counter/data_classes/game_session.dart';
|
||||
import 'package:cabo_counter/views/active_game_view.dart';
|
||||
import 'package:cabo_counter/views/create_game_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MainMenuView extends StatefulWidget {
|
||||
const MainMenuView({super.key});
|
||||
|
||||
@override
|
||||
// ignore: library_private_types_in_public_api
|
||||
_MainMenuViewState createState() => _MainMenuViewState();
|
||||
}
|
||||
|
||||
class _MainMenuViewState extends State<MainMenuView> {
|
||||
final List<GameSession> gameSessionArray = [
|
||||
GameSession(
|
||||
gameTitle: 'Spiel am 27.02.2025',
|
||||
players: ['Alex', 'Ben', 'Clara'],
|
||||
winner: 'Clara',
|
||||
gameMode: 0),
|
||||
GameSession(
|
||||
gameTitle: 'Freundschaftsrunde',
|
||||
players: ['Jonas', 'Felix', 'Nils'],
|
||||
winner: 'Jonas',
|
||||
gameMode: 1),
|
||||
GameSession(
|
||||
gameTitle: 'Familienabend',
|
||||
players: ['Mama', 'Papa', 'Lisa'],
|
||||
winner: 'Lisa',
|
||||
gameMode: 0,
|
||||
),
|
||||
GameSession(
|
||||
gameTitle: 'Turnier 1. Runde',
|
||||
players: ['Tim', 'Max', 'Sophie', 'Lena'],
|
||||
winner: 'Sophie',
|
||||
gameMode: 0),
|
||||
];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
randomizeRoundNumbers();
|
||||
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: const Text('Cabo Counter'),
|
||||
trailing: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => const CreateGame(),
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(CupertinoIcons.add)),
|
||||
),
|
||||
child: CupertinoPageScaffold(
|
||||
child: SafeArea(
|
||||
child: ListView.builder(
|
||||
itemCount: gameSessionArray.length,
|
||||
itemBuilder: (context, index) {
|
||||
final session = gameSessionArray[index];
|
||||
return GestureDetector(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: CupertinoListTile(
|
||||
title: Text(session.gameTitle),
|
||||
leading: session.gameMode.toInt() == 0
|
||||
? Icon(CupertinoIcons.hare_fill)
|
||||
: Icon(CupertinoIcons.time_solid),
|
||||
subtitle: Text('Gewinner*in: ${session.winner}'),
|
||||
trailing: Row(
|
||||
children: [
|
||||
Text('${session.round}'),
|
||||
SizedBox(width: 3),
|
||||
Icon(CupertinoIcons.arrow_2_circlepath_circle_fill),
|
||||
SizedBox(width: 6),
|
||||
Text('${session.players.length}'),
|
||||
SizedBox(width: 3),
|
||||
Icon(CupertinoIcons.person_2_fill),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ActiveGameView(
|
||||
gameSession: gameSessionArray[index]),
|
||||
),
|
||||
);
|
||||
},
|
||||
)));
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void randomizeRoundNumbers() {
|
||||
var random = Random();
|
||||
gameSessionArray.forEach((s) {
|
||||
s.round = random.nextInt(20);
|
||||
});
|
||||
}
|
||||
}
|
||||
47
lib/views/mode_selection_view.dart
Normal file
47
lib/views/mode_selection_view.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'package:cabo_counter/utility/styles.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class ModeSelectionMenu extends StatelessWidget {
|
||||
const ModeSelectionMenu({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Spielmodus auswählen'),
|
||||
),
|
||||
child: ListView(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 16, 0, 0),
|
||||
child: CupertinoListTile(
|
||||
title: Text('101 Punkte', style: Styles.modeTitle),
|
||||
subtitle: const Text(
|
||||
'Es wird solange gespielt, bis einer Spieler die 101 Punkte genau erreicht oder überschreitet.',
|
||||
style: Styles.modeDescription,
|
||||
maxLines: 3,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context, '101 Pkt.');
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: CupertinoListTile(
|
||||
title: Text('Unbegrenzt', style: Styles.modeTitle),
|
||||
subtitle: const Text(
|
||||
'Dem Spiel sind keine Grenzen gesetzt. Es wird so lange gespielt, bis die Spieler keine Lust mehr haben.',
|
||||
style: Styles.modeDescription,
|
||||
maxLines: 3,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context, 'Unbegrenzt');
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user