Refactoring & comments
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:cabo_counter/data/game_manager.dart';
|
||||
import 'package:cabo_counter/data/game_session.dart';
|
||||
import 'package:cabo_counter/services/local_storage_service.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
@@ -81,7 +82,7 @@ class _CreateGameState extends State<CreateGame> {
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ModeSelectionMenu(
|
||||
pointLimit: globals.pointLimit,
|
||||
pointLimit: Globals.pointLimit,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -285,8 +286,8 @@ class _CreateGameState extends State<CreateGame> {
|
||||
createdAt: DateTime.now(),
|
||||
gameTitle: _gameTitleTextController.text,
|
||||
players: players,
|
||||
pointLimit: globals.pointLimit,
|
||||
caboPenalty: globals.caboPenalty,
|
||||
pointLimit: Globals.pointLimit,
|
||||
caboPenalty: Globals.caboPenalty,
|
||||
isPointsLimitEnabled: selectedMode!,
|
||||
);
|
||||
globals.addGameSession(gameSession);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:cabo_counter/data/game_manager.dart';
|
||||
import 'package:cabo_counter/services/local_storage_service.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
import 'package:cabo_counter/utility/globals.dart';
|
||||
import 'package:cabo_counter/views/active_game_view.dart';
|
||||
import 'package:cabo_counter/views/create_game_view.dart';
|
||||
import 'package:cabo_counter/views/settings_view.dart';
|
||||
|
||||
@@ -50,14 +50,14 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
subtitle: const Text('... für falsches Cabo sagen'),
|
||||
trailing: Stepper(
|
||||
key: _stepperKey1,
|
||||
initialValue: globals.caboPenalty,
|
||||
initialValue: Globals.caboPenalty,
|
||||
minValue: 0,
|
||||
maxValue: 50,
|
||||
step: 1,
|
||||
onChanged: (newCaboPenalty) {
|
||||
setState(() {
|
||||
ConfigService.setCaboPenalty(newCaboPenalty);
|
||||
globals.caboPenalty = newCaboPenalty;
|
||||
Globals.caboPenalty = newCaboPenalty;
|
||||
});
|
||||
},
|
||||
),
|
||||
@@ -70,14 +70,14 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
subtitle: const Text('... hier ist Schluss'),
|
||||
trailing: Stepper(
|
||||
key: _stepperKey2,
|
||||
initialValue: globals.pointLimit,
|
||||
initialValue: Globals.pointLimit,
|
||||
minValue: 30,
|
||||
maxValue: 1000,
|
||||
step: 10,
|
||||
onChanged: (newPointLimit) {
|
||||
setState(() {
|
||||
ConfigService.setPointLimit(newPointLimit);
|
||||
globals.pointLimit = newPointLimit;
|
||||
Globals.pointLimit = newPointLimit;
|
||||
});
|
||||
},
|
||||
),
|
||||
@@ -201,7 +201,7 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
return Text(
|
||||
'${globals.appDevPhase} ${snapshot.data!.version} '
|
||||
'${Globals.appDevPhase} ${snapshot.data!.version} '
|
||||
'(Build ${snapshot.data!.buildNumber})',
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user