diff --git a/android/settings.gradle b/android/settings.gradle index 44e62bc..7cd7128 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,11 +1,29 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" + plugins { + id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false +} + +include ":app" diff --git a/lib/main.dart b/lib/main.dart index 4f9f83f..98b87e7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -15,7 +15,7 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( theme: halloweenTheme, - home: PlayerRegistry(), + home: const PlayerRegistry(), debugShowCheckedModeBanner: false, ); } diff --git a/lib/screens/flippingcards.dart b/lib/screens/flippingcards.dart index f62cf23..35ff594 100644 --- a/lib/screens/flippingcards.dart +++ b/lib/screens/flippingcards.dart @@ -41,7 +41,7 @@ class _FlipingCardState extends State { front: Container( decoration: BoxDecoration( color: Theme.of(context).colorScheme.primary, - borderRadius: BorderRadius.all(Radius.circular(8.0)), + borderRadius: const BorderRadius.all(Radius.circular(8.0)), ), child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -55,7 +55,7 @@ class _FlipingCardState extends State { textAlign: TextAlign.center, ), ), - Text( + const Text( 'Klick um deine Rolle zu sehen!', textAlign: TextAlign.center, ), @@ -107,7 +107,7 @@ class _FlipingCardState extends State { children: [ Expanded(child: _renderContent(context)), Container( - padding: EdgeInsets.only(bottom: 15), + padding: const EdgeInsets.only(bottom: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/gameboard.dart b/lib/screens/gameboard.dart index 0b5136a..6a871aa 100644 --- a/lib/screens/gameboard.dart +++ b/lib/screens/gameboard.dart @@ -9,6 +9,7 @@ class PlayerGridView extends StatefulWidget { const PlayerGridView({required this.players, Key? key}) : super(key: key); @override + // ignore: library_private_types_in_public_api _PlayerGridViewState createState() => _PlayerGridViewState(); } @@ -32,7 +33,7 @@ class _PlayerGridViewState extends State { size: 24, color: isNight ? Colors.grey[300] : Colors.yellow, ), - SizedBox(width: 10), + const SizedBox(width: 10), Text( isNight ? 'Nacht' : 'Tag', ), @@ -41,7 +42,7 @@ class _PlayerGridViewState extends State { centerTitle: true, actions: [ IconButton( - icon: Icon(Icons.info), + icon: const Icon(Icons.info), onPressed: () { _showRolesDialog(); }, @@ -89,13 +90,13 @@ class _PlayerGridViewState extends State { children: [ Text( widget.players[index].name, - style: TextStyle(fontSize: 24), + style: const TextStyle(fontSize: 24), textAlign: TextAlign.center, maxLines: 3, overflow: TextOverflow.ellipsis, ), if (widget.players[index].isDead) - Icon(Icons.close, color: Colors.red, size: 48), + const Icon(Icons.close, color: Colors.red, size: 48), ], ), ), @@ -103,12 +104,12 @@ class _PlayerGridViewState extends State { }, ), ), - Divider( + const Divider( height: 1, color: Colors.grey, ), Padding( - padding: EdgeInsets.only(bottom: 15, top: 15), + padding: const EdgeInsets.only(bottom: 15, top: 15), child: ElevatedButton( onPressed: _changePhase, child: Text(isNight ? 'Tag skippen' : 'Nacht skippen'), @@ -167,11 +168,11 @@ class _PlayerGridViewState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: Text('Spielende'), + title: const Text('Spielende'), content: Text(message), actions: [ TextButton( - child: Text('Spiel beenden'), + child: const Text('Spiel beenden'), onPressed: () { Navigator.popUntil(context, ModalRoute.withName('/')); }, @@ -187,8 +188,8 @@ class _PlayerGridViewState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: Text('Spielerrollen'), - content: Container( + title: const Text('Spielerrollen'), + content: SizedBox( width: double.maxFinite, child: ListView.builder( shrinkWrap: true, @@ -212,7 +213,7 @@ class _PlayerGridViewState extends State { ), actions: [ TextButton( - child: Text('OK'), + child: const Text('OK'), onPressed: () { Navigator.of(context).pop(); }, diff --git a/lib/screens/playerregistry.dart b/lib/screens/playerregistry.dart index 729af9c..00a1dfe 100644 --- a/lib/screens/playerregistry.dart +++ b/lib/screens/playerregistry.dart @@ -5,6 +5,7 @@ class PlayerRegistry extends StatefulWidget { const PlayerRegistry({super.key}); @override + // ignore: library_private_types_in_public_api _PlayerRegistryState createState() => _PlayerRegistryState(); } @@ -103,7 +104,7 @@ class _PlayerRegistryState extends State { }, child: const Text('Spiel einstellen'), ), - Padding(padding: EdgeInsets.all(30)) + const Padding(padding: EdgeInsets.all(30)) ], ), ), diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index e381784..d634611 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -125,7 +125,7 @@ class _GameSettingsState extends State { ), ); }, - child: Text( + child: const Text( 'Spiel starten!', ), ), diff --git a/lib/theme/theme.dart b/lib/theme/theme.dart index 30622f9..dcc5173 100644 --- a/lib/theme/theme.dart +++ b/lib/theme/theme.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; ThemeData halloweenTheme = ThemeData( useMaterial3: true, brightness: Brightness.dark, - colorScheme: ColorScheme.dark( - surface: const Color(0xff2d2d2d), // Dark grey for a spooky base - primary: const Color(0xffff7518), // Halloween orange - secondary: const Color(0xff8b0000), // Deep red for a sinister touch + colorScheme: const ColorScheme.dark( + surface: Color(0xff2d2d2d), // Dark grey for a spooky base + primary: Color(0xffff7518), // Halloween orange + secondary: Color(0xff8b0000), // Deep red for a sinister touch tertiary: Colors.black, // Black for an eerie contrast ), scaffoldBackgroundColor: const Color(0xff2d2d2d), // Match the surface color @@ -23,26 +23,26 @@ ThemeData halloweenTheme = ThemeData( iconTheme: const IconThemeData( color: Color(0xffff7518), // Halloween orange ), - chipTheme: ChipThemeData( - backgroundColor: const Color(0xff8b0000), // Deep red - selectedColor: const Color(0xffff7518), // Halloween orange + chipTheme: const ChipThemeData( + backgroundColor: Color(0xff8b0000), // Deep red + selectedColor: Color(0xffff7518), // Halloween orange labelStyle: TextStyle( color: Colors.white, // Text color for better readability ), ), - sliderTheme: SliderThemeData( - activeTickMarkColor: const Color(0xffff7518), // Halloween orange - activeTrackColor: const Color(0xffff7518), // Halloween orange - thumbColor: const Color(0xffff7518), // Halloween orange + sliderTheme: const SliderThemeData( + activeTickMarkColor: Color(0xffff7518), // Halloween orange + activeTrackColor: Color(0xffff7518), // Halloween orange + thumbColor: Color(0xffff7518), // Halloween orange valueIndicatorTextStyle: TextStyle( color: Colors.black, // Text color for the value indicator ), ), - dividerTheme: DividerThemeData( + dividerTheme: const DividerThemeData( color: Colors.white, // Halloween orange thickness: 1.0, // Set the thickness of the divider ), - textTheme: TextTheme( + textTheme: const TextTheme( displayLarge: TextStyle( color: Colors.white, // Halloween orange fontSize: 32.0, diff --git a/pubspec.yaml b/pubspec.yaml index e82d505..c00dec0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: werwolf -description: A new Flutter project. +description: A fanmade werwolf game publish_to: 'none' version: 0.1.0