Actions: Auto-formatting [skip ci]
This commit is contained in:
@@ -22,7 +22,7 @@ class App extends StatelessWidget {
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'CABO-Counter',
|
||||
home: MainMenuView(),
|
||||
home: const MainMenuView(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
|
||||
abstract class Styles {
|
||||
static Color primaryColor = CupertinoColors.systemGreen;
|
||||
static Color backgroundColor = Color(0xFF080808);
|
||||
static Color backgroundColor = const Color(0xFF080808);
|
||||
|
||||
static TextStyle modeTitle = TextStyle(
|
||||
color: primaryColor,
|
||||
@@ -20,13 +20,13 @@ abstract class Styles {
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
|
||||
static TextStyle roundTitle = TextStyle(
|
||||
static TextStyle roundTitle = const TextStyle(
|
||||
fontSize: 60,
|
||||
color: CupertinoColors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
|
||||
static TextStyle roundPlayers = TextStyle(
|
||||
static TextStyle roundPlayers = const TextStyle(
|
||||
fontSize: 20,
|
||||
color: CupertinoColors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -21,13 +21,13 @@ TextStyle createGameTitle = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
|
||||
TextStyle roundTitle = TextStyle(
|
||||
TextStyle roundTitle = const TextStyle(
|
||||
fontSize: 60,
|
||||
color: CupertinoColors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
|
||||
TextStyle roundPlayers = TextStyle(
|
||||
TextStyle roundPlayers = const TextStyle(
|
||||
fontSize: 20,
|
||||
color: CupertinoColors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -25,7 +25,7 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spieler:innen',
|
||||
style: theme.createGameTitle,
|
||||
@@ -40,16 +40,16 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
title: Row(
|
||||
children: [
|
||||
_getPlacementPrefix(index),
|
||||
SizedBox(width: 5),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
widget.gameSession.players[playerIndex],
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
trailing: Row(
|
||||
children: [
|
||||
SizedBox(width: 5),
|
||||
const SizedBox(width: 5),
|
||||
Text('${widget.gameSession.playerScores[playerIndex][0]} '
|
||||
'Punkte')
|
||||
],
|
||||
@@ -58,7 +58,7 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Runden',
|
||||
style: theme.createGameTitle,
|
||||
@@ -69,15 +69,15 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
itemCount: widget.gameSession.round,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.all(1),
|
||||
padding: const EdgeInsets.all(1),
|
||||
child: CupertinoListTile(
|
||||
title: Text(
|
||||
'Runde ${index + 1}',
|
||||
),
|
||||
trailing: index + 1 != widget.gameSession.round ||
|
||||
widget.gameSession.finished == true
|
||||
? (Text('\u{2705}', style: TextStyle(fontSize: 22)))
|
||||
: Text('\u{23F3}', style: TextStyle(fontSize: 22)),
|
||||
? (const Text('\u{2705}', style: TextStyle(fontSize: 22)))
|
||||
: const Text('\u{23F3}', style: TextStyle(fontSize: 22)),
|
||||
onTap: () async {
|
||||
// ignore: unused_local_variable
|
||||
final val = await Navigator.push(
|
||||
@@ -120,24 +120,24 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
Widget _getPlacementPrefix(int index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return Text(
|
||||
return const Text(
|
||||
'\u{1F947}',
|
||||
style: TextStyle(fontSize: 22),
|
||||
);
|
||||
case 1:
|
||||
return Text(
|
||||
return const Text(
|
||||
'\u{1F948}',
|
||||
style: TextStyle(fontSize: 22),
|
||||
);
|
||||
case 2:
|
||||
return Text(
|
||||
return const Text(
|
||||
'\u{1F949}',
|
||||
style: TextStyle(fontSize: 22),
|
||||
);
|
||||
default:
|
||||
return Text(
|
||||
' ${index + 1}.',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ class _CreateGameState extends State<CreateGame> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
previousPageTitle: 'Übersicht',
|
||||
middle: const Text('Neues Spiel'),
|
||||
middle: Text('Neues Spiel'),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Center(
|
||||
@@ -35,18 +35,18 @@ class _CreateGameState extends State<CreateGame> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spiel',
|
||||
style: Styles.createGameTitle,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 0),
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
|
||||
child: CupertinoTextField(
|
||||
decoration: BoxDecoration(),
|
||||
decoration: const BoxDecoration(),
|
||||
maxLength: 8,
|
||||
prefix: Text('Name'),
|
||||
prefix: const Text('Name'),
|
||||
textAlign: TextAlign.right,
|
||||
placeholder: 'Titel des Spiels',
|
||||
controller: _gameTitleTextController,
|
||||
@@ -54,18 +54,18 @@ class _CreateGameState extends State<CreateGame> {
|
||||
),
|
||||
// Spielmodus-Auswahl mit Chevron
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 0),
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
|
||||
child: CupertinoTextField(
|
||||
decoration: BoxDecoration(),
|
||||
decoration: const BoxDecoration(),
|
||||
readOnly: true,
|
||||
prefix: Text('Modus'),
|
||||
prefix: const Text('Modus'),
|
||||
suffix: Row(
|
||||
children: [
|
||||
Text(
|
||||
selectedMode ?? 'Wähle einen Modus',
|
||||
),
|
||||
SizedBox(width: 3),
|
||||
CupertinoListTileChevron(),
|
||||
const SizedBox(width: 3),
|
||||
const CupertinoListTileChevron(),
|
||||
],
|
||||
),
|
||||
onTap: () async {
|
||||
@@ -73,7 +73,7 @@ class _CreateGameState extends State<CreateGame> {
|
||||
final selected = await Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ModeSelectionMenu(),
|
||||
builder: (context) => const ModeSelectionMenu(),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -87,7 +87,7 @@ class _CreateGameState extends State<CreateGame> {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spieler:innen',
|
||||
style: Styles.createGameTitle,
|
||||
@@ -104,9 +104,9 @@ class _CreateGameState extends State<CreateGame> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Row(
|
||||
child: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
children: [
|
||||
Icon(
|
||||
CupertinoIcons.add_circled,
|
||||
color: CupertinoColors.activeGreen,
|
||||
@@ -131,13 +131,13 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Maximale Spielerzahl erreicht'),
|
||||
content: Text(
|
||||
title: const Text('Maximale Spielerzahl erreicht'),
|
||||
content: const Text(
|
||||
'Es können maximal 5 Spieler hinzugefügt '
|
||||
'werden.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
child: const Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -156,7 +156,7 @@ class _CreateGameState extends State<CreateGame> {
|
||||
children: [
|
||||
CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
CupertinoIcons.minus_circle_fill,
|
||||
color: CupertinoColors.destructiveRed,
|
||||
size: 25,
|
||||
@@ -173,7 +173,7 @@ class _CreateGameState extends State<CreateGame> {
|
||||
controller: _playerNameTextControllers[index],
|
||||
placeholder: 'Spieler:in ${index + 1}',
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(),
|
||||
decoration: const BoxDecoration(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -186,9 +186,9 @@ class _CreateGameState extends State<CreateGame> {
|
||||
Center(
|
||||
child: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Row(
|
||||
child: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
children: [
|
||||
Text(
|
||||
'Spiel erstellen ',
|
||||
style: TextStyle(
|
||||
@@ -202,13 +202,13 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Fehler'),
|
||||
title: const Text('Fehler'),
|
||||
content:
|
||||
Text('Es muss ein Titel für das Spiel eingegeben '
|
||||
const Text('Es muss ein Titel für das Spiel eingegeben '
|
||||
'werden.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
child: const Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -220,12 +220,12 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Fehler'),
|
||||
title: const Text('Fehler'),
|
||||
content:
|
||||
Text('Es muss ein Spielmodus ausgewählt werden.'),
|
||||
const Text('Es muss ein Spielmodus ausgewählt werden.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
child: const Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -237,13 +237,13 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Fehler'),
|
||||
title: const Text('Fehler'),
|
||||
content:
|
||||
Text('Es müssen mindestens 2 Spieler hinzugefügt '
|
||||
const Text('Es müssen mindestens 2 Spieler hinzugefügt '
|
||||
'werden.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
child: const Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -255,11 +255,11 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('Fehler'),
|
||||
content: Text('Jeder Spieler muss einen Namen haben.'),
|
||||
title: const Text('Fehler'),
|
||||
content: const Text('Jeder Spieler muss einen Namen haben.'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('OK'),
|
||||
child: const Text('OK'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -14,7 +14,7 @@ class InformationView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Über'),
|
||||
),
|
||||
child: SafeArea(
|
||||
@@ -23,7 +23,7 @@ class InformationView extends StatelessWidget {
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||
child: Text(
|
||||
'Cabo Counter',
|
||||
@@ -34,13 +34,13 @@ class InformationView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child:
|
||||
Image.asset('assets/cabo-counter-logo_rounded.png'),
|
||||
)),
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30),
|
||||
child: Text(
|
||||
'Hey :) Danke, dass du als eine:r der ersten User '
|
||||
@@ -55,10 +55,10 @@ class InformationView extends StatelessWidget {
|
||||
textAlign: TextAlign.center,
|
||||
softWrap: true,
|
||||
)),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Text(
|
||||
const Text(
|
||||
'\u00A9 Felix Kirchner',
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
@@ -68,15 +68,15 @@ class InformationView extends StatelessWidget {
|
||||
IconButton(
|
||||
onPressed: () => launchUrl(
|
||||
Uri.parse('https://www.instagram.com/fx.kr')),
|
||||
icon: Icon(FontAwesomeIcons.instagram)),
|
||||
icon: const Icon(FontAwesomeIcons.instagram)),
|
||||
IconButton(
|
||||
onPressed: () => launchUrl(
|
||||
Uri.parse('mailto:felix.kirchner.fk@gmail.com')),
|
||||
icon: Icon(CupertinoIcons.envelope)),
|
||||
icon: const Icon(CupertinoIcons.envelope)),
|
||||
IconButton(
|
||||
onPressed: () => launchUrl(
|
||||
Uri.parse('https://www.github.com/flixcoo')),
|
||||
icon: Icon(FontAwesomeIcons.github)),
|
||||
icon: const Icon(FontAwesomeIcons.github)),
|
||||
],
|
||||
)
|
||||
],
|
||||
@@ -95,12 +95,12 @@ class InformationView extends StatelessWidget {
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Text(
|
||||
return const Text(
|
||||
'App-Version -.-.- (Build -)',
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
}
|
||||
return Text(
|
||||
return const Text(
|
||||
'Lade Version...',
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
|
||||
@@ -61,7 +61,7 @@ class _MainMenuViewState extends State<MainMenuView> {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => InformationView(),
|
||||
builder: (context) => const InformationView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -88,27 +88,27 @@ class _MainMenuViewState extends State<MainMenuView> {
|
||||
itemBuilder: (context, index) {
|
||||
final session = gameSessionArray[index];
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: CupertinoListTile(
|
||||
title: Text(session.gameTitle),
|
||||
subtitle: session.finished == true
|
||||
? Text(
|
||||
'\u{1F947} ${session.winner}',
|
||||
style: TextStyle(fontSize: 14),
|
||||
style: const TextStyle(fontSize: 14),
|
||||
)
|
||||
: Text(
|
||||
'Modus: ${_translateGameMode(session.pointLimit)}',
|
||||
style: TextStyle(fontSize: 14),
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
trailing: Row(
|
||||
children: [
|
||||
Text('${session.round}'),
|
||||
SizedBox(width: 3),
|
||||
Icon(CupertinoIcons.arrow_2_circlepath_circle_fill),
|
||||
SizedBox(width: 15),
|
||||
const SizedBox(width: 3),
|
||||
const Icon(CupertinoIcons.arrow_2_circlepath_circle_fill),
|
||||
const SizedBox(width: 15),
|
||||
Text('${session.players.length}'),
|
||||
SizedBox(width: 3),
|
||||
Icon(CupertinoIcons.person_2_fill),
|
||||
const SizedBox(width: 3),
|
||||
const Icon(CupertinoIcons.person_2_fill),
|
||||
],
|
||||
),
|
||||
onTap: () async {
|
||||
|
||||
@@ -147,12 +147,12 @@ class _RoundViewState extends State<RoundView> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: CupertinoListTile(
|
||||
title: const Text('Spieler:in'),
|
||||
title: Text('Spieler:in'),
|
||||
trailing: Row(
|
||||
children: const [
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: Center(child: Text('Punkte'))),
|
||||
|
||||
Reference in New Issue
Block a user