commit a3d70e39b24e6ac142ccb5f8f677eaeaa8696aa9 Author: Paolo Date: Fri Feb 27 23:35:54 2026 +0100 Primo commit pulito diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..e44f658 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3b9fc74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# Esclusioni generiche +*.log +*.temp +*.tmp +*.swp + +# Flutter/Dart +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android Studio / IntelliJ +.idea/ +*.iml +*.iws +.gradle/ +local.properties +captures/ + +# iOS (Xcode) +ios/Pods/ +ios/.generated/ +ios/Flutter/Generated.xcconfig +ios/Flutter/flutter_export_environment.sh +ios/Runner/GeneratedPluginRegistrant.h +ios/Runner/GeneratedPluginRegistrant.m +**/doc/api/ +*.ipa +*.aab \ No newline at end of file diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..7fcf38d --- /dev/null +++ b/.metadata @@ -0,0 +1,36 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "3b62efc2a3da49882f43c372e0bc53daef7295a6" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: android + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: ios + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: macos + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ac47fc --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# tetraq + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..0d29021 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/android/.DS_Store b/android/.DS_Store new file mode 100644 index 0000000..da8bfc8 Binary files /dev/null and b/android/.DS_Store differ diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..be3943c --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/.DS_Store b/android/app/.DS_Store new file mode 100644 index 0000000..9a874b5 Binary files /dev/null and b/android/app/.DS_Store differ diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..62dddd3 --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,47 @@ +plugins { + id("com.android.application") + // START: FlutterFire Configuration + id("com.google.gms.google-services") + // END: FlutterFire Configuration + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.sanza.tetraq" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.sanza.tetraq" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..2af9bd8 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "705460445314", + "project_id": "tetraq-32a4a", + "storage_bucket": "tetraq-32a4a.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:705460445314:android:4d35fef29cfd63727b949b", + "android_client_info": { + "package_name": "com.sanza.tetraq" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBsXO595xVITDPrRnXrW8HPQLOe7Rz4Gg4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/.DS_Store b/android/app/src/.DS_Store new file mode 100644 index 0000000..e6a912a Binary files /dev/null and b/android/app/src/.DS_Store differ diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c7b17f2 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/sanza/tetraq/MainActivity.kt b/android/app/src/main/kotlin/com/sanza/tetraq/MainActivity.kt new file mode 100644 index 0000000..8c2bbf4 --- /dev/null +++ b/android/app/src/main/kotlin/com/sanza/tetraq/MainActivity.kt @@ -0,0 +1,5 @@ +package com.sanza.tetraq + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..a1df20d Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..665c1a1 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..30fbc42 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..4360ee1 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..7dde15f Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..dbee657 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..fbee1d8 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..e4ef43f --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..174f408 --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,29 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + // START: FlutterFire Configuration + id("com.google.gms.google-services") version("4.3.15") apply false + // END: FlutterFire Configuration + id("org.jetbrains.kotlin.android") version "2.2.20" apply false +} + +include(":app") diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000..cfbf861 Binary files /dev/null and b/assets/.DS_Store differ diff --git a/assets/audio/sfx/cyber_box.wav b/assets/audio/sfx/cyber_box.wav new file mode 100644 index 0000000..a0a0c9b Binary files /dev/null and b/assets/audio/sfx/cyber_box.wav differ diff --git a/assets/audio/sfx/cyber_line.wav b/assets/audio/sfx/cyber_line.wav new file mode 100644 index 0000000..e53d501 Binary files /dev/null and b/assets/audio/sfx/cyber_line.wav differ diff --git a/assets/audio/sfx/doodle_box.wav b/assets/audio/sfx/doodle_box.wav new file mode 100644 index 0000000..25d331c Binary files /dev/null and b/assets/audio/sfx/doodle_box.wav differ diff --git a/assets/audio/sfx/doodle_line.wav b/assets/audio/sfx/doodle_line.wav new file mode 100644 index 0000000..d41cf40 Binary files /dev/null and b/assets/audio/sfx/doodle_line.wav differ diff --git a/assets/audio/sfx/minimal_box.wav b/assets/audio/sfx/minimal_box.wav new file mode 100644 index 0000000..73a4838 Binary files /dev/null and b/assets/audio/sfx/minimal_box.wav differ diff --git a/assets/audio/sfx/minimal_line.wav b/assets/audio/sfx/minimal_line.wav new file mode 100644 index 0000000..c7cc8a9 Binary files /dev/null and b/assets/audio/sfx/minimal_line.wav differ diff --git a/assets/icon/icona_master.png b/assets/icon/icona_master.png new file mode 100644 index 0000000..44f15ae Binary files /dev/null and b/assets/icon/icona_master.png differ diff --git a/assets/images/.DS_Store b/assets/images/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/assets/images/.DS_Store differ diff --git a/assets/images/cyber_bg.jpg b/assets/images/cyber_bg.jpg new file mode 100644 index 0000000..124759b Binary files /dev/null and b/assets/images/cyber_bg.jpg differ diff --git a/assets/images/doodle_bg.jpg b/assets/images/doodle_bg.jpg new file mode 100644 index 0000000..b9a6cfa Binary files /dev/null and b/assets/images/doodle_bg.jpg differ diff --git a/assets/images/doodle_bg1.jpg b/assets/images/doodle_bg1.jpg new file mode 100644 index 0000000..e431151 Binary files /dev/null and b/assets/images/doodle_bg1.jpg differ diff --git a/assets/images/icona_big.jpeg b/assets/images/icona_big.jpeg new file mode 100644 index 0000000..49527ce Binary files /dev/null and b/assets/images/icona_big.jpeg differ diff --git a/assets/images/wood_bg.jpg b/assets/images/wood_bg.jpg new file mode 100644 index 0000000..704bb51 Binary files /dev/null and b/assets/images/wood_bg.jpg differ diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..01ff3f8 --- /dev/null +++ b/firebase.json @@ -0,0 +1 @@ +{"flutter":{"platforms":{"android":{"default":{"projectId":"tetraq-32a4a","appId":"1:705460445314:android:4d35fef29cfd63727b949b","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"tetraq-32a4a","appId":"1:705460445314:ios:da11cbca5d1f6bc27b949b","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"macos":{"default":{"projectId":"tetraq-32a4a","appId":"1:705460445314:ios:da11cbca5d1f6bc27b949b","uploadDebugSymbols":false,"fileOutput":"macos/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"tetraq-32a4a","configurations":{"android":"1:705460445314:android:4d35fef29cfd63727b949b","ios":"1:705460445314:ios:da11cbca5d1f6bc27b949b","macos":"1:705460445314:ios:da11cbca5d1f6bc27b949b"}}}}}} \ No newline at end of file diff --git a/ios/.DS_Store b/ios/.DS_Store new file mode 100644 index 0000000..298d050 Binary files /dev/null and b/ios/.DS_Store differ diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..1dc6cf7 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 13.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..3076416 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project + platform :ios, '15.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 0000000..bd62485 --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,1425 @@ +PODS: + - abseil/algorithm (1.20240722.0): + - abseil/algorithm/algorithm (= 1.20240722.0) + - abseil/algorithm/container (= 1.20240722.0) + - abseil/algorithm/algorithm (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/algorithm/container (1.20240722.0): + - abseil/algorithm/algorithm + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/base (1.20240722.0): + - abseil/base/atomic_hook (= 1.20240722.0) + - abseil/base/base (= 1.20240722.0) + - abseil/base/base_internal (= 1.20240722.0) + - abseil/base/config (= 1.20240722.0) + - abseil/base/core_headers (= 1.20240722.0) + - abseil/base/cycleclock_internal (= 1.20240722.0) + - abseil/base/dynamic_annotations (= 1.20240722.0) + - abseil/base/endian (= 1.20240722.0) + - abseil/base/errno_saver (= 1.20240722.0) + - abseil/base/fast_type_id (= 1.20240722.0) + - abseil/base/log_severity (= 1.20240722.0) + - abseil/base/malloc_internal (= 1.20240722.0) + - abseil/base/no_destructor (= 1.20240722.0) + - abseil/base/nullability (= 1.20240722.0) + - abseil/base/poison (= 1.20240722.0) + - abseil/base/prefetch (= 1.20240722.0) + - abseil/base/pretty_function (= 1.20240722.0) + - abseil/base/raw_logging_internal (= 1.20240722.0) + - abseil/base/spinlock_wait (= 1.20240722.0) + - abseil/base/strerror (= 1.20240722.0) + - abseil/base/throw_delegate (= 1.20240722.0) + - abseil/base/atomic_hook (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/base/base (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/cycleclock_internal + - abseil/base/dynamic_annotations + - abseil/base/log_severity + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/base/spinlock_wait + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/base/base_internal (1.20240722.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/base/config (1.20240722.0): + - abseil/xcprivacy + - abseil/base/core_headers (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/base/cycleclock_internal (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/xcprivacy + - abseil/base/dynamic_annotations (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/base/endian (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/xcprivacy + - abseil/base/errno_saver (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/base/fast_type_id (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/base/log_severity (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/base/malloc_internal (1.20240722.0): + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/base/no_destructor (1.20240722.0): + - abseil/base/config + - abseil/base/nullability + - abseil/xcprivacy + - abseil/base/nullability (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/base/poison (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal + - abseil/xcprivacy + - abseil/base/prefetch (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/base/pretty_function (1.20240722.0): + - abseil/xcprivacy + - abseil/base/raw_logging_internal (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/config + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/base/log_severity + - abseil/xcprivacy + - abseil/base/spinlock_wait (1.20240722.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/xcprivacy + - abseil/base/strerror (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/xcprivacy + - abseil/base/throw_delegate (1.20240722.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/cleanup/cleanup (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/cleanup/cleanup_internal + - abseil/xcprivacy + - abseil/cleanup/cleanup_internal (1.20240722.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/common (1.20240722.0): + - abseil/meta/type_traits + - abseil/types/optional + - abseil/xcprivacy + - abseil/container/common_policy_traits (1.20240722.0): + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/compressed_tuple (1.20240722.0): + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/container_memory (1.20240722.0): + - abseil/base/config + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/fixed_array (1.20240722.0): + - abseil/algorithm/algorithm + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/throw_delegate + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/xcprivacy + - abseil/container/flat_hash_map (1.20240722.0): + - abseil/algorithm/container + - abseil/base/core_headers + - abseil/container/container_memory + - abseil/container/hash_container_defaults + - abseil/container/raw_hash_map + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/flat_hash_set (1.20240722.0): + - abseil/algorithm/container + - abseil/base/core_headers + - abseil/container/container_memory + - abseil/container/hash_container_defaults + - abseil/container/raw_hash_set + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/hash_container_defaults (1.20240722.0): + - abseil/base/config + - abseil/container/hash_function_defaults + - abseil/xcprivacy + - abseil/container/hash_function_defaults (1.20240722.0): + - abseil/base/config + - abseil/container/common + - abseil/hash/hash + - abseil/meta/type_traits + - abseil/strings/cord + - abseil/strings/strings + - abseil/xcprivacy + - abseil/container/hash_policy_traits (1.20240722.0): + - abseil/container/common_policy_traits + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/hashtable_debug_hooks (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/container/hashtablez_sampler (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/no_destructor + - abseil/base/raw_logging_internal + - abseil/debugging/stacktrace + - abseil/memory/memory + - abseil/profiling/exponential_biased + - abseil/profiling/sample_recorder + - abseil/synchronization/synchronization + - abseil/time/time + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/inlined_vector (1.20240722.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/container/inlined_vector_internal + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/inlined_vector_internal (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/span + - abseil/xcprivacy + - abseil/container/layout (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/debugging/demangle_internal + - abseil/meta/type_traits + - abseil/strings/strings + - abseil/types/span + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/raw_hash_map (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/container/container_memory + - abseil/container/raw_hash_set + - abseil/xcprivacy + - abseil/container/raw_hash_set (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/endian + - abseil/base/prefetch + - abseil/base/raw_logging_internal + - abseil/container/common + - abseil/container/compressed_tuple + - abseil/container/container_memory + - abseil/container/hash_policy_traits + - abseil/container/hashtable_debug_hooks + - abseil/container/hashtablez_sampler + - abseil/hash/hash + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/utility/utility + - abseil/xcprivacy + - abseil/crc/cpu_detect (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/xcprivacy + - abseil/crc/crc32c (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/prefetch + - abseil/crc/cpu_detect + - abseil/crc/crc_internal + - abseil/crc/non_temporal_memcpy + - abseil/strings/str_format + - abseil/strings/strings + - abseil/xcprivacy + - abseil/crc/crc_cord_state (1.20240722.0): + - abseil/base/config + - abseil/base/no_destructor + - abseil/crc/crc32c + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/crc/crc_internal (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/prefetch + - abseil/base/raw_logging_internal + - abseil/crc/cpu_detect + - abseil/memory/memory + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/crc/non_temporal_arm_intrinsics (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/crc/non_temporal_memcpy (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/crc/non_temporal_arm_intrinsics + - abseil/xcprivacy + - abseil/debugging/bounded_utf8_length_sequence (1.20240722.0): + - abseil/base/config + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/debugging/debugging_internal (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/errno_saver + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/debugging/decode_rust_punycode (1.20240722.0): + - abseil/base/config + - abseil/base/nullability + - abseil/debugging/bounded_utf8_length_sequence + - abseil/debugging/utf8_for_code_point + - abseil/xcprivacy + - abseil/debugging/demangle_internal (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/debugging/demangle_rust + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/debugging/demangle_rust (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/debugging/decode_rust_punycode + - abseil/xcprivacy + - abseil/debugging/examine_stack (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/debugging/stacktrace + - abseil/debugging/symbolize + - abseil/xcprivacy + - abseil/debugging/stacktrace (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/raw_logging_internal + - abseil/debugging/debugging_internal + - abseil/xcprivacy + - abseil/debugging/symbolize (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/debugging/debugging_internal + - abseil/debugging/demangle_internal + - abseil/strings/strings + - abseil/xcprivacy + - abseil/debugging/utf8_for_code_point (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/flags/commandlineflag (1.20240722.0): + - abseil/base/config + - abseil/base/fast_type_id + - abseil/flags/commandlineflag_internal + - abseil/strings/strings + - abseil/types/optional + - abseil/xcprivacy + - abseil/flags/commandlineflag_internal (1.20240722.0): + - abseil/base/config + - abseil/base/fast_type_id + - abseil/xcprivacy + - abseil/flags/config (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/flags/path_util + - abseil/flags/program_name + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/xcprivacy + - abseil/flags/flag (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/flags/commandlineflag + - abseil/flags/config + - abseil/flags/flag_internal + - abseil/flags/reflection + - abseil/strings/strings + - abseil/xcprivacy + - abseil/flags/flag_internal (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/flags/commandlineflag + - abseil/flags/commandlineflag_internal + - abseil/flags/config + - abseil/flags/marshalling + - abseil/flags/reflection + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/utility/utility + - abseil/xcprivacy + - abseil/flags/marshalling (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/numeric/int128 + - abseil/strings/str_format + - abseil/strings/strings + - abseil/types/optional + - abseil/xcprivacy + - abseil/flags/path_util (1.20240722.0): + - abseil/base/config + - abseil/strings/strings + - abseil/xcprivacy + - abseil/flags/private_handle_accessor (1.20240722.0): + - abseil/base/config + - abseil/flags/commandlineflag + - abseil/flags/commandlineflag_internal + - abseil/strings/strings + - abseil/xcprivacy + - abseil/flags/program_name (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/flags/path_util + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/xcprivacy + - abseil/flags/reflection (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/no_destructor + - abseil/container/flat_hash_map + - abseil/flags/commandlineflag + - abseil/flags/commandlineflag_internal + - abseil/flags/config + - abseil/flags/private_handle_accessor + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/xcprivacy + - abseil/functional/any_invocable (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/utility/utility + - abseil/xcprivacy + - abseil/functional/bind_front (1.20240722.0): + - abseil/base/base_internal + - abseil/container/compressed_tuple + - abseil/meta/type_traits + - abseil/utility/utility + - abseil/xcprivacy + - abseil/functional/function_ref (1.20240722.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/functional/any_invocable + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/hash/city (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/xcprivacy + - abseil/hash/hash (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/container/fixed_array + - abseil/functional/function_ref + - abseil/hash/city + - abseil/hash/low_level_hash + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/types/optional + - abseil/types/variant + - abseil/utility/utility + - abseil/xcprivacy + - abseil/hash/low_level_hash (1.20240722.0): + - abseil/base/config + - abseil/base/endian + - abseil/base/prefetch + - abseil/numeric/int128 + - abseil/xcprivacy + - abseil/log/absl_check (1.20240722.0): + - abseil/log/internal/check_impl + - abseil/xcprivacy + - abseil/log/absl_log (1.20240722.0): + - abseil/log/internal/log_impl + - abseil/xcprivacy + - abseil/log/absl_vlog_is_on (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/log/internal/vlog_config + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/check (1.20240722.0): + - abseil/log/internal/check_impl + - abseil/log/internal/check_op + - abseil/log/internal/conditions + - abseil/log/internal/log_message + - abseil/log/internal/strip + - abseil/xcprivacy + - abseil/log/globals (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/raw_logging_internal + - abseil/hash/hash + - abseil/log/internal/vlog_config + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/internal/append_truncated (1.20240722.0): + - abseil/base/config + - abseil/strings/strings + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/check_impl (1.20240722.0): + - abseil/base/core_headers + - abseil/log/internal/check_op + - abseil/log/internal/conditions + - abseil/log/internal/log_message + - abseil/log/internal/strip + - abseil/xcprivacy + - abseil/log/internal/check_op (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/log/internal/nullguard + - abseil/log/internal/nullstream + - abseil/log/internal/strip + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/internal/conditions (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/log/internal/voidify + - abseil/xcprivacy + - abseil/log/internal/config (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/log/internal/fnmatch (1.20240722.0): + - abseil/base/config + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/internal/format (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/log/internal/append_truncated + - abseil/log/internal/config + - abseil/log/internal/globals + - abseil/strings/str_format + - abseil/strings/strings + - abseil/time/time + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/globals (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/raw_logging_internal + - abseil/strings/strings + - abseil/time/time + - abseil/xcprivacy + - abseil/log/internal/log_impl (1.20240722.0): + - abseil/log/absl_vlog_is_on + - abseil/log/internal/conditions + - abseil/log/internal/log_message + - abseil/log/internal/strip + - abseil/xcprivacy + - abseil/log/internal/log_message (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/base/log_severity + - abseil/base/raw_logging_internal + - abseil/base/strerror + - abseil/container/inlined_vector + - abseil/debugging/examine_stack + - abseil/log/globals + - abseil/log/internal/append_truncated + - abseil/log/internal/format + - abseil/log/internal/globals + - abseil/log/internal/log_sink_set + - abseil/log/internal/nullguard + - abseil/log/internal/proto + - abseil/log/log_entry + - abseil/log/log_sink + - abseil/log/log_sink_registry + - abseil/memory/memory + - abseil/strings/strings + - abseil/time/time + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/log_sink_set (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/no_destructor + - abseil/base/raw_logging_internal + - abseil/cleanup/cleanup + - abseil/log/globals + - abseil/log/internal/config + - abseil/log/internal/globals + - abseil/log/log_entry + - abseil/log/log_sink + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/nullguard (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/log/internal/nullstream (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/internal/proto (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/strings/strings + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/strip (1.20240722.0): + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/log/internal/log_message + - abseil/log/internal/nullstream + - abseil/xcprivacy + - abseil/log/internal/vlog_config (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/no_destructor + - abseil/log/internal/fnmatch + - abseil/memory/memory + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/types/optional + - abseil/xcprivacy + - abseil/log/internal/voidify (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/log/log (1.20240722.0): + - abseil/log/internal/log_impl + - abseil/log/vlog_is_on + - abseil/xcprivacy + - abseil/log/log_entry (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/log/internal/config + - abseil/strings/strings + - abseil/time/time + - abseil/types/span + - abseil/xcprivacy + - abseil/log/log_sink (1.20240722.0): + - abseil/base/config + - abseil/log/log_entry + - abseil/xcprivacy + - abseil/log/log_sink_registry (1.20240722.0): + - abseil/base/config + - abseil/log/internal/log_sink_set + - abseil/log/log_sink + - abseil/xcprivacy + - abseil/log/vlog_is_on (1.20240722.0): + - abseil/log/absl_vlog_is_on + - abseil/xcprivacy + - abseil/memory (1.20240722.0): + - abseil/memory/memory (= 1.20240722.0) + - abseil/memory/memory (1.20240722.0): + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/meta (1.20240722.0): + - abseil/meta/type_traits (= 1.20240722.0) + - abseil/meta/type_traits (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/numeric/bits (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/numeric/int128 (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/numeric/bits + - abseil/types/compare + - abseil/xcprivacy + - abseil/numeric/representation (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/profiling/exponential_biased (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/profiling/sample_recorder (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/synchronization/synchronization + - abseil/time/time + - abseil/xcprivacy + - abseil/random/bit_gen_ref (1.20240722.0): + - abseil/base/core_headers + - abseil/base/fast_type_id + - abseil/meta/type_traits + - abseil/random/internal/distribution_caller + - abseil/random/internal/fast_uniform_bits + - abseil/random/random + - abseil/xcprivacy + - abseil/random/distributions (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/random/internal/distribution_caller + - abseil/random/internal/fast_uniform_bits + - abseil/random/internal/fastmath + - abseil/random/internal/generate_real + - abseil/random/internal/iostream_state_saver + - abseil/random/internal/traits + - abseil/random/internal/uniform_helper + - abseil/random/internal/wide_multiply + - abseil/strings/strings + - abseil/xcprivacy + - abseil/random/internal/distribution_caller (1.20240722.0): + - abseil/base/config + - abseil/base/fast_type_id + - abseil/utility/utility + - abseil/xcprivacy + - abseil/random/internal/fast_uniform_bits (1.20240722.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/random/internal/traits + - abseil/xcprivacy + - abseil/random/internal/fastmath (1.20240722.0): + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/random/internal/generate_real (1.20240722.0): + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/random/internal/fastmath + - abseil/random/internal/traits + - abseil/xcprivacy + - abseil/random/internal/iostream_state_saver (1.20240722.0): + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/xcprivacy + - abseil/random/internal/nonsecure_base (1.20240722.0): + - abseil/base/core_headers + - abseil/container/inlined_vector + - abseil/meta/type_traits + - abseil/random/internal/pool_urbg + - abseil/random/internal/salted_seed_seq + - abseil/random/internal/seed_material + - abseil/types/span + - abseil/xcprivacy + - abseil/random/internal/pcg_engine (1.20240722.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/random/internal/fastmath + - abseil/random/internal/iostream_state_saver + - abseil/xcprivacy + - abseil/random/internal/platform (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/random/internal/pool_urbg (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/random/internal/randen + - abseil/random/internal/seed_material + - abseil/random/internal/traits + - abseil/random/seed_gen_exception + - abseil/types/span + - abseil/xcprivacy + - abseil/random/internal/randen (1.20240722.0): + - abseil/base/raw_logging_internal + - abseil/random/internal/platform + - abseil/random/internal/randen_hwaes + - abseil/random/internal/randen_slow + - abseil/xcprivacy + - abseil/random/internal/randen_engine (1.20240722.0): + - abseil/base/endian + - abseil/meta/type_traits + - abseil/random/internal/iostream_state_saver + - abseil/random/internal/randen + - abseil/xcprivacy + - abseil/random/internal/randen_hwaes (1.20240722.0): + - abseil/base/config + - abseil/random/internal/platform + - abseil/random/internal/randen_hwaes_impl + - abseil/xcprivacy + - abseil/random/internal/randen_hwaes_impl (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/numeric/int128 + - abseil/random/internal/platform + - abseil/xcprivacy + - abseil/random/internal/randen_slow (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/numeric/int128 + - abseil/random/internal/platform + - abseil/xcprivacy + - abseil/random/internal/salted_seed_seq (1.20240722.0): + - abseil/container/inlined_vector + - abseil/meta/type_traits + - abseil/random/internal/seed_material + - abseil/types/optional + - abseil/types/span + - abseil/xcprivacy + - abseil/random/internal/seed_material (1.20240722.0): + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/raw_logging_internal + - abseil/random/internal/fast_uniform_bits + - abseil/strings/strings + - abseil/types/optional + - abseil/types/span + - abseil/xcprivacy + - abseil/random/internal/traits (1.20240722.0): + - abseil/base/config + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/xcprivacy + - abseil/random/internal/uniform_helper (1.20240722.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/random/internal/traits + - abseil/xcprivacy + - abseil/random/internal/wide_multiply (1.20240722.0): + - abseil/base/config + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/random/internal/traits + - abseil/xcprivacy + - abseil/random/random (1.20240722.0): + - abseil/random/distributions + - abseil/random/internal/nonsecure_base + - abseil/random/internal/pcg_engine + - abseil/random/internal/pool_urbg + - abseil/random/internal/randen_engine + - abseil/random/seed_sequences + - abseil/xcprivacy + - abseil/random/seed_gen_exception (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/random/seed_sequences (1.20240722.0): + - abseil/base/config + - abseil/base/nullability + - abseil/random/internal/pool_urbg + - abseil/random/internal/salted_seed_seq + - abseil/random/internal/seed_material + - abseil/random/seed_gen_exception + - abseil/strings/string_view + - abseil/types/span + - abseil/xcprivacy + - abseil/status/status (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/config + - abseil/base/core_headers + - abseil/base/no_destructor + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/base/strerror + - abseil/container/inlined_vector + - abseil/debugging/stacktrace + - abseil/debugging/symbolize + - abseil/functional/function_ref + - abseil/memory/memory + - abseil/strings/cord + - abseil/strings/str_format + - abseil/strings/strings + - abseil/types/optional + - abseil/types/span + - abseil/xcprivacy + - abseil/status/statusor (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/meta/type_traits + - abseil/status/status + - abseil/strings/has_ostream_operator + - abseil/strings/str_format + - abseil/strings/strings + - abseil/types/variant + - abseil/utility/utility + - abseil/xcprivacy + - abseil/strings/charset (1.20240722.0): + - abseil/base/core_headers + - abseil/strings/string_view + - abseil/xcprivacy + - abseil/strings/cord (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/container/inlined_vector + - abseil/crc/crc32c + - abseil/crc/crc_cord_state + - abseil/functional/function_ref + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/strings/cord_internal + - abseil/strings/cordz_functions + - abseil/strings/cordz_info + - abseil/strings/cordz_statistics + - abseil/strings/cordz_update_scope + - abseil/strings/cordz_update_tracker + - abseil/strings/internal + - abseil/strings/strings + - abseil/types/compare + - abseil/types/optional + - abseil/types/span + - abseil/xcprivacy + - abseil/strings/cord_internal (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/base/throw_delegate + - abseil/container/compressed_tuple + - abseil/container/container_memory + - abseil/container/inlined_vector + - abseil/container/layout + - abseil/crc/crc_cord_state + - abseil/functional/function_ref + - abseil/meta/type_traits + - abseil/strings/strings + - abseil/types/span + - abseil/xcprivacy + - abseil/strings/cordz_functions (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/profiling/exponential_biased + - abseil/xcprivacy + - abseil/strings/cordz_handle (1.20240722.0): + - abseil/base/config + - abseil/base/no_destructor + - abseil/base/raw_logging_internal + - abseil/synchronization/synchronization + - abseil/xcprivacy + - abseil/strings/cordz_info (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/container/inlined_vector + - abseil/debugging/stacktrace + - abseil/strings/cord_internal + - abseil/strings/cordz_functions + - abseil/strings/cordz_handle + - abseil/strings/cordz_statistics + - abseil/strings/cordz_update_tracker + - abseil/synchronization/synchronization + - abseil/time/time + - abseil/types/span + - abseil/xcprivacy + - abseil/strings/cordz_statistics (1.20240722.0): + - abseil/base/config + - abseil/strings/cordz_update_tracker + - abseil/xcprivacy + - abseil/strings/cordz_update_scope (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/strings/cord_internal + - abseil/strings/cordz_info + - abseil/strings/cordz_update_tracker + - abseil/xcprivacy + - abseil/strings/cordz_update_tracker (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/strings/has_ostream_operator (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/strings/internal (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/strings/str_format (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/strings/str_format_internal + - abseil/strings/string_view + - abseil/types/span + - abseil/xcprivacy + - abseil/strings/str_format_internal (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/container/fixed_array + - abseil/container/inlined_vector + - abseil/functional/function_ref + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/numeric/representation + - abseil/strings/strings + - abseil/types/optional + - abseil/types/span + - abseil/utility/utility + - abseil/xcprivacy + - abseil/strings/string_view (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/base/throw_delegate + - abseil/xcprivacy + - abseil/strings/strings (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/base/throw_delegate + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/strings/charset + - abseil/strings/internal + - abseil/strings/string_view + - abseil/xcprivacy + - abseil/synchronization/graphcycles_internal (1.20240722.0): + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/synchronization/kernel_timeout_internal (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/time/time + - abseil/xcprivacy + - abseil/synchronization/synchronization (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/debugging/stacktrace + - abseil/debugging/symbolize + - abseil/synchronization/graphcycles_internal + - abseil/synchronization/kernel_timeout_internal + - abseil/time/time + - abseil/xcprivacy + - abseil/time (1.20240722.0): + - abseil/time/internal (= 1.20240722.0) + - abseil/time/time (= 1.20240722.0) + - abseil/time/internal (1.20240722.0): + - abseil/time/internal/cctz (= 1.20240722.0) + - abseil/time/internal/cctz (1.20240722.0): + - abseil/time/internal/cctz/civil_time (= 1.20240722.0) + - abseil/time/internal/cctz/time_zone (= 1.20240722.0) + - abseil/time/internal/cctz/civil_time (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/time/internal/cctz/time_zone (1.20240722.0): + - abseil/base/config + - abseil/time/internal/cctz/civil_time + - abseil/xcprivacy + - abseil/time/time (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/time/internal/cctz/civil_time + - abseil/time/internal/cctz/time_zone + - abseil/types/optional + - abseil/xcprivacy + - abseil/types (1.20240722.0): + - abseil/types/any (= 1.20240722.0) + - abseil/types/bad_any_cast (= 1.20240722.0) + - abseil/types/bad_any_cast_impl (= 1.20240722.0) + - abseil/types/bad_optional_access (= 1.20240722.0) + - abseil/types/bad_variant_access (= 1.20240722.0) + - abseil/types/compare (= 1.20240722.0) + - abseil/types/optional (= 1.20240722.0) + - abseil/types/span (= 1.20240722.0) + - abseil/types/variant (= 1.20240722.0) + - abseil/types/any (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/fast_type_id + - abseil/meta/type_traits + - abseil/types/bad_any_cast + - abseil/utility/utility + - abseil/xcprivacy + - abseil/types/bad_any_cast (1.20240722.0): + - abseil/base/config + - abseil/types/bad_any_cast_impl + - abseil/xcprivacy + - abseil/types/bad_any_cast_impl (1.20240722.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/types/bad_optional_access (1.20240722.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/types/bad_variant_access (1.20240722.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/types/compare (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/types/optional (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/bad_optional_access + - abseil/utility/utility + - abseil/xcprivacy + - abseil/types/span (1.20240722.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/nullability + - abseil/base/throw_delegate + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/types/variant (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/types/bad_variant_access + - abseil/utility/utility + - abseil/xcprivacy + - abseil/utility/utility (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/xcprivacy (1.20240722.0) + - app_links (7.0.0): + - Flutter + - audioplayers_darwin (0.0.1): + - Flutter + - BoringSSL-GRPC (0.0.37): + - BoringSSL-GRPC/Implementation (= 0.0.37) + - BoringSSL-GRPC/Interface (= 0.0.37) + - BoringSSL-GRPC/Implementation (0.0.37): + - BoringSSL-GRPC/Interface (= 0.0.37) + - BoringSSL-GRPC/Interface (0.0.37) + - cloud_firestore (6.1.2): + - Firebase/Firestore (= 12.8.0) + - firebase_core + - Flutter + - Firebase/CoreOnly (12.8.0): + - FirebaseCore (~> 12.8.0) + - Firebase/Firestore (12.8.0): + - Firebase/CoreOnly + - FirebaseFirestore (~> 12.8.0) + - firebase_core (4.4.0): + - Firebase/CoreOnly (= 12.8.0) + - Flutter + - FirebaseAppCheckInterop (12.8.0) + - FirebaseCore (12.8.0): + - FirebaseCoreInternal (~> 12.8.0) + - GoogleUtilities/Environment (~> 8.1) + - GoogleUtilities/Logger (~> 8.1) + - FirebaseCoreExtension (12.8.0): + - FirebaseCore (~> 12.8.0) + - FirebaseCoreInternal (12.8.0): + - "GoogleUtilities/NSData+zlib (~> 8.1)" + - FirebaseFirestore (12.8.0): + - FirebaseCore (~> 12.8.0) + - FirebaseCoreExtension (~> 12.8.0) + - FirebaseFirestoreInternal (~> 12.8.0) + - FirebaseSharedSwift (~> 12.8.0) + - FirebaseFirestoreInternal (12.8.0): + - abseil/algorithm (~> 1.20240722.0) + - abseil/base (~> 1.20240722.0) + - abseil/container/flat_hash_map (~> 1.20240722.0) + - abseil/memory (~> 1.20240722.0) + - abseil/meta (~> 1.20240722.0) + - abseil/strings/strings (~> 1.20240722.0) + - abseil/time (~> 1.20240722.0) + - abseil/types (~> 1.20240722.0) + - FirebaseAppCheckInterop (~> 12.8.0) + - FirebaseCore (~> 12.8.0) + - "gRPC-C++ (~> 1.69.0)" + - gRPC-Core (~> 1.69.0) + - leveldb-library (~> 1.22) + - nanopb (~> 3.30910.0) + - FirebaseSharedSwift (12.8.0) + - Flutter (1.0.0) + - GoogleUtilities/Environment (8.1.0): + - GoogleUtilities/Privacy + - GoogleUtilities/Logger (8.1.0): + - GoogleUtilities/Environment + - GoogleUtilities/Privacy + - "GoogleUtilities/NSData+zlib (8.1.0)": + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (8.1.0) + - "gRPC-C++ (1.69.0)": + - "gRPC-C++/Implementation (= 1.69.0)" + - "gRPC-C++/Interface (= 1.69.0)" + - "gRPC-C++/Implementation (1.69.0)": + - abseil/algorithm/container (~> 1.20240722.0) + - abseil/base/base (~> 1.20240722.0) + - abseil/base/config (~> 1.20240722.0) + - abseil/base/core_headers (~> 1.20240722.0) + - abseil/base/log_severity (~> 1.20240722.0) + - abseil/base/no_destructor (~> 1.20240722.0) + - abseil/cleanup/cleanup (~> 1.20240722.0) + - abseil/container/flat_hash_map (~> 1.20240722.0) + - abseil/container/flat_hash_set (~> 1.20240722.0) + - abseil/container/inlined_vector (~> 1.20240722.0) + - abseil/flags/flag (~> 1.20240722.0) + - abseil/flags/marshalling (~> 1.20240722.0) + - abseil/functional/any_invocable (~> 1.20240722.0) + - abseil/functional/bind_front (~> 1.20240722.0) + - abseil/functional/function_ref (~> 1.20240722.0) + - abseil/hash/hash (~> 1.20240722.0) + - abseil/log/absl_check (~> 1.20240722.0) + - abseil/log/absl_log (~> 1.20240722.0) + - abseil/log/check (~> 1.20240722.0) + - abseil/log/globals (~> 1.20240722.0) + - abseil/log/log (~> 1.20240722.0) + - abseil/memory/memory (~> 1.20240722.0) + - abseil/meta/type_traits (~> 1.20240722.0) + - abseil/numeric/bits (~> 1.20240722.0) + - abseil/random/bit_gen_ref (~> 1.20240722.0) + - abseil/random/distributions (~> 1.20240722.0) + - abseil/random/random (~> 1.20240722.0) + - abseil/status/status (~> 1.20240722.0) + - abseil/status/statusor (~> 1.20240722.0) + - abseil/strings/cord (~> 1.20240722.0) + - abseil/strings/str_format (~> 1.20240722.0) + - abseil/strings/strings (~> 1.20240722.0) + - abseil/synchronization/synchronization (~> 1.20240722.0) + - abseil/time/time (~> 1.20240722.0) + - abseil/types/optional (~> 1.20240722.0) + - abseil/types/span (~> 1.20240722.0) + - abseil/types/variant (~> 1.20240722.0) + - abseil/utility/utility (~> 1.20240722.0) + - "gRPC-C++/Interface (= 1.69.0)" + - "gRPC-C++/Privacy (= 1.69.0)" + - gRPC-Core (= 1.69.0) + - "gRPC-C++/Interface (1.69.0)" + - "gRPC-C++/Privacy (1.69.0)" + - gRPC-Core (1.69.0): + - gRPC-Core/Implementation (= 1.69.0) + - gRPC-Core/Interface (= 1.69.0) + - gRPC-Core/Implementation (1.69.0): + - abseil/algorithm/container (~> 1.20240722.0) + - abseil/base/base (~> 1.20240722.0) + - abseil/base/config (~> 1.20240722.0) + - abseil/base/core_headers (~> 1.20240722.0) + - abseil/base/log_severity (~> 1.20240722.0) + - abseil/base/no_destructor (~> 1.20240722.0) + - abseil/cleanup/cleanup (~> 1.20240722.0) + - abseil/container/flat_hash_map (~> 1.20240722.0) + - abseil/container/flat_hash_set (~> 1.20240722.0) + - abseil/container/inlined_vector (~> 1.20240722.0) + - abseil/flags/flag (~> 1.20240722.0) + - abseil/flags/marshalling (~> 1.20240722.0) + - abseil/functional/any_invocable (~> 1.20240722.0) + - abseil/functional/bind_front (~> 1.20240722.0) + - abseil/functional/function_ref (~> 1.20240722.0) + - abseil/hash/hash (~> 1.20240722.0) + - abseil/log/check (~> 1.20240722.0) + - abseil/log/globals (~> 1.20240722.0) + - abseil/log/log (~> 1.20240722.0) + - abseil/memory/memory (~> 1.20240722.0) + - abseil/meta/type_traits (~> 1.20240722.0) + - abseil/numeric/bits (~> 1.20240722.0) + - abseil/random/bit_gen_ref (~> 1.20240722.0) + - abseil/random/distributions (~> 1.20240722.0) + - abseil/random/random (~> 1.20240722.0) + - abseil/status/status (~> 1.20240722.0) + - abseil/status/statusor (~> 1.20240722.0) + - abseil/strings/cord (~> 1.20240722.0) + - abseil/strings/str_format (~> 1.20240722.0) + - abseil/strings/strings (~> 1.20240722.0) + - abseil/synchronization/synchronization (~> 1.20240722.0) + - abseil/time/time (~> 1.20240722.0) + - abseil/types/optional (~> 1.20240722.0) + - abseil/types/span (~> 1.20240722.0) + - abseil/types/variant (~> 1.20240722.0) + - abseil/utility/utility (~> 1.20240722.0) + - BoringSSL-GRPC (= 0.0.37) + - gRPC-Core/Interface (= 1.69.0) + - gRPC-Core/Privacy (= 1.69.0) + - gRPC-Core/Interface (1.69.0) + - gRPC-Core/Privacy (1.69.0) + - leveldb-library (1.22.6) + - nanopb (3.30910.0): + - nanopb/decode (= 3.30910.0) + - nanopb/encode (= 3.30910.0) + - nanopb/decode (3.30910.0) + - nanopb/encode (3.30910.0) + - share_plus (0.0.1): + - Flutter + - shared_preferences_foundation (0.0.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - app_links (from `.symlinks/plugins/app_links/ios`) + - audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`) + - cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - Flutter (from `Flutter`) + - share_plus (from `.symlinks/plugins/share_plus/ios`) + - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + +SPEC REPOS: + trunk: + - abseil + - BoringSSL-GRPC + - Firebase + - FirebaseAppCheckInterop + - FirebaseCore + - FirebaseCoreExtension + - FirebaseCoreInternal + - FirebaseFirestore + - FirebaseFirestoreInternal + - FirebaseSharedSwift + - GoogleUtilities + - "gRPC-C++" + - gRPC-Core + - leveldb-library + - nanopb + +EXTERNAL SOURCES: + app_links: + :path: ".symlinks/plugins/app_links/ios" + audioplayers_darwin: + :path: ".symlinks/plugins/audioplayers_darwin/ios" + cloud_firestore: + :path: ".symlinks/plugins/cloud_firestore/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + Flutter: + :path: Flutter + share_plus: + :path: ".symlinks/plugins/share_plus/ios" + shared_preferences_foundation: + :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + +SPEC CHECKSUMS: + abseil: a05cc83bf02079535e17169a73c5be5ba47f714b + app_links: a754cbec3c255bd4bbb4d236ecc06f28cd9a7ce8 + audioplayers_darwin: ccf9c770ee768abb07e26d90af093f7bab1c12ab + BoringSSL-GRPC: dded2a44897e45f28f08ae87a55ee4bcd19bc508 + cloud_firestore: 4bd00c3464706d9e09dabac0bb8e9610456109f5 + Firebase: 9a58fdbc9d8655ed7b79a19cf9690bb007d3d46d + firebase_core: ee30637e6744af8e0c12a6a1e8a9718506ec2398 + FirebaseAppCheckInterop: ba3dc604a89815379e61ec2365101608d365cf7d + FirebaseCore: 0dbad74bda10b8fb9ca34ad8f375fb9dd3ebef7c + FirebaseCoreExtension: 6605938d51f765d8b18bfcafd2085276a252bee2 + FirebaseCoreInternal: fe5fa466aeb314787093a7dce9f0beeaad5a2a21 + FirebaseFirestore: 67f23000ca238ccbab79127ed59636a9a2689e74 + FirebaseFirestoreInternal: a0e7382af3d208898dcd1d4d52d8a7870632e881 + FirebaseSharedSwift: f57ed48f4542b2d7eb4738f4f23ba443f78b3780 + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 + "gRPC-C++": cc207623316fb041a7a3e774c252cf68a058b9e8 + gRPC-Core: 860978b7db482de8b4f5e10677216309b5ff6330 + leveldb-library: cc8b8f8e013647a295ad3f8cd2ddf49a6f19be19 + nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 + share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a + shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb + +PODFILE CHECKSUM: 3d68f7cb47d5f2fb7765407f663653c9b51100f3 + +COCOAPODS: 1.16.2 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..aebc1e5 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,740 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 481A21F320170147A2C4E761 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 844F73B2B4B7F3225946812E /* GoogleService-Info.plist */; }; + 6A17FB0E2884BC27F82BF0D8 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4867B86862DC650EC26D5F9C /* Pods_RunnerTests.framework */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 75899E66C68907C20758698A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8FE75A6C9DBE2A6E07069134 /* Pods_Runner.framework */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 05646C0A9C4C37B96E82296C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 279D4F30470762AD38B74B11 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 2C010AED17F137BAFB983605 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 4867B86862DC650EC26D5F9C /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 5C30E1EF56D9EC1CAEADBE23 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 844F73B2B4B7F3225946812E /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; + 8FE75A6C9DBE2A6E07069134 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AD38B78D2B163B673F0AF1CF /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + BE64C5FB763AC9C28B43C872 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6B037D7112EAA06171651D2D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6A17FB0E2884BC27F82BF0D8 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 75899E66C68907C20758698A /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 6ED9296BF996E6996BF311FA /* Pods */ = { + isa = PBXGroup; + children = ( + BE64C5FB763AC9C28B43C872 /* Pods-Runner.debug.xcconfig */, + 05646C0A9C4C37B96E82296C /* Pods-Runner.release.xcconfig */, + 5C30E1EF56D9EC1CAEADBE23 /* Pods-Runner.profile.xcconfig */, + 279D4F30470762AD38B74B11 /* Pods-RunnerTests.debug.xcconfig */, + 2C010AED17F137BAFB983605 /* Pods-RunnerTests.release.xcconfig */, + AD38B78D2B163B673F0AF1CF /* Pods-RunnerTests.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + 844F73B2B4B7F3225946812E /* GoogleService-Info.plist */, + 6ED9296BF996E6996BF311FA /* Pods */, + B43FAE0FE74E46C3D405043E /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + B43FAE0FE74E46C3D405043E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8FE75A6C9DBE2A6E07069134 /* Pods_Runner.framework */, + 4867B86862DC650EC26D5F9C /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 67E6B034A3B027D9C5939DE1 /* [CP] Check Pods Manifest.lock */, + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + 6B037D7112EAA06171651D2D /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + CB1B4C198C2A803D7B7DFC5E /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 17436AAE044D8222B691D94E /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + 481A21F320170147A2C4E761 /* GoogleService-Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 17436AAE044D8222B691D94E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 67E6B034A3B027D9C5939DE1 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + CB1B4C198C2A803D7B7DFC5E /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2BX6QRR7GG; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 279D4F30470762AD38B74B11 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2C010AED17F137BAFB983605 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AD38B78D2B163B673F0AF1CF /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2BX6QRR7GG; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2BX6QRR7GG; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..e3773d4 --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..6266644 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..ca0387c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..0b9663f Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..7fdac6d Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..c8df127 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..55e78b3 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..bcb9abd Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..f7d3a5b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..7fdac6d Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..58b5301 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..70e9e58 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png new file mode 100644 index 0000000..6e9b291 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png new file mode 100644 index 0000000..88601d0 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png new file mode 100644 index 0000000..67057ab Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png new file mode 100644 index 0000000..a364787 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..70e9e58 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..4fa7bc5 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png new file mode 100644 index 0000000..a1df20d Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png new file mode 100644 index 0000000..4360ee1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..137168f Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..1824f40 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..b103b70 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..f4889f9 --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + AIzaSyB77j18Jgeb9gBAEwp-uyOQvr4m-RJ_rAE + GCM_SENDER_ID + 705460445314 + PLIST_VERSION + 1 + BUNDLE_ID + com.sanza.tetraq + PROJECT_ID + tetraq-32a4a + STORAGE_BUCKET + tetraq-32a4a.firebasestorage.app + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:705460445314:ios:da11cbca5d1f6bc27b949b + + \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..b850f8e --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Tetraq + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + tetraq + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/lib/.DS_Store b/lib/.DS_Store new file mode 100644 index 0000000..78db19d Binary files /dev/null and b/lib/.DS_Store differ diff --git a/lib/core/app_colors.dart b/lib/core/app_colors.dart new file mode 100644 index 0000000..ee0cf34 --- /dev/null +++ b/lib/core/app_colors.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; + +enum AppThemeType { minimal, doodle, cyberpunk, wood } + +class ThemeColors { + final Color background; + final Color gridLine; + final Color playerRed; + final Color playerBlue; + final Color text; + + const ThemeColors({ + required this.background, + required this.gridLine, + required this.playerRed, + required this.playerBlue, + required this.text, + }); +} + +class AppColors { + static const ThemeColors minimal = ThemeColors( + background: Color(0xFFF5F7FA), gridLine: Color(0xFFCFD8DC), + playerRed: Color(0xFFE53935), playerBlue: Color(0xFF1E88E5), text: Color(0xFF263238), + ); + + static const ThemeColors doodle = ThemeColors( + background: Color(0xFFFFF9E6), gridLine: Color(0xFFB0BEC5), + playerRed: Color(0xFFD32F2F), playerBlue: Color(0xFF1565C0), text: Color(0xFF37474F), + ); + + // --- TEMA CYBERPUNK AGGIORNATO --- + static const ThemeColors cyberpunk = ThemeColors( + background: Color(0xFF0A001A), // Sfondo notte profonda + gridLine: Color(0xFF6200EA), // Viola scuro elettrico (non fa confusione con le mosse) + playerRed: Color(0xFFFF007F), // Rosa Neon (invariato) + playerBlue: Color(0xFF69F0AE), // Verde Fluo brillante! (Green Accent) + text: Color(0xFFFFFFFF), + ); + + // --- TEMA LEGNO POTENZIATO --- + static const ThemeColors wood = ThemeColors( + background: Color(0xFF905D3B), // Marrone caldo e ricco (vero legno) + gridLine: Color(0xFF4A301E), // Marrone scurissimo per i solchi + playerRed: Color(0xFFE53935), // Rosso acceso per i fiammiferi + playerBlue: Color(0xFF29B6F6), // Azzurro acceso per i fiammiferi + text: Color(0xFFFBE9E7), // Panna chiaro per contrastare lo scuro + ); + + static ThemeColors getTheme(AppThemeType type) { + switch (type) { + case AppThemeType.minimal: return minimal; + case AppThemeType.doodle: return doodle; + case AppThemeType.cyberpunk: return cyberpunk; + case AppThemeType.wood: return wood; + } + } +} \ No newline at end of file diff --git a/lib/core/constants.dart b/lib/core/constants.dart new file mode 100644 index 0000000..655d79e --- /dev/null +++ b/lib/core/constants.dart @@ -0,0 +1,11 @@ +class Constants { + // Chiavi per salvare i dati sul telefono + static const String prefThemeKey = 'selected_theme'; + static const String prefLanguageKey = 'selected_language'; + static const String prefBoardSizeKey = 'board_size'; + + // Impostazioni della scacchiera a rombo - RAGGI INCREMENTATI + static const int minBoardRadius = 2; // Ex Normale, ora è Piccola + static const int maxBoardRadius = 5; // Formato MAX, enorme + static const int defaultBoardRadius = 3; // Ora il default è più grande +} \ No newline at end of file diff --git a/lib/core/theme_manager.dart b/lib/core/theme_manager.dart new file mode 100644 index 0000000..40a6665 --- /dev/null +++ b/lib/core/theme_manager.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; +import 'app_colors.dart'; +import '../services/storage_service.dart'; + +class ThemeManager extends ChangeNotifier { + late AppThemeType _currentThemeType; + + ThemeManager() { + // Quando l'app parte, legge il tema dalla memoria! + _currentThemeType = AppThemeType.values[StorageService.instance.savedThemeIndex]; + } + + AppThemeType get currentThemeType => _currentThemeType; + ThemeColors get currentColors => AppColors.getTheme(_currentThemeType); + + void setTheme(AppThemeType type) { + _currentThemeType = type; + StorageService.instance.saveTheme(type); // Salva la scelta nel "disco fisso" + notifyListeners(); + } +} \ No newline at end of file diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart new file mode 100644 index 0000000..d2d2aae --- /dev/null +++ b/lib/firebase_options.dart @@ -0,0 +1,74 @@ +// File generated by FlutterFire CLI. +// ignore_for_file: type=lint +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for web - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + return macos; + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } + } + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyBsXO595xVITDPrRnXrW8HPQLOe7Rz4Gg4', + appId: '1:705460445314:android:4d35fef29cfd63727b949b', + messagingSenderId: '705460445314', + projectId: 'tetraq-32a4a', + storageBucket: 'tetraq-32a4a.firebasestorage.app', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyB77j18Jgeb9gBAEwp-uyOQvr4m-RJ_rAE', + appId: '1:705460445314:ios:da11cbca5d1f6bc27b949b', + messagingSenderId: '705460445314', + projectId: 'tetraq-32a4a', + storageBucket: 'tetraq-32a4a.firebasestorage.app', + iosBundleId: 'com.sanza.tetraq', + ); + + static const FirebaseOptions macos = FirebaseOptions( + apiKey: 'AIzaSyB77j18Jgeb9gBAEwp-uyOQvr4m-RJ_rAE', + appId: '1:705460445314:ios:da11cbca5d1f6bc27b949b', + messagingSenderId: '705460445314', + projectId: 'tetraq-32a4a', + storageBucket: 'tetraq-32a4a.firebasestorage.app', + iosBundleId: 'com.sanza.tetraq', + ); +} diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb new file mode 100644 index 0000000..a7ed8a0 --- /dev/null +++ b/lib/l10n/app_en.arb @@ -0,0 +1,4 @@ +{ + "appTitle": "TetraQ", + "playLocal": "PASS & PLAY (Local)" +} diff --git a/lib/l10n/app_it.arb b/lib/l10n/app_it.arb new file mode 100644 index 0000000..ff1eba0 --- /dev/null +++ b/lib/l10n/app_it.arb @@ -0,0 +1,4 @@ +{ + "appTitle": "TetraQ", + "playLocal": "PASS & PLAY (Locale)" +} diff --git a/lib/logic/ai_engine.dart b/lib/logic/ai_engine.dart new file mode 100644 index 0000000..ac31673 --- /dev/null +++ b/lib/logic/ai_engine.dart @@ -0,0 +1,155 @@ +// =========================================================================== +// FILE: lib/logic/ai_engine.dart +// =========================================================================== + +import 'dart:math'; +import '../models/game_board.dart'; + +// Modificato per tracciare anche l'effetto Swap +class _ClosureResult { + final bool closesSomething; + final int netValue; + final bool causesSwap; + _ClosureResult(this.closesSomething, this.netValue, this.causesSwap); +} + +class AIEngine { + static Line getBestMove(GameBoard board, int level) { + List availableLines = board.lines.where((l) => l.owner == Player.none && l.isPlayable).toList(); + final random = Random(); + + if (availableLines.isEmpty) return board.lines.first; + + double smartChance = 0.50 + ((level - 1) * 0.10); + if (smartChance > 1.0) smartChance = 1.0; + + bool beSmart = random.nextDouble() < smartChance; + + // Calcolo punteggi attuali per valutare lo SWAP + int myScore = board.currentPlayer == Player.red ? board.scoreRed : board.scoreBlue; + int oppScore = board.currentPlayer == Player.red ? board.scoreBlue : board.scoreRed; + + List goodClosingMoves = []; + List badClosingMoves = []; + + for (var line in availableLines) { + var result = _checkClosure(board, line); + if (result.closesSomething) { + if (result.causesSwap) { + // SE L'IA STA PERDENDO -> Lo Swap è un'ottima mossa! + // SE L'IA STA VINCENDO O PAREGGIANDO -> Lo Swap è una pessima mossa! + if (myScore < oppScore) { + goodClosingMoves.add(line); + } else { + badClosingMoves.add(line); + } + } else { + // Normale valutazione dei punti + if (result.netValue >= 0) { + goodClosingMoves.add(line); + } else { + badClosingMoves.add(line); + } + } + } + } + + // --- REGOLA 1: Chiudere i quadrati vantaggiosi --- + if (goodClosingMoves.isNotEmpty) { + if (beSmart || random.nextDouble() < 0.70) { + return goodClosingMoves[random.nextInt(goodClosingMoves.length)]; + } + } + + // --- REGOLA 2: Mosse Sicure --- + List safeMoves = []; + for (var line in availableLines) { + if (!badClosingMoves.contains(line) && !goodClosingMoves.contains(line) && _isSafeMove(board, line, myScore, oppScore)) { + safeMoves.add(line); + } + } + + if (safeMoves.isNotEmpty) { + if (beSmart) { + return safeMoves[random.nextInt(safeMoves.length)]; + } else { + if (random.nextDouble() < 0.5) { + return safeMoves[random.nextInt(safeMoves.length)]; + } + } + } + + // --- REGOLA 3: Scegliere il male minore --- + if (beSmart) { + List riskyButNotTerrible = availableLines.where((l) => !badClosingMoves.contains(l) && !goodClosingMoves.contains(l)).toList(); + if (riskyButNotTerrible.isNotEmpty) { + return riskyButNotTerrible[random.nextInt(riskyButNotTerrible.length)]; + } + } + + List nonTerribleMoves = availableLines.where((l) => !badClosingMoves.contains(l)).toList(); + if (nonTerribleMoves.isNotEmpty) { + return nonTerribleMoves[random.nextInt(nonTerribleMoves.length)]; + } + + return availableLines[random.nextInt(availableLines.length)]; + } + + static _ClosureResult _checkClosure(GameBoard board, Line line) { + int netValue = 0; + bool closesSomething = false; + bool causesSwap = false; + + for (var box in board.boxes) { + if (box.type == BoxType.invisible) continue; + + if (box.top == line || box.bottom == line || box.left == line || box.right == line) { + int linesCount = 0; + if (box.top.owner != Player.none || box.top == line) linesCount++; + if (box.bottom.owner != Player.none || box.bottom == line) linesCount++; + if (box.left.owner != Player.none || box.left == line) linesCount++; + if (box.right.owner != Player.none || box.right == line) linesCount++; + + if (linesCount == 4) { + closesSomething = true; + netValue += box.value; + if (box.type == BoxType.swap) causesSwap = true; + } + } + } + return _ClosureResult(closesSomething, netValue, causesSwap); + } + + static bool _isSafeMove(GameBoard board, Line line, int myScore, int oppScore) { + for (var box in board.boxes) { + if (box.type == BoxType.invisible) continue; + + if (box.top == line || box.bottom == line || box.left == line || box.right == line) { + int currentLinesCount = 0; + if (box.top.owner != Player.none) currentLinesCount++; + if (box.bottom.owner != Player.none) currentLinesCount++; + if (box.left.owner != Player.none) currentLinesCount++; + if (box.right.owner != Player.none) currentLinesCount++; + + if (currentLinesCount == 2) { + // La Bomba è sempre sicura da lasciare all'avversario + if (box.type == BoxType.bomb) { + continue; + } + // IL TRANELLO PERFETTO: Se stiamo PERDENDO, lasciare un quadrato Swap a 3 lati + // costringerà l'avversario a prenderlo e a ridarci la sua vittoria! + if (box.type == BoxType.swap) { + if (myScore < oppScore) { + continue; // È sicuro e strategico! + } else { + return false; // Se stiamo vincendo non dobbiamo MAI lasciare uno Swap! + } + } + + return false; + } + } + } + return true; + } +} \ No newline at end of file diff --git a/lib/logic/game_controller.dart b/lib/logic/game_controller.dart new file mode 100644 index 0000000..9d54460 --- /dev/null +++ b/lib/logic/game_controller.dart @@ -0,0 +1,440 @@ +// =========================================================================== +// FILE: lib/logic/game_controller.dart +// =========================================================================== + +import 'dart:async'; +import 'dart:math'; +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import '../models/game_board.dart'; +import 'ai_engine.dart'; +import '../services/audio_service.dart'; +import '../services/storage_service.dart'; +import '../services/multiplayer_service.dart'; +import '../core/app_colors.dart'; + +class GameController extends ChangeNotifier { + late GameBoard board; + bool isVsCPU = false; + bool isCPUThinking = false; + + bool isOnline = false; + String? roomCode; + bool isHost = false; + StreamSubscription? _onlineSubscription; + + bool opponentLeft = false; + bool _hasSavedResult = false; + + Timer? _blitzTimer; + int timeLeft = 15; + final int maxTime = 15; + + bool isTimeMode = true; + + String effectText = ''; + Color effectColor = Colors.transparent; + Timer? _effectTimer; + + // --- VARIABILI EMOJI E RIVINCITA --- + String? myReaction; + String? opponentReaction; + Timer? _myReactionTimer; + Timer? _oppReactionTimer; + bool rematchRequested = false; + bool opponentWantsRematch = false; + + Player get myPlayer => isHost ? Player.red : Player.blue; + bool get isGameOver => board.isGameOver; + + int cpuLevel = 1; + int currentMatchLevel = 1; + int? currentSeed; + AppThemeType _activeTheme = AppThemeType.cyberpunk; + + String onlineHostName = "ROSSO"; + String onlineGuestName = "BLU"; + ArenaShape onlineShape = ArenaShape.classic; + + GameController({int radius = 3}) { + cpuLevel = StorageService.instance.cpuLevel; + startNewGame(radius); + } + + void startNewGame(int radius, {bool vsCPU = false, bool isOnline = false, String? roomCode, bool isHost = false, ArenaShape shape = ArenaShape.classic, bool timeMode = true}) { + _onlineSubscription?.cancel(); + _onlineSubscription = null; + _blitzTimer?.cancel(); + _effectTimer?.cancel(); + effectText = ''; + _hasSavedResult = false; + + myReaction = null; + opponentReaction = null; + rematchRequested = false; + opponentWantsRematch = false; + + this.isVsCPU = vsCPU; + this.isOnline = isOnline; + this.roomCode = roomCode; + this.isHost = isHost; + this.isTimeMode = timeMode; + + onlineShape = shape; + int levelToUse = isOnline ? (currentMatchLevel == 1 ? 2 : currentMatchLevel) : cpuLevel; + + board = GameBoard(radius: radius, level: levelToUse, seed: currentSeed, shape: onlineShape); + + // FIX: Assicuriamoci che a inizio partita il turno sia sempre del Rosso! + board.currentPlayer = Player.red; + + isCPUThinking = false; + opponentLeft = false; + + if (this.isOnline && this.roomCode != null) { + _listenToOnlineGame(this.roomCode!); + } + + _startTimer(); + notifyListeners(); + } + + // --- METODI EMOJI E RIVINCITA --- + void sendReaction(String reaction) { + if (!isOnline || roomCode == null) return; + MultiplayerService().sendReaction(roomCode!, isHost, reaction); + _showReaction(true, reaction); + } + + void requestRematch() { + if (!isOnline || roomCode == null) return; + rematchRequested = true; + notifyListeners(); + MultiplayerService().requestRematch(roomCode!, isHost); + } + + void _showReaction(bool isMe, String reaction) { + if (isMe) { + myReaction = reaction; + _myReactionTimer?.cancel(); + // MODIFICA: Timer impostato a 4 secondi + _myReactionTimer = Timer(const Duration(seconds: 4), () { + myReaction = null; + notifyListeners(); + }); + } else { + opponentReaction = reaction; + _oppReactionTimer?.cancel(); + // MODIFICA: Timer impostato a 4 secondi + _oppReactionTimer = Timer(const Duration(seconds: 4), () { + opponentReaction = null; + notifyListeners(); + }); + } + notifyListeners(); + } + // -------------------------------- + + void triggerSpecialEffect(String text, Color color) { + effectText = text; + effectColor = color; + notifyListeners(); + _effectTimer?.cancel(); + _effectTimer = Timer(const Duration(milliseconds: 1200), () { effectText = ''; notifyListeners(); }); + } + + void _playEffects(List newClosed, {required bool isOpponent}) { + if (newClosed.isEmpty) { + AudioService.instance.playLineSfx(_activeTheme); + if (!isOpponent) HapticFeedback.lightImpact(); + } else { + bool isGold = newClosed.any((b) => b.type == BoxType.gold); + bool isBomb = newClosed.any((b) => b.type == BoxType.bomb); + bool isSwap = newClosed.any((b) => b.type == BoxType.swap); + + if (isSwap) { + // Usa temporaneamente playBonusSfx per lo swap, o un suono dedicato se lo aggiungerai + AudioService.instance.playBonusSfx(); + triggerSpecialEffect("SCAMBIO!", Colors.purpleAccent); + HapticFeedback.heavyImpact(); + } else if (isGold) { + AudioService.instance.playBonusSfx(); triggerSpecialEffect("+2", Colors.amber); HapticFeedback.heavyImpact(); + } else if (isBomb) { + AudioService.instance.playBombSfx(); triggerSpecialEffect("-1", Colors.redAccent); HapticFeedback.heavyImpact(); + } else { + AudioService.instance.playBoxSfx(_activeTheme); HapticFeedback.heavyImpact(); + } + } + } + + void _startTimer() { + _blitzTimer?.cancel(); + timeLeft = maxTime; + + if (!isTimeMode) { + notifyListeners(); + return; + } + + _blitzTimer = Timer.periodic(const Duration(seconds: 1), (timer) { + if (isGameOver || isCPUThinking) { timer.cancel(); return; } + + if (timeLeft > 0) { + timeLeft--; + notifyListeners(); + } else { + timer.cancel(); + if (!isOnline || board.currentPlayer == myPlayer) { + _handleTimeOut(); + } + } + }); + } + + void _handleTimeOut() { + if (!isTimeMode) return; + + if (isOnline) { + Line randomMove = AIEngine.getBestMove(board, 5); + handleLineTap(randomMove, _activeTheme, forced: true); + } + else if (isVsCPU && board.currentPlayer == Player.red) { + Line randomMove = AIEngine.getBestMove(board, cpuLevel); + handleLineTap(randomMove, _activeTheme, forced: true); + } + else if (!isVsCPU) { + Line randomMove = AIEngine.getBestMove(board, 5); + handleLineTap(randomMove, _activeTheme, forced: true); + } + } + + void disconnectOnlineGame() { + _onlineSubscription?.cancel(); + _onlineSubscription = null; + _blitzTimer?.cancel(); + _effectTimer?.cancel(); + _myReactionTimer?.cancel(); + _oppReactionTimer?.cancel(); + + if (isOnline && roomCode != null) { + FirebaseFirestore.instance.collection('games').doc(roomCode).update({'status': 'abandoned'}).catchError((e) => null); + } + + isOnline = false; + roomCode = null; + currentMatchLevel = 1; + currentSeed = null; + } + + @override + void dispose() { disconnectOnlineGame(); super.dispose(); } + + void _listenToOnlineGame(String code) { + _onlineSubscription = FirebaseFirestore.instance.collection('games').doc(code).snapshots().listen((doc) { + if (!doc.exists) return; + + var data = doc.data() as Map; + + onlineHostName = data['hostName'] ?? "ROSSO"; + onlineGuestName = (data['guestName'] != null && data['guestName'] != '') ? data['guestName'] : "BLU"; + + if (data['status'] == 'abandoned' && !board.isGameOver && !opponentLeft) { + opponentLeft = true; notifyListeners(); return; + } + + // --- ASCOLTO EMOJI E RIVINCITA --- + String? p1React = data['p1_reaction']; + String? p2React = data['p2_reaction']; + + if (isHost && p2React != null && p2React != opponentReaction) { + _showReaction(false, p2React); + } else if (!isHost && p1React != null && p1React != opponentReaction) { + _showReaction(false, p1React); + } + + bool p1Rematch = data['p1_rematch'] ?? false; + bool p2Rematch = data['p2_rematch'] ?? false; + opponentWantsRematch = isHost ? p2Rematch : p1Rematch; + + // FIX: Rilevamento inizio nuova partita dopo rivincita + // Se il server ha resettato (status: playing, mosse: vuote) e noi avevamo chiesto rivincita + if (data['status'] == 'playing' && (data['moves'] as List).isEmpty && rematchRequested) { + currentSeed = data['seed']; + startNewGame(data['radius'], isOnline: true, roomCode: roomCode, isHost: isHost, shape: ArenaShape.values.firstWhere((e) => e.name == data['shape']), timeMode: data['timeMode']); + return; // Evitiamo di processare le mosse vuote + } + + if (p1Rematch && p2Rematch && isHost && data['status'] != 'playing') { + currentMatchLevel++; + int newSeed = DateTime.now().millisecondsSinceEpoch % 1000000; + final rand = Random(); + int newRadius = rand.nextInt(4) + 3; + ArenaShape newShape = ArenaShape.values[rand.nextInt(ArenaShape.values.length)]; + MultiplayerService().resetMatch(roomCode!, newRadius, newShape.name, newSeed); + } + // --------------------------------- + + List moves = data['moves'] ?? []; + int hostLevel = data['matchLevel'] ?? 1; + int? hostSeed = data['seed']; + int hostRadius = data['radius'] ?? board.radius; + + String shapeStr = data['shape'] ?? 'classic'; + ArenaShape hostShape = ArenaShape.values.firstWhere((e) => e.name == shapeStr, orElse: () => ArenaShape.classic); + onlineShape = hostShape; + + isTimeMode = data['timeMode'] ?? true; + + // FIX: Non resettare la board se le mosse non sono a 0 e stiamo solo aspettando la rivincita + if (!rematchRequested && (hostLevel > currentMatchLevel || (isOnline && currentSeed == null && hostSeed != null) || (hostSeed != null && hostSeed != currentSeed))) { + currentMatchLevel = hostLevel; currentSeed = hostSeed; + int levelToUse = (currentMatchLevel == 1) ? 2 : currentMatchLevel; + + board = GameBoard(radius: hostRadius, level: levelToUse, seed: currentSeed, shape: onlineShape); + board.currentPlayer = Player.red; // FIX Turno Iniziale + isCPUThinking = false; notifyListeners(); return; + } + + int firebaseMovesCount = moves.length; + int localMovesCount = board.lines.where((l) => l.owner != Player.none).length; + + if (firebaseMovesCount == 0 && localMovesCount > 0 && !rematchRequested) { + int levelToUse = (currentMatchLevel == 1) ? 2 : currentMatchLevel; + board = GameBoard(radius: hostRadius, level: levelToUse, seed: currentSeed, shape: onlineShape); + board.currentPlayer = Player.red; // FIX Turno Iniziale + notifyListeners(); return; + } + + if (firebaseMovesCount > localMovesCount) { + bool newMovesApplied = false; + + for (int i = localMovesCount; i < firebaseMovesCount; i++) { + var m = moves[i]; Line? lineToPlay; + for (var line in board.lines) { + if ((line.p1.x == m['x1'] && line.p1.y == m['y1'] && line.p2.x == m['x2'] && line.p2.y == m['y2']) || + (line.p1.x == m['x2'] && line.p1.y == m['y2'] && line.p2.x == m['x1'] && line.p2.y == m['y1'])) { + lineToPlay = line; break; + } + } + if (lineToPlay != null && lineToPlay.owner == Player.none) { + Player playerFromFirebase = (m['player'] == 'red') ? Player.red : Player.blue; + bool isOpponentMove = (playerFromFirebase != myPlayer); + List closedBefore = board.boxes.where((b) => b.owner != Player.none).toList(); + + // FIX: Forziamo la mossa usando il giocatore indicato da Firebase + board.playMove(lineToPlay, forcedPlayer: playerFromFirebase); + newMovesApplied = true; + + List newClosed = board.boxes.where((b) => b.owner != Player.none && !closedBefore.contains(b)).toList(); + if (isOpponentMove) _playEffects(newClosed, isOpponent: true); + } + } + + if (newMovesApplied) { + // FIX: Sincronizzazione esplicita del turno basata su Firebase + String expectedTurnStr = data['turn'] ?? 'red'; + Player expectedTurn = expectedTurnStr == 'red' ? Player.red : Player.blue; + + if (!board.isGameOver && board.currentPlayer != expectedTurn) { + board.currentPlayer = expectedTurn; + } + + _startTimer(); + } + + if (board.isGameOver) _saveMatchResult(); + notifyListeners(); + } + }); + } + + void handleLineTap(Line line, AppThemeType theme, {bool forced = false}) { + if ((isCPUThinking || board.isGameOver || opponentLeft) && !forced) return; + + // Controllo Turno + if (isOnline && board.currentPlayer != myPlayer && !forced) return; + + _activeTheme = theme; + List closedBefore = board.boxes.where((b) => b.owner != Player.none).toList(); + + if (board.playMove(line)) { + List newClosed = board.boxes.where((b) => b.owner != Player.none && !closedBefore.contains(b)).toList(); + if (!forced) _playEffects(newClosed, isOpponent: false); + + _startTimer(); notifyListeners(); + + if (isOnline && roomCode != null) { + Map moveData = { + 'x1': line.p1.x, 'y1': line.p1.y, 'x2': line.p2.x, 'y2': line.p2.y, + 'player': myPlayer == Player.red ? 'red' : 'blue' + }; + + // FIX: Invia anche il currentPlayer aggiornato a Firebase per mantenere tutti sincronizzati + String nextTurnStr = board.currentPlayer == Player.red ? 'red' : 'blue'; + + FirebaseFirestore.instance.collection('games').doc(roomCode).update({ + 'moves': FieldValue.arrayUnion([moveData]), + 'turn': nextTurnStr + }).catchError((e) => debugPrint("Errore: $e")); + + if (board.isGameOver) { + _saveMatchResult(); + if (isHost) FirebaseFirestore.instance.collection('games').doc(roomCode).update({'status': 'finished'}); + } + + } else { + if (board.isGameOver) _saveMatchResult(); + else if (isVsCPU && board.currentPlayer == Player.blue) _checkCPUTurn(); + } + } + } + + void _checkCPUTurn() async { + if (isVsCPU && board.currentPlayer == Player.blue && !board.isGameOver) { + isCPUThinking = true; _blitzTimer?.cancel(); notifyListeners(); + await Future.delayed(const Duration(milliseconds: 600)); + + if (!board.isGameOver) { + List closedBefore = board.boxes.where((b) => b.owner != Player.none).toList(); + Line bestMove = AIEngine.getBestMove(board, cpuLevel); + board.playMove(bestMove); + + List newClosed = board.boxes.where((b) => b.owner != Player.none && !closedBefore.contains(b)).toList(); + _playEffects(newClosed, isOpponent: true); + + isCPUThinking = false; _startTimer(); notifyListeners(); + + if (board.isGameOver) _saveMatchResult(); + else _checkCPUTurn(); + } + } + } + + void _saveMatchResult() { + if (_hasSavedResult) return; + _hasSavedResult = true; + + String myRealName = StorageService.instance.playerName; + if (myRealName.isEmpty) myRealName = "IO"; + + if (isOnline) { + String oppName = isHost ? onlineGuestName : onlineHostName; + int myScore = isHost ? board.scoreRed : board.scoreBlue; + int oppScore = isHost ? board.scoreBlue : board.scoreRed; + StorageService.instance.saveMatchToHistory(myName: myRealName, opponent: oppName, myScore: myScore, oppScore: oppScore, isOnline: true); + } else if (isVsCPU) { + int myScore = board.scoreRed; int cpuScore = board.scoreBlue; + if (myScore > cpuScore) StorageService.instance.addWin(); + else if (cpuScore > myScore) StorageService.instance.addLoss(); + StorageService.instance.saveMatchToHistory(myName: myRealName, opponent: "CPU (Liv. $cpuLevel)", myScore: myScore, oppScore: cpuScore, isOnline: false); + } else { + StorageService.instance.saveMatchToHistory(myName: myRealName, opponent: "Ospite (Locale)", myScore: board.scoreRed, oppScore: board.scoreBlue, isOnline: false); + } + } + + void increaseLevelAndRestart() { + cpuLevel++; StorageService.instance.saveCpuLevel(cpuLevel); + startNewGame(board.radius, vsCPU: true, shape: board.shape, timeMode: isTimeMode); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..1b9a7bb --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'core/theme_manager.dart'; +import 'logic/game_controller.dart'; +import 'ui/home/home_screen.dart'; +import 'services/storage_service.dart'; // <-- Importiamo il servizio +import 'package:firebase_core/firebase_core.dart'; +import 'firebase_options.dart'; + +void main() async { + // Assicuriamoci che i motori di Flutter siano pronti + WidgetsFlutterBinding.ensureInitialized(); + + // 1. Accendiamo Firebase! (Questo ti era sfuggito) + await Firebase.initializeApp( + options: DefaultFirebaseOptions.currentPlatform, + ); + + // 2. Accendiamo la Memoria Locale! + await StorageService.instance.init(); + + runApp( + MultiProvider( + providers: [ + ChangeNotifierProvider(create: (_) => ThemeManager()), + ChangeNotifierProvider(create: (_) => GameController()), + ], + child: const TetraQApp(), + ), + ); +} + +class TetraQApp extends StatelessWidget { + const TetraQApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'TetraQ', + debugShowCheckedModeBanner: false, + theme: ThemeData( + fontFamily: 'Roboto', + useMaterial3: true, + ), + home: const HomeScreen(), + ); + } +} \ No newline at end of file diff --git a/lib/models/game_board.dart b/lib/models/game_board.dart new file mode 100644 index 0000000..ed2c081 --- /dev/null +++ b/lib/models/game_board.dart @@ -0,0 +1,245 @@ +// =========================================================================== +// FILE: lib/models/game_board.dart +// =========================================================================== + +import 'dart:math'; + +enum Player { red, blue, none } +enum BoxType { normal, gold, bomb, invisible, swap } + +// --- AGGIUNTO 'chaos' --- +enum ArenaShape { classic, cross, donut, hourglass, chaos } + +class Dot { + final int x; + final int y; + Dot(this.x, this.y); + + @override + bool operator ==(Object other) => identical(this, other) || other is Dot && runtimeType == other.runtimeType && x == other.x && y == other.y; + @override + int get hashCode => x.hashCode ^ y.hashCode; +} + +class Line { + final Dot p1; + final Dot p2; + Player owner = Player.none; + bool isPlayable = false; + + Line(this.p1, this.p2); + + bool connects(Dot a, Dot b) { return (p1 == a && p2 == b) || (p1 == b && p2 == a); } +} + +class Box { + final int x; + final int y; + Player owner = Player.none; + late Line top, bottom, left, right; + BoxType type = BoxType.normal; + + Box(this.x, this.y); + + bool isClosed() { + if (type == BoxType.invisible) return false; + return top.owner != Player.none && bottom.owner != Player.none && left.owner != Player.none && right.owner != Player.none; + } + + int get value { + if (type == BoxType.gold) return 2; + if (type == BoxType.bomb) return -1; + if (type == BoxType.swap) return 0; + return 1; + } +} + +class GameBoard { + final int radius; + final int level; + final int? seed; + final ArenaShape shape; + + List dots = []; + List lines = []; + List boxes = []; + + Player currentPlayer = Player.red; + int scoreRed = 0; + int scoreBlue = 0; + bool isGameOver = false; + + Line? lastMove; + + GameBoard({required this.radius, this.level = 1, this.seed, this.shape = ArenaShape.classic}) { + _generateBoard(); + } + + void _generateBoard() { + int size = radius * 2 + 1; + final random = seed != null ? Random(seed) : Random(); + + // Se è Caos, decidiamo quale algoritmo usare in base al seed + int chaosAlgorithm = random.nextInt(5); + + dots.clear(); + lines.clear(); + boxes.clear(); + lastMove = null; + + for (int y = 0; y < size; y++) { + for (int x = 0; x < size; x++) { + var box = Box(x, y); + + int dx = (x - radius).abs(); + int dy = (y - radius).abs(); + + bool isVisible = (dx + dy) <= radius; + + if (isVisible) { + switch (shape) { + case ArenaShape.classic: + break; + case ArenaShape.cross: + int spessoreBraccio = radius > 3 ? 1 : 0; + if (dx > spessoreBraccio && dy > spessoreBraccio) isVisible = false; + break; + case ArenaShape.donut: + int dimensioneBuco = radius > 3 ? 2 : 1; + if ((dx + dy) <= dimensioneBuco) isVisible = false; + break; + case ArenaShape.hourglass: + if (dx > dy) isVisible = false; + if (x == radius && y == radius) isVisible = true; + break; + case ArenaShape.chaos: + // --- GENERATORE PROCEDURALE (IL CAOS) --- + // Essendo basato su dx e dy, genererà sempre forme simmetriche a 4 vie! + if (chaosAlgorithm == 0) { + // Modello "Rete Frattale": Rimuove blocchi basati su operatori bitwise + if ((dx & dy) != 0) isVisible = false; + } else if (chaosAlgorithm == 1) { + // Modello "Quattro Pilastri": Svuota lunghe linee ma salva i centri + if (dx == 1 || dy == 1) { + if ((dx + dy) > 2 && (dx + dy) < radius) isVisible = false; + } + } else if (chaosAlgorithm == 2) { + // Modello "X-Treme": Taglia le diagonali perfette + if (dx == dy && dx > 0 && dx < radius) isVisible = false; + } else if (chaosAlgorithm == 3) { + // Modello "Scacchiera Nucleare": Alternanza precisa + if (dx % 2 == 1 && dy % 2 == 1) isVisible = false; + } else if (chaosAlgorithm == 4) { + // Modello "Anelli Frammentati": Buca gli anelli pari + if ((dx + dy) % 2 == 0 && (dx + dy) > 0) { + if (dx != 0 && dy != 0) isVisible = false; + } + } + // Assicuriamoci che il punto centrale esista quasi sempre per connettere la mappa + if (dx == 0 && dy == 0) isVisible = true; + break; + } + } + + if (!isVisible) { + box.type = BoxType.invisible; + } else if (level > 1) { + double chance = random.nextDouble(); + if (chance < 0.10) { + box.type = BoxType.gold; + } else if (chance > 0.90) { + box.type = BoxType.bomb; + } else if (level >= 5 && chance > 0.85 && chance <= 0.90) { + box.type = BoxType.swap; + } + } + boxes.add(box); + } + } + + // Costruzione Linee (Identico a prima) + for (var box in boxes) { + Dot tl = _getOrAddDot(box.x, box.y); + Dot tr = _getOrAddDot(box.x + 1, box.y); + Dot bl = _getOrAddDot(box.x, box.y + 1); + Dot br = _getOrAddDot(box.x + 1, box.y + 1); + + box.top = _getOrAddLine(tl, tr); + box.bottom = _getOrAddLine(bl, br); + box.left = _getOrAddLine(tl, bl); + box.right = _getOrAddLine(tr, br); + + if (box.type != BoxType.invisible) { + box.top.isPlayable = true; + box.bottom.isPlayable = true; + box.left.isPlayable = true; + box.right.isPlayable = true; + } + } + } + + Dot _getOrAddDot(int x, int y) { + for (var dot in dots) { if (dot.x == x && dot.y == y) return dot; } + var newDot = Dot(x, y); + dots.add(newDot); + return newDot; + } + + Line _getOrAddLine(Dot a, Dot b) { + for (var line in lines) { if (line.connects(a, b)) return line; } + var newLine = Line(a, b); + lines.add(newLine); + return newLine; + } + + bool playMove(Line lineToPlay, {Player? forcedPlayer}) { + if (isGameOver) return false; + + Player playerMakingMove = forcedPlayer ?? currentPlayer; + Line? actualLine; + for (var l in lines) { + if (l.connects(lineToPlay.p1, lineToPlay.p2)) { + actualLine = l; break; + } + } + + if (actualLine == null || actualLine.owner != Player.none || !actualLine.isPlayable) return false; + + actualLine.owner = playerMakingMove; + lastMove = actualLine; + + bool boxedClosed = false; + bool triggeredSwap = false; + + for (var box in boxes) { + if (box.owner == Player.none && box.isClosed()) { + box.owner = playerMakingMove; + boxedClosed = true; + + if (playerMakingMove == Player.red) { scoreRed += box.value; } + else { scoreBlue += box.value; } + + if (box.type == BoxType.swap) { + triggeredSwap = true; + } + } + } + + if (triggeredSwap) { + int temp = scoreRed; + scoreRed = scoreBlue; + scoreBlue = temp; + } + + if (lines.where((l) => l.isPlayable).every((l) => l.owner != Player.none)) { isGameOver = true; } + + if (forcedPlayer == null) { + if (!boxedClosed && !isGameOver) { currentPlayer = (currentPlayer == Player.red) ? Player.blue : Player.red; } + } else { + if (!boxedClosed && !isGameOver) { currentPlayer = (forcedPlayer == Player.red) ? Player.blue : Player.red; } + else { currentPlayer = forcedPlayer; } + } + + return true; + } +} \ No newline at end of file diff --git a/lib/models/player_info.dart b/lib/models/player_info.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/services/audio_service.dart b/lib/services/audio_service.dart new file mode 100644 index 0000000..7475c84 --- /dev/null +++ b/lib/services/audio_service.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:audioplayers/audioplayers.dart'; +import '../core/app_colors.dart'; + +class AudioService extends ChangeNotifier { + static final AudioService instance = AudioService._internal(); + AudioService._internal(); + + bool isMuted = false; + final AudioPlayer _sfxPlayer = AudioPlayer(); + + void toggleMute() { + isMuted = !isMuted; + notifyListeners(); + } + + void playLineSfx(AppThemeType theme) async { + if (isMuted) return; + String file = ''; + switch (theme) { + case AppThemeType.minimal: file = 'minimal_line.wav'; break; + case AppThemeType.doodle: + case AppThemeType.wood: + file = 'doodle_line.wav'; break; + case AppThemeType.cyberpunk: file = 'cyber_line.wav'; break; + } + await _sfxPlayer.play(AssetSource('audio/sfx/$file')); + } + + void playBoxSfx(AppThemeType theme) async { + if (isMuted) return; + String file = ''; + switch (theme) { + case AppThemeType.minimal: file = 'minimal_box.wav'; break; + case AppThemeType.doodle: + case AppThemeType.wood: + file = 'doodle_box.wav'; break; + case AppThemeType.cyberpunk: file = 'cyber_box.wav'; break; + } + await _sfxPlayer.play(AssetSource('audio/sfx/$file')); + } + + // --- NUOVI EFFETTI SPECIALI --- + void playBonusSfx() async { + if (isMuted) return; + // Assicurati di aggiungere questo file nella cartella assets/audio/sfx/ + await _sfxPlayer.play(AssetSource('audio/sfx/bonus.wav')); + } + + void playBombSfx() async { + if (isMuted) return; + // Assicurati di aggiungere questo file nella cartella assets/audio/sfx/ + await _sfxPlayer.play(AssetSource('audio/sfx/bomb.wav')); + } +} \ No newline at end of file diff --git a/lib/services/firebase_service.dart b/lib/services/firebase_service.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/services/multiplayer_service.dart b/lib/services/multiplayer_service.dart new file mode 100644 index 0000000..6307a98 --- /dev/null +++ b/lib/services/multiplayer_service.dart @@ -0,0 +1,113 @@ +// =========================================================================== +// FILE: lib/services/multiplayer_service.dart +// =========================================================================== + +import 'dart:math'; +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:flutter/material.dart'; +import 'package:share_plus/share_plus.dart'; + +class MultiplayerService { + final FirebaseFirestore _firestore = FirebaseFirestore.instance; + + CollectionReference get _gamesCollection => _firestore.collection('games'); + + Future createGameRoom(int boardRadius, String hostName, String shapeName, bool isTimeMode) async { + String roomCode = _generateRoomCode(); + int randomSeed = Random().nextInt(1000000); + + await _gamesCollection.doc(roomCode).set({ + 'status': 'waiting', + 'radius': boardRadius, + 'createdAt': FieldValue.serverTimestamp(), + 'players': ['host'], + 'turn': 'host', + 'moves': [], + 'seed': randomSeed, + 'hostName': hostName, + 'guestName': '', + 'shape': shapeName, + 'timeMode': isTimeMode, + // Nuovi campi per Emojis e Rivincita + 'p1_reaction': null, + 'p2_reaction': null, + 'p1_rematch': false, + 'p2_rematch': false, + }); + + return roomCode; + } + + Future?> joinGameRoom(String roomCode, String guestName) async { + DocumentSnapshot doc = await _gamesCollection.doc(roomCode).get(); + + if (doc.exists && doc['status'] == 'waiting') { + await _gamesCollection.doc(roomCode).update({ + 'status': 'playing', + 'players': FieldValue.arrayUnion(['guest']), + 'guestName': guestName, + }); + return doc.data() as Map; + } + return null; + } + + void shareInviteLink(String roomCode) { + String message = "Ehi! Giochiamo a TetraQ? 🎮\nCopia questo intero messaggio e apri l'app per entrare direttamente, oppure inserisci manualmente il codice: $roomCode"; + Share.share(message); + } + + Stream listenToRoom(String roomCode) { + return _gamesCollection.doc(roomCode).snapshots(); + } + + String _generateRoomCode() { + const chars = 'ACDEFGHJKLMNPQRSTUVWXYZ2345679'; + final random = Random(); + return String.fromCharCodes(Iterable.generate( + 5, (_) => chars.codeUnitAt(random.nextInt(chars.length)), + )); + } + + // --- NUOVI METODI PER REAZIONI E RIVINCITA --- + Future sendReaction(String roomCode, bool isHost, String reaction) async { + try { + String prefix = isHost ? 'p1' : 'p2'; + await _gamesCollection.doc(roomCode).update({ + '${prefix}_reaction': reaction, + '${prefix}_reaction_time': FieldValue.serverTimestamp(), + }); + } catch (e) { + debugPrint("Errore invio reazione: $e"); + } + } + + Future requestRematch(String roomCode, bool isHost) async { + try { + String prefix = isHost ? 'p1' : 'p2'; + await _gamesCollection.doc(roomCode).update({ + '${prefix}_rematch': true, + }); + } catch (e) { + debugPrint("Errore richiesta rivincita: $e"); + } + } + + Future resetMatch(String roomCode, int newRadius, String newShape, int newSeed) async { + try { + await _gamesCollection.doc(roomCode).update({ + 'status': 'playing', + 'moves': [], + 'seed': newSeed, + 'radius': newRadius, + 'shape': newShape, + 'p1_rematch': false, + 'p2_rematch': false, + 'p1_reaction': null, + 'p2_reaction': null, + }); + } catch (e) { + debugPrint("Errore reset partita: $e"); + } + } +} \ No newline at end of file diff --git a/lib/services/storage_service.dart b/lib/services/storage_service.dart new file mode 100644 index 0000000..61b4529 --- /dev/null +++ b/lib/services/storage_service.dart @@ -0,0 +1,69 @@ +import 'dart:convert'; +import 'package:shared_preferences/shared_preferences.dart'; +import '../core/app_colors.dart'; + +class StorageService { + static final StorageService instance = StorageService._internal(); + StorageService._internal(); + + late SharedPreferences _prefs; + + // Si avvia quando apriamo l'app + Future init() async { + _prefs = await SharedPreferences.getInstance(); + } + + // --- IMPOSTAZIONI --- + int get savedThemeIndex => _prefs.getInt('theme') ?? AppThemeType.cyberpunk.index; + Future saveTheme(AppThemeType theme) async => await _prefs.setInt('theme', theme.index); + + int get savedRadius => _prefs.getInt('radius') ?? 2; + Future saveRadius(int radius) async => await _prefs.setInt('radius', radius); + + bool get isMuted => _prefs.getBool('isMuted') ?? false; + Future saveMuted(bool muted) async => await _prefs.setBool('isMuted', muted); + + // --- STATISTICHE VS CPU --- + int get wins => _prefs.getInt('wins') ?? 0; + Future addWin() async => await _prefs.setInt('wins', wins + 1); + + int get losses => _prefs.getInt('losses') ?? 0; + Future addLoss() async => await _prefs.setInt('losses', losses + 1); + + int get cpuLevel => _prefs.getInt('cpuLevel') ?? 1; + Future saveCpuLevel(int level) async => await _prefs.setInt('cpuLevel', level); + + // --- MULTIPLAYER --- + String get playerName => _prefs.getString('playerName') ?? ''; + Future savePlayerName(String name) async => await _prefs.setString('playerName', name); + + // --- STORICO PARTITE --- + List> get matchHistory { + List history = _prefs.getStringList('matchHistory') ?? []; + return history.map((e) => jsonDecode(e) as Map).toList(); + } + + // Salviamo sia il nostro nome che quello dell'avversario + Future saveMatchToHistory({required String myName, required String opponent, required int myScore, required int oppScore, required bool isOnline}) async { + List history = _prefs.getStringList('matchHistory') ?? []; + + Map match = { + 'date': DateTime.now().toIso8601String(), + 'myName': myName, + 'opponent': opponent, + 'myScore': myScore, + 'oppScore': oppScore, + 'isOnline': isOnline, + }; + + // Aggiungiamo in cima (il più recente per primo) + history.insert(0, jsonEncode(match)); + + // Teniamo solo le ultime 50 partite per non intasare la memoria + if (history.length > 50) { + history = history.sublist(0, 50); + } + + await _prefs.setStringList('matchHistory', history); + } +} \ No newline at end of file diff --git a/lib/ui/game/board_painter.dart b/lib/ui/game/board_painter.dart new file mode 100644 index 0000000..ffe9118 --- /dev/null +++ b/lib/ui/game/board_painter.dart @@ -0,0 +1,337 @@ +// =========================================================================== +// FILE: lib/ui/game/board_painter.dart +// =========================================================================== + +import 'dart:math'; +import 'package:flutter/material.dart'; +import '../../models/game_board.dart'; +import '../../core/app_colors.dart'; + +class BoardPainter extends CustomPainter { + final GameBoard board; + final ThemeColors theme; + final AppThemeType themeType; + final double blinkValue; + + BoardPainter({required this.board, required this.theme, required this.themeType, this.blinkValue = 0.0}); + + @override + void paint(Canvas canvas, Size size) { + if (themeType == AppThemeType.doodle) { + final Paint paperGridPaint = Paint() + ..color = Colors.grey.withOpacity(0.3) + ..strokeWidth = 1.0 + ..style = PaintingStyle.stroke; + + double paperStep = 20.0; + for (double i = 0; i <= size.width; i += paperStep) { + canvas.drawLine(Offset(i, 0), Offset(i, size.height), paperGridPaint); + } + for (double i = 0; i <= size.height; i += paperStep) { + canvas.drawLine(Offset(0, i), Offset(size.width, i), paperGridPaint); + } + } + + int gridPoints = board.radius * 2 + 2; + double spacing = size.width / gridPoints; + double offset = spacing / 2; + Offset getScreenPos(int x, int y) => Offset(x * spacing + offset, y * spacing + offset); + + // --- 1. DISEGNO AREE CONQUISTATE E ICONE --- + for (var box in board.boxes) { + if (box.type == BoxType.invisible) continue; + + Offset p1 = getScreenPos(box.x, box.y); + Offset p2 = getScreenPos(box.x + 1, box.y + 1); + Rect rect = Rect.fromPoints(p1, p2); + + if (box.owner != Player.none) { + final boxPaint = Paint() + ..style = PaintingStyle.fill + ..color = box.owner == Player.red ? theme.playerRed.withOpacity(0.6) : theme.playerBlue.withOpacity(0.6); + + if (themeType == AppThemeType.wood) { + _drawFlameBox(canvas, rect, box.owner == Player.red); + } else if (themeType == AppThemeType.doodle) { + Color penColor = box.owner == Player.red ? Colors.redAccent.shade700 : Colors.blueAccent.shade700; + _drawScribbleBox(canvas, rect, penColor); + } else { + canvas.drawRect(rect, boxPaint); + } + } + + if (box.type == BoxType.gold) { + _drawIconInBox(canvas, rect, Icons.star_rounded, Colors.amber); + } else if (box.type == BoxType.bomb) { + _drawIconInBox(canvas, rect, Icons.mood_bad_rounded, themeType == AppThemeType.cyberpunk ? Colors.greenAccent : Colors.deepPurple); + } else if (box.type == BoxType.swap) { + // NUOVA ICONA SWAP: Frecce circolari viola (o cyan) per indicare l'inversione + _drawIconInBox(canvas, rect, Icons.sync_rounded, Colors.purpleAccent); + } + } + + // --- 2. DISEGNO LINEE CON EFFETTO LAMPEGGIAMENTO --- + for (var line in board.lines) { + if (!line.isPlayable) continue; + + Offset p1 = getScreenPos(line.p1.x, line.p1.y); + Offset p2 = getScreenPos(line.p2.x, line.p2.y); + + bool isLastMove = (line == board.lastMove); + + Color lineColor = line.owner == Player.none + ? theme.gridLine.withOpacity(0.4) + : (line.owner == Player.red ? theme.playerRed : theme.playerBlue); + + if (isLastMove && line.owner != Player.none && themeType != AppThemeType.wood && themeType != AppThemeType.cyberpunk) { + canvas.drawLine(p1, p2, Paint() + ..color = Colors.white.withOpacity(blinkValue * 0.5) + ..strokeWidth = 16.0 + ..strokeCap = StrokeCap.round + ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 6.0) + ); + } + + if (themeType == AppThemeType.wood) { + if (line.owner == Player.none) { + canvas.drawLine(p1, p2, Paint()..color = const Color(0xFF3E2723).withOpacity(0.3)..strokeWidth = 4.5..strokeCap = StrokeCap.round); + } else { + Color headColor = lineColor; + if (isLastMove) { + headColor = Color.lerp(headColor, Colors.yellow, blinkValue * 0.8) ?? headColor; + } + _drawRealisticMatch(canvas, p1, p2, headColor, isLastMove: isLastMove, blinkValue: blinkValue); + } + } else if (themeType == AppThemeType.cyberpunk) { + _drawNeonLine(canvas, p1, p2, lineColor, line.owner != Player.none, isLastMove: isLastMove, blinkValue: blinkValue); + } else if (themeType == AppThemeType.doodle) { + Color doodleColor = line.owner == Player.none ? Colors.black.withOpacity(0.05) : lineColor; + if (isLastMove && line.owner != Player.none) { + doodleColor = Color.lerp(doodleColor, Colors.black, blinkValue * 0.4) ?? doodleColor; + } + _drawWobblyLine(canvas, p1, p2, doodleColor, line.owner != Player.none, isLastMove: isLastMove, blinkValue: blinkValue); + } else { + if (isLastMove && line.owner != Player.none) { + lineColor = Color.lerp(lineColor, Colors.white, blinkValue * 0.5) ?? lineColor; + } + canvas.drawLine(p1, p2, Paint()..color = lineColor..strokeWidth = isLastMove ? 6.0 + (2.0 * blinkValue) : 6.0..strokeCap = StrokeCap.round); + } + } + + // --- 3. DISEGNO PUNTINI --- + final dotPaint = Paint()..style = PaintingStyle.fill; + + Set activeDots = {}; + for (var line in board.lines) { + if (line.isPlayable) { + activeDots.add(line.p1); + activeDots.add(line.p2); + } + } + + for (var dot in activeDots) { + Offset pos = getScreenPos(dot.x, dot.y); + if (themeType == AppThemeType.wood) { + canvas.drawCircle(pos, 3.5, dotPaint..color = const Color(0xFF3E2723).withOpacity(0.2)); + } else if (themeType == AppThemeType.cyberpunk) { + canvas.drawCircle(pos, 6.0, Paint()..color = theme.gridLine.withOpacity(0.3)); + canvas.drawCircle(pos, 3.0, Paint()..color = Colors.white.withOpacity(0.5)); + } else if (themeType == AppThemeType.doodle) { + canvas.drawRect(Rect.fromCenter(center: pos, width: 4, height: 4), dotPaint..color = Colors.black.withOpacity(0.25)); + } else { + canvas.drawCircle(pos, 5.0, dotPaint..color = theme.text.withOpacity(0.6)); + } + } + } + + void _drawIconInBox(Canvas canvas, Rect rect, IconData icon, Color color) { + TextPainter textPainter = TextPainter(textDirection: TextDirection.ltr); + textPainter.text = TextSpan( + text: String.fromCharCode(icon.codePoint), + style: TextStyle( + color: color.withOpacity(0.7), + fontSize: rect.width * 0.45, + fontFamily: icon.fontFamily, + package: icon.fontPackage, + shadows: [Shadow(color: color.withOpacity(0.6), blurRadius: 10, offset: const Offset(0, 0))] + ), + ); + textPainter.layout(); + textPainter.paint(canvas, Offset(rect.center.dx - textPainter.width / 2, rect.center.dy - textPainter.height / 2)); + } + + void _drawFlameBox(Canvas canvas, Rect baseRect, bool isRed) { + final rand = Random((baseRect.left + baseRect.top).toInt()); + Offset center = baseRect.center; + double w = baseRect.width * 0.35; + double h = baseRect.height * 0.55; + Offset bottomCenter = Offset(center.dx, center.dy + h * 0.5); + + Color outerColor = isRed ? Colors.red.shade600.withOpacity(0.85) : Colors.blue.shade700.withOpacity(0.85); + Color midColor = isRed ? Colors.orangeAccent : Colors.lightBlueAccent; + Color coreColor = isRed ? Colors.yellowAccent : Colors.white; + + canvas.drawOval( + Rect.fromCenter(center: bottomCenter, width: w * 1.5, height: w * 0.5), + Paint() + ..color = Colors.black.withOpacity(0.4) + ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 4.0), + ); + + void drawFlameLayer(double scale, Color color, double tipOffsetX) { + Path path = Path(); + double fw = w * scale; + double fh = h * scale; + + path.moveTo(bottomCenter.dx, bottomCenter.dy); + path.cubicTo( + bottomCenter.dx + fw, bottomCenter.dy, + bottomCenter.dx + fw * 0.8, bottomCenter.dy - fh * 0.6, + bottomCenter.dx + tipOffsetX, bottomCenter.dy - fh, + ); + path.cubicTo( + bottomCenter.dx - fw * 0.8, bottomCenter.dy - fh * 0.6, + bottomCenter.dx - fw, bottomCenter.dy, + bottomCenter.dx, bottomCenter.dy, + ); + + canvas.drawPath( + path, + Paint() + ..color = color + ..style = PaintingStyle.fill + ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 1.5), + ); + } + + double randomTipX = (rand.nextDouble() - 0.5) * w * 0.8; + drawFlameLayer(1.0, outerColor, randomTipX); + drawFlameLayer(0.65, midColor.withOpacity(0.9), randomTipX * 0.6); + drawFlameLayer(0.35, coreColor.withOpacity(0.9), randomTipX * 0.2); + } + + void _drawScribbleBox(Canvas canvas, Rect baseRect, Color color) { + final rand = Random((baseRect.left + baseRect.top).toInt()); + final paint = Paint() + ..color = color.withOpacity(0.85) + ..style = PaintingStyle.stroke + ..strokeWidth = 3.5 + ..strokeCap = StrokeCap.round + ..strokeJoin = StrokeJoin.round; + + final path = Path(); + Rect rect = baseRect.deflate(4.0); + + int numZigs = 15 + rand.nextInt(6); + double stepY = rect.height / numZigs; + + path.moveTo(rect.left + rand.nextDouble() * 5, rect.top + rand.nextDouble() * 5); + + for (int i = 1; i <= numZigs; i++) { + double targetX = (i % 2 != 0) ? rect.right + (rand.nextDouble() * 4 - 2) : rect.left + (rand.nextDouble() * 4 - 2); + double targetY = rect.top + stepY * i + (rand.nextDouble() - 0.5) * 3; + double ctrlX = rect.center.dx + (rand.nextDouble() - 0.5) * 20; + double ctrlY = targetY - stepY / 2; + path.quadraticBezierTo(ctrlX, ctrlY, targetX, targetY); + } + canvas.drawPath(path, paint); + } + + void _drawRealisticMatch(Canvas canvas, Offset p1, Offset p2, Color headColor, {bool isLastMove = false, double blinkValue = 0.0}) { + int seed = (p1.dx * 1000 + p1.dy).toInt(); + Random rand = Random(seed); + Vector2 dir = Vector2(p2.dx - p1.dx, p2.dy - p1.dy).normalized(); + double shrink = 8.0; + Offset start = Offset(p1.dx + dir.x * shrink, p1.dy + dir.y * shrink); + Offset end = Offset(p2.dx - dir.x * shrink, p2.dy - dir.y * shrink); + start += Offset(rand.nextDouble() * 4 - 2, rand.nextDouble() * 4 - 2); + end += Offset(rand.nextDouble() * 4 - 2, rand.nextDouble() * 4 - 2); + bool headAtEnd = rand.nextBool(); + Offset headPos = headAtEnd ? end : start; + Offset tailPos = headAtEnd ? start : end; + Vector2 matchDir = Vector2(headPos.dx - tailPos.dx, headPos.dy - tailPos.dy).normalized(); + + canvas.drawLine(tailPos + const Offset(4, 4), headPos + const Offset(4, 4), Paint()..color = Colors.black.withOpacity(0.6)..strokeWidth = 7.0..strokeCap = StrokeCap.round); + + if (isLastMove) { + canvas.drawCircle(headPos, 8.0 + (blinkValue * 6.0), Paint() + ..color = Colors.orangeAccent.withOpacity(0.6 * blinkValue) + ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 6.0) + ); + } + + canvas.drawLine(tailPos, headPos, Paint()..color = const Color(0xFF6D4C41)..strokeWidth = 7.0..strokeCap = StrokeCap.round); + canvas.drawLine(tailPos, headPos, Paint()..color = const Color(0xFFEDC498)..strokeWidth = 4.0..strokeCap = StrokeCap.round); + Offset burnPos = Offset(headPos.dx - matchDir.x * 8, headPos.dy - matchDir.y * 8); + canvas.drawLine(burnPos, headPos, Paint()..color = const Color(0xFF2E1A14)..strokeWidth = 6.0..strokeCap = StrokeCap.round); + + canvas.save(); + canvas.translate(headPos.dx, headPos.dy); + double angle = atan2(matchDir.y, matchDir.x); + canvas.rotate(angle); + Rect headOval = Rect.fromCenter(center: Offset.zero, width: 18.0, height: 13.0); + canvas.drawOval(headOval.shift(const Offset(1, 2)), Paint()..color = Colors.black.withOpacity(0.6)); + canvas.drawOval(headOval, Paint()..color = headColor); + canvas.restore(); + } + + void _drawNeonLine(Canvas canvas, Offset p1, Offset p2, Color color, bool isConquered, {bool isLastMove = false, double blinkValue = 0.0}) { + double mainWidth = isConquered ? (isLastMove ? 6.0 + (blinkValue * 3.0) : 6.0) : 3.0; + Color coreColor = isConquered ? (isLastMove ? Color.lerp(Colors.white, color, 1.0 - blinkValue)! : Colors.white.withOpacity(0.9)) : color.withOpacity(0.6); + + canvas.drawLine(p1, p2, Paint() + ..color = color.withOpacity(isConquered ? (isLastMove ? 0.4 + (0.4 * blinkValue) : 0.4) : 0.2) + ..strokeWidth = mainWidth * 4 + ..strokeCap = StrokeCap.round + ..maskFilter = MaskFilter.blur(BlurStyle.normal, isConquered ? 12.0 : 6.0) + ); + + if (isConquered) { + canvas.drawLine(p1, p2, Paint() + ..color = color.withOpacity(isLastMove ? 0.7 + (0.3 * blinkValue) : 0.7) + ..strokeWidth = mainWidth * 2 + ..strokeCap = StrokeCap.round + ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 6.0) + ); + } + + canvas.drawLine(p1, p2, Paint() + ..color = coreColor + ..strokeWidth = mainWidth + ..strokeCap = StrokeCap.round + ); + } + + void _drawWobblyLine(Canvas canvas, Offset p1, Offset p2, Color color, bool isConquered, {bool isLastMove = false, double blinkValue = 0.0}) { + final random = Random((p1.dx + p1.dy + p2.dx + p2.dy).toInt()); + final dx = p2.dx - p1.dx; + final dy = p2.dy - p1.dy; + + double strokeW = isConquered ? (isLastMove ? 4.5 + (2.0 * blinkValue) : 4.5) : 2.0; + + final basePaint = Paint() + ..color = color + ..strokeWidth = strokeW + ..style = PaintingStyle.stroke + ..strokeCap = StrokeCap.round; + + final mid1 = Offset(p1.dx + dx / 2 + (random.nextDouble() - 0.5) * 8, p1.dy + dy / 2 + (random.nextDouble() - 0.5) * 8); + canvas.drawPath(Path()..moveTo(p1.dx, p1.dy)..quadraticBezierTo(mid1.dx, mid1.dy, p2.dx, p2.dy), basePaint); + + final mid2 = Offset(p1.dx + dx / 2 + (random.nextDouble() - 0.5) * 6, p1.dy + dy / 2 + (random.nextDouble() - 0.5) * 6); + canvas.drawPath(Path()..moveTo(p1.dx, p1.dy)..quadraticBezierTo(mid2.dx, mid2.dy, p2.dx, p2.dy), basePaint..strokeWidth = strokeW * 0.5..color = color.withOpacity(0.8)); + } + + @override + bool shouldRepaint(covariant BoardPainter oldDelegate) => true; +} + +class Vector2 { + final double x, y; + Vector2(this.x, this.y); + double get length => sqrt(x * x + y * y); + Vector2 normalized() { + double l = length; + return l == 0 ? Vector2(0, 0) : Vector2(x / l, y / l); + } +} \ No newline at end of file diff --git a/lib/ui/game/game_screen.dart b/lib/ui/game/game_screen.dart new file mode 100644 index 0000000..f39d17b --- /dev/null +++ b/lib/ui/game/game_screen.dart @@ -0,0 +1,696 @@ +// =========================================================================== +// FILE: lib/ui/game/game_screen.dart +// =========================================================================== + +import 'dart:ui'; +import 'dart:math' as math; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../logic/game_controller.dart'; +import '../../core/theme_manager.dart'; +import '../../core/app_colors.dart'; +import 'board_painter.dart'; +import 'score_board.dart'; +import '../../models/game_board.dart'; + +class GameScreen extends StatefulWidget { + const GameScreen({super.key}); + + @override + State createState() => _GameScreenState(); +} + +class _GameScreenState extends State with TickerProviderStateMixin { + late AnimationController _blinkController; + bool _gameOverDialogShown = false; + bool _opponentLeftDialogShown = false; + + @override + void initState() { + super.initState(); + _blinkController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 600), + )..repeat(reverse: true); + } + + @override + void dispose() { + _blinkController.dispose(); + super.dispose(); + } + + void _showGameOverDialog(BuildContext context, GameController game, ThemeColors theme, AppThemeType themeType) { + _gameOverDialogShown = true; + + showDialog( + barrierDismissible: false, + context: context, + builder: (dialogContext) => Consumer( + builder: (context, controller, child) { + if (!controller.isGameOver) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (Navigator.canPop(dialogContext)) Navigator.pop(dialogContext); + _gameOverDialogShown = false; + }); + return const SizedBox(); + } + + int red = controller.board.scoreRed; + int blue = controller.board.scoreBlue; + bool playerBeatCPU = controller.isVsCPU && red > blue; + + String nameRed = controller.isOnline ? controller.onlineHostName.toUpperCase() : "TU"; + String nameBlue = controller.isOnline ? controller.onlineGuestName.toUpperCase() : (themeType == AppThemeType.cyberpunk ? "VERDE" : "BLU"); + if (controller.isVsCPU) nameBlue = "CPU"; + + String winnerText = ""; + Color winnerColor = theme.text; + if (red > blue) { winnerText = "VINCE $nameRed!"; winnerColor = theme.playerRed; } + else if (blue > red) { winnerText = "VINCE $nameBlue!"; winnerColor = theme.playerBlue; } + else { winnerText = "PAREGGIO!"; winnerColor = theme.text; } + + return AlertDialog( + backgroundColor: theme.background, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20), side: BorderSide(color: winnerColor.withOpacity(0.5), width: 2)), + title: Text("FINE PARTITA", textAlign: TextAlign.center, style: TextStyle(color: theme.text, fontWeight: FontWeight.bold, fontSize: 22)), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(winnerText, textAlign: TextAlign.center, style: TextStyle(fontSize: 26, fontWeight: FontWeight.w900, color: winnerColor)), + const SizedBox(height: 20), + Container( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration(color: theme.text.withOpacity(0.05), borderRadius: BorderRadius.circular(15)), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text("$nameRed: $red", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: theme.playerRed)), + Text(" - ", style: TextStyle(fontSize: 18, color: theme.text)), + Text("$nameBlue: $blue", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: theme.playerBlue)), + ], + ), + ), + if (controller.isVsCPU) ...[ + const SizedBox(height: 15), + Text("Difficoltà CPU: Livello ${controller.cpuLevel}", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: theme.text.withOpacity(0.7))), + ], + if (controller.isOnline) ...[ + const SizedBox(height: 20), + if (controller.rematchRequested && !controller.opponentWantsRematch) + Text("In attesa di $nameBlue...", style: TextStyle(color: Colors.amber, fontWeight: FontWeight.bold, fontStyle: FontStyle.italic)), + if (controller.opponentWantsRematch && !controller.rematchRequested) + Text("$nameBlue vuole la rivincita!", style: TextStyle(color: Colors.greenAccent, fontWeight: FontWeight.bold)), + if (controller.rematchRequested && controller.opponentWantsRematch) + Text("Avvio nuova partita...", style: TextStyle(color: Colors.green, fontWeight: FontWeight.bold)), + ] + ], + ), + actionsPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 10), + actionsAlignment: MainAxisAlignment.center, + actions: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (playerBeatCPU) + ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: winnerColor, foregroundColor: Colors.white, padding: const EdgeInsets.symmetric(vertical: 15), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), elevation: 5), + onPressed: () { Navigator.pop(dialogContext); _gameOverDialogShown = false; controller.increaseLevelAndRestart(); }, + child: const Text("PROSSIMO LIVELLO ➔", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)), + ) + else if (controller.isOnline) + ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: controller.rematchRequested ? Colors.grey : (winnerColor == theme.text ? theme.playerBlue : winnerColor), foregroundColor: Colors.white, padding: const EdgeInsets.symmetric(vertical: 15), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), elevation: 5), + onPressed: controller.rematchRequested ? null : () { + controller.requestRematch(); + }, + child: Text(controller.opponentWantsRematch ? "ACCETTA RIVINCITA" : "CHIEDI RIVINCITA", style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16, letterSpacing: 1.0)), + ) + else + ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: winnerColor == theme.text ? theme.playerBlue : winnerColor, foregroundColor: Colors.white, padding: const EdgeInsets.symmetric(vertical: 15), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), elevation: 5), + onPressed: () { Navigator.pop(dialogContext); _gameOverDialogShown = false; controller.startNewGame(controller.board.radius, vsCPU: controller.isVsCPU); }, + child: const Text("RIGIOCA", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, letterSpacing: 2)), + ), + const SizedBox(height: 12), + OutlinedButton( + style: OutlinedButton.styleFrom(foregroundColor: theme.text, side: BorderSide(color: theme.text.withOpacity(0.3), width: 2), padding: const EdgeInsets.symmetric(vertical: 15), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15))), + onPressed: () { + if (controller.isOnline) controller.disconnectOnlineGame(); + Navigator.pop(dialogContext); + Navigator.pop(context); + }, + child: Text("TORNA AL MENU", style: TextStyle(fontWeight: FontWeight.bold, color: theme.text, fontSize: 14, letterSpacing: 1.5)), + ), + ], + ) + ], + ); + } + ) + ); + } + + @override + Widget build(BuildContext context) { + final themeManager = context.watch(); + final themeType = themeManager.currentThemeType; + final theme = themeManager.currentColors; + final gameController = context.watch(); + + WidgetsBinding.instance.addPostFrameCallback((_) { + if (gameController.opponentLeft && !_opponentLeftDialogShown) { + _opponentLeftDialogShown = true; + showDialog( + barrierDismissible: false, + context: context, + builder: (dialogContext) => AlertDialog( + backgroundColor: theme.background, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), + title: Text("VITTORIA A TAVOLINO!", textAlign: TextAlign.center, style: TextStyle(color: theme.playerRed, fontWeight: FontWeight.bold)), + content: Text("L'avversario ha abbandonato la stanza.\nSei il vincitore incontestato!", textAlign: TextAlign.center, style: TextStyle(color: theme.text, fontSize: 16)), + actionsAlignment: MainAxisAlignment.center, + actions: [ + ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: theme.playerBlue, foregroundColor: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15))), + onPressed: () { gameController.disconnectOnlineGame(); Navigator.pop(dialogContext); Navigator.pop(context); }, + child: const Text("MENU PRINCIPALE", style: TextStyle(fontWeight: FontWeight.bold)), + ) + ], + ) + ); + } else if (gameController.board.isGameOver && !_gameOverDialogShown) { + _showGameOverDialog(context, gameController, theme, themeType); + } + }); + + String? bgImage; + if (themeType == AppThemeType.wood) bgImage = 'assets/images/wood_bg.jpg'; + if (themeType == AppThemeType.doodle) bgImage = 'assets/images/doodle_bg.jpg'; + + Color indicatorColor = themeType == AppThemeType.cyberpunk ? Colors.white : Colors.black; + + Widget emojiBar = const SizedBox(); + if (gameController.isOnline && !gameController.isGameOver) { + final List emojis = ['😂', '😡', '😱', '🥳', '👀']; + emojiBar = Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6), + decoration: BoxDecoration( + color: themeType == AppThemeType.cyberpunk ? Colors.black.withOpacity(0.6) : Colors.white.withOpacity(0.8), + borderRadius: BorderRadius.circular(30), + border: Border.all(color: themeType == AppThemeType.cyberpunk ? theme.playerBlue.withOpacity(0.3) : Colors.black12, width: 2), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: emojis.map((e) => GestureDetector( + onTap: () => gameController.sendReaction(e), + child: Padding(padding: const EdgeInsets.symmetric(horizontal: 6), child: Text(e, style: const TextStyle(fontSize: 22))), + )).toList(), + ), + ); + } + + Widget gameContent = SafeArea( + child: Stack( + children: [ + Column( + children: [ + const ScoreBoard(), + Expanded( + child: Center( + child: Padding( + padding: const EdgeInsets.all(10.0), + child: AspectRatio( + aspectRatio: 1, + child: LayoutBuilder( + builder: (context, constraints) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTapDown: (details) => _handleTap(details.localPosition, constraints.maxWidth, gameController, themeType), + child: AnimatedBuilder( + animation: _blinkController, + builder: (context, child) { + return CustomPaint( + size: Size(constraints.maxWidth, constraints.maxHeight), + painter: BoardPainter(board: gameController.board, theme: theme, themeType: themeType, blinkValue: _blinkController.value), + ); + } + ), + ); + } + ), + ), + ), + ), + ), + + Padding( + padding: const EdgeInsets.only(bottom: 20.0, left: 20.0, right: 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (gameController.isVsCPU) + Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration(color: indicatorColor.withOpacity(0.1), borderRadius: BorderRadius.circular(20), border: Border.all(color: indicatorColor.withOpacity(0.3))), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.smart_toy_rounded, size: 16, color: indicatorColor), const SizedBox(width: 8), + Text("LIVELLO CPU: ${gameController.cpuLevel}", style: TextStyle(color: indicatorColor, fontWeight: FontWeight.bold, fontSize: 13, letterSpacing: 1.0)), + ], + ), + ) + else + emojiBar, + + Container( + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.4), offset: const Offset(0, 4), blurRadius: 5)]), + child: TextButton.icon( + style: TextButton.styleFrom(backgroundColor: bgImage != null ? Colors.black87 : theme.background, padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20), side: BorderSide(color: Colors.white.withOpacity(0.1), width: 1))), + icon: Icon(Icons.exit_to_app, color: bgImage != null ? Colors.white : theme.text, size: 20), + onPressed: () { gameController.disconnectOnlineGame(); Navigator.pop(context); }, + label: Text("ESCI", style: TextStyle(color: bgImage != null ? Colors.white : theme.text, fontWeight: FontWeight.bold, fontSize: 14)), + ), + ), + ], + ), + ) + ], + ), + + if (gameController.myReaction != null) + Positioned( + top: 80, + left: gameController.isHost ? 30 : null, + right: gameController.isHost ? null : 30, + child: _BouncingEmoji(emoji: gameController.myReaction!), + ), + if (gameController.opponentReaction != null) + Positioned( + top: 80, + left: !gameController.isHost ? 30 : null, + right: !gameController.isHost ? null : 30, + child: _BouncingEmoji(emoji: gameController.opponentReaction!), + ), + ], + ), + ); + + return PopScope( + canPop: true, + onPopInvoked: (didPop) { gameController.disconnectOnlineGame(); }, + child: Scaffold( + backgroundColor: bgImage != null ? Colors.transparent : theme.background, + body: CustomPaint( + painter: themeType == AppThemeType.minimal ? FullScreenGridPainter(Colors.black.withOpacity(0.06)) : null, + child: Container( + decoration: bgImage != null ? BoxDecoration(image: DecorationImage(image: AssetImage(bgImage), fit: BoxFit.cover, colorFilter: themeType == AppThemeType.doodle ? ColorFilter.mode(Colors.white.withOpacity(0.7), BlendMode.lighten) : null)) : null, + child: Stack( + children: [ + if (gameController.isTimeMode && !gameController.isCPUThinking && !gameController.isGameOver && gameController.timeLeft > 0 && gameController.timeLeft <= 5) + Positioned.fill(child: BlitzBackgroundEffect(timeLeft: gameController.timeLeft, color: theme.playerRed)), + + if (gameController.effectText.isNotEmpty) + Positioned.fill(child: SpecialEventBackgroundEffect(text: gameController.effectText, color: gameController.effectColor)), + + Positioned.fill(child: gameContent), + + // ========================================== + // EFFETTI VISIVI (VFX) DI FINE PARTITA + // ========================================== + if (gameController.isGameOver && gameController.board.scoreRed != gameController.board.scoreBlue) + Positioned.fill( + child: IgnorePointer( + child: WinnerVFXOverlay( + winnerColor: gameController.board.scoreRed > gameController.board.scoreBlue ? theme.playerRed : theme.playerBlue, + themeType: themeType, + ), + ), + ), + ], + ), + ), + ), + ), + ); + } + + void _handleTap(Offset tapPos, double size, GameController controller, AppThemeType themeType) { + final board = controller.board; + if (board.isGameOver) return; + + int gridPoints = board.radius * 2 + 2; + double spacing = size / gridPoints; + double offset = spacing / 2; + + Line? closestLine; + double minDistance = double.infinity; + double maxTouchDistance = spacing * 0.4; + + for (var line in board.lines) { + if (line.owner != Player.none || !line.isPlayable) continue; + + Offset screenP1 = Offset(line.p1.x * spacing + offset, line.p1.y * spacing + offset); + Offset screenP2 = Offset(line.p2.x * spacing + offset, line.p2.y * spacing + offset); + + double dist = _distanceToSegment(tapPos, screenP1, screenP2); + + if (dist < minDistance && dist < maxTouchDistance) { minDistance = dist; closestLine = line; } + } + + if (closestLine != null) { controller.handleLineTap(closestLine, themeType); } + } + + double _distanceToSegment(Offset p, Offset a, Offset b) { + double l2 = (a.dx - b.dx) * (a.dx - b.dx) + (a.dy - b.dy) * (a.dy - b.dy); + if (l2 == 0) return (p - a).distance; + double t = (((p.dx - a.dx) * (b.dx - a.dx) + (p.dy - a.dy) * (b.dy - a.dy)) / l2).clamp(0.0, 1.0); + Offset projection = Offset(a.dx + t * (b.dx - a.dx), a.dy + t * (b.dy - a.dy)); + return (p - projection).distance; + } +} + +// =========================================================================== +// CLASSI PER IL MOTORE PARTICELLARE (VFX) DI FINE PARTITA +// =========================================================================== + +class _Particle { + double x, y; + double vx, vy; + Color color; + double size; + double angle; + double spin; + int type; // 0=cerchio, 1=quadrato, 2=triangolo + + _Particle({required this.x, required this.y, required this.vx, required this.vy, required this.color, required this.size, required this.angle, required this.spin, required this.type}); +} + +class WinnerVFXOverlay extends StatefulWidget { + final Color winnerColor; + final AppThemeType themeType; + + const WinnerVFXOverlay({super.key, required this.winnerColor, required this.themeType}); + + @override + State createState() => _WinnerVFXOverlayState(); +} + +class _WinnerVFXOverlayState extends State with SingleTickerProviderStateMixin { + late AnimationController _vfxController; + final List<_Particle> _particles = []; + final math.Random _rand = math.Random(); + bool _initialized = false; + + @override + void initState() { + super.initState(); + // L'animazione gira a 60fps per 4 secondi e poi si ferma + _vfxController = AnimationController(vsync: this, duration: const Duration(seconds: 4)) + ..addListener(() { + _updateParticles(); + }) + ..forward(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (!_initialized) { + _initParticles(MediaQuery.of(context).size); + _initialized = true; + } + } + + void _initParticles(Size screenSize) { + int particleCount = widget.themeType == AppThemeType.cyberpunk ? 150 : 100; + + // Lista di colori da mixare (colore vincitore + bianco + colori a tema) + List palette = [widget.winnerColor, widget.winnerColor.withOpacity(0.7), Colors.white]; + if (widget.themeType == AppThemeType.cyberpunk) { + palette.add(Colors.cyanAccent); + palette.add(Colors.yellowAccent); + } else if (widget.themeType == AppThemeType.doodle) { + palette.add(const Color(0xFF00008B)); // Inchiostro biro + palette.add(Colors.redAccent); + } else if (widget.themeType == AppThemeType.wood) { + palette = [Colors.orangeAccent, Colors.yellow, Colors.red, Colors.white]; + } + + for (int i = 0; i < particleCount; i++) { + // Esplosione dal centro verso l'esterno + double speed = _rand.nextDouble() * 20 + 5; + double theta = _rand.nextDouble() * 2 * math.pi; + + _particles.add(_Particle( + x: screenSize.width / 2, + y: screenSize.height / 2, + vx: speed * math.cos(theta), + vy: speed * math.sin(theta) - 5, // Leggera spinta verso l'alto + color: palette[_rand.nextInt(palette.length)], + size: _rand.nextDouble() * 10 + 6, + angle: _rand.nextDouble() * math.pi, + spin: (_rand.nextDouble() - 0.5) * 0.5, + type: _rand.nextInt(3), + )); + } + } + + void _updateParticles() { + setState(() { + for (var p in _particles) { + p.x += p.vx; + p.y += p.vy; + + // Gravità e attrito + if (widget.themeType == AppThemeType.cyberpunk) { + p.vy += 0.1; // Gravità bassa (fluttuano di più) + p.vx *= 0.98; // Attrito + p.vy *= 0.98; + } else if (widget.themeType == AppThemeType.wood) { + p.vy -= 0.2; // Vanno verso l'alto come fumo/scintille! + p.x += math.sin(p.y * 0.05) * 2; // Tremolio + } else { + p.vy += 0.5; // Gravità standard (coriandoli cadono) + } + + p.angle += p.spin; + p.size *= 0.99; // Si rimpiccioliscono nel tempo + } + }); + } + + @override + void dispose() { + _vfxController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return CustomPaint( + painter: _VFXPainter(particles: _particles, themeType: widget.themeType), + child: Container(), + ); + } +} + +class _VFXPainter extends CustomPainter { + final List<_Particle> particles; + final AppThemeType themeType; + + _VFXPainter({required this.particles, required this.themeType}); + + @override + void paint(Canvas canvas, Size size) { + for (var p in particles) { + if (p.size < 0.5) continue; + + final paint = Paint() + ..color = p.color + ..style = PaintingStyle.fill; + + // Glow per il Cyberpunk + if (themeType == AppThemeType.cyberpunk) { + paint.maskFilter = const MaskFilter.blur(BlurStyle.solid, 4.0); + } + + canvas.save(); + canvas.translate(p.x, p.y); + canvas.rotate(p.angle); + + if (themeType == AppThemeType.doodle) { + // Stile schizzato + paint.style = PaintingStyle.stroke; + paint.strokeWidth = 2.0; + if (p.type == 0) { + canvas.drawCircle(Offset.zero, p.size, paint); + } else { + canvas.drawRect(Rect.fromCenter(center: Offset.zero, width: p.size*2, height: p.size*2), paint); + } + } else if (themeType == AppThemeType.wood) { + // Scintille rotonde e sfuocate + paint.maskFilter = const MaskFilter.blur(BlurStyle.normal, 3.0); + canvas.drawCircle(Offset.zero, p.size, paint); + } else { + // Forme standard per Minimal e Cyberpunk + if (p.type == 0) { + canvas.drawCircle(Offset.zero, p.size, paint); + } else if (p.type == 1) { + canvas.drawRect(Rect.fromCenter(center: Offset.zero, width: p.size * 2, height: p.size * 2), paint); + } else { + var path = Path() + ..moveTo(0, -p.size) + ..lineTo(p.size, p.size) + ..lineTo(-p.size, p.size) + ..close(); + canvas.drawPath(path, paint); + } + } + canvas.restore(); + } + } + + @override + bool shouldRepaint(covariant _VFXPainter oldDelegate) => true; +} + +// =========================================================================== +// WIDGET INTERNI ESISTENTENTI +// =========================================================================== + +class _BouncingEmoji extends StatefulWidget { + final String emoji; + const _BouncingEmoji({required this.emoji}); + + @override + State<_BouncingEmoji> createState() => _BouncingEmojiState(); +} + +class _BouncingEmojiState extends State<_BouncingEmoji> with SingleTickerProviderStateMixin { + late AnimationController _ctrl; + late Animation _anim; + + @override + void initState() { + super.initState(); + _ctrl = AnimationController(vsync: this, duration: const Duration(milliseconds: 500))..repeat(reverse: true); + _anim = Tween(begin: -10, end: 10).animate(CurvedAnimation(parent: _ctrl, curve: Curves.easeInOut)); + } + + @override + void dispose() { _ctrl.dispose(); super.dispose(); } + + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: _anim, + builder: (ctx, child) => Transform.translate( + offset: Offset(0, _anim.value), + child: Container( + padding: const EdgeInsets.all(8), + decoration: const BoxDecoration(color: Colors.white, shape: BoxShape.circle, boxShadow: [BoxShadow(color: Colors.black26, blurRadius: 5)]), + child: Text(widget.emoji, style: const TextStyle(fontSize: 32)), + ), + ), + ); + } +} + +class FullScreenGridPainter extends CustomPainter { + final Color gridColor; + FullScreenGridPainter(this.gridColor); + + @override + void paint(Canvas canvas, Size size) { + final Paint paperGridPaint = Paint()..color = gridColor..strokeWidth = 1.0..style = PaintingStyle.stroke; + double paperStep = 20.0; + for (double i = 0; i <= size.width; i += paperStep) canvas.drawLine(Offset(i, 0), Offset(i, size.height), paperGridPaint); + for (double i = 0; i <= size.height; i += paperStep) canvas.drawLine(Offset(0, i), Offset(size.width, i), paperGridPaint); + } + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +} + +class BlitzBackgroundEffect extends StatefulWidget { + final int timeLeft; + final Color color; + const BlitzBackgroundEffect({super.key, required this.timeLeft, required this.color}); + @override + State createState() => _BlitzBackgroundEffectState(); +} + +class _BlitzBackgroundEffectState extends State with SingleTickerProviderStateMixin { + late AnimationController _controller; + @override + void initState() { super.initState(); _controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 400))..repeat(reverse: true); } + @override + void dispose() { _controller.dispose(); super.dispose(); } + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return Container( + color: widget.color.withOpacity(0.12 * _controller.value), + child: Center( + child: ImageFiltered( + imageFilter: ImageFilter.blur(sigmaX: 2.0, sigmaY: 2.0), + child: Text('${widget.timeLeft}', style: TextStyle(fontSize: 300, fontWeight: FontWeight.w900, color: widget.color.withOpacity(0.35 + (0.3 * _controller.value)), height: 1.0)), + ), + ), + ); + }, + ); + } +} + +class SpecialEventBackgroundEffect extends StatefulWidget { + final String text; + final Color color; + const SpecialEventBackgroundEffect({super.key, required this.text, required this.color}); + @override + State createState() => _SpecialEventBackgroundEffectState(); +} + +class _SpecialEventBackgroundEffectState extends State with SingleTickerProviderStateMixin { + late AnimationController _controller; + late Animation _scaleAnimation; + late Animation _opacityAnimation; + + @override + void initState() { + super.initState(); + _controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 1000))..forward(); + _scaleAnimation = Tween(begin: 0.5, end: 1.5).animate(CurvedAnimation(parent: _controller, curve: Curves.easeOutCubic)); + _opacityAnimation = Tween(begin: 0.9, end: 0.0).animate(CurvedAnimation(parent: _controller, curve: Curves.easeIn)); + } + @override + void didUpdateWidget(covariant SpecialEventBackgroundEffect oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.text != widget.text) { _controller.reset(); _controller.forward(); } + } + @override + void dispose() { _controller.dispose(); super.dispose(); } + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return Center( + child: Transform.scale( + scale: _scaleAnimation.value, + child: Opacity( + opacity: _opacityAnimation.value, + child: ImageFiltered( + imageFilter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), + child: Text(widget.text, style: TextStyle(fontSize: 250, fontWeight: FontWeight.w900, color: widget.color, height: 1.0)), + ), + ), + ), + ); + }, + ); + } +} \ No newline at end of file diff --git a/lib/ui/game/score_board.dart b/lib/ui/game/score_board.dart new file mode 100644 index 0000000..e1710b9 --- /dev/null +++ b/lib/ui/game/score_board.dart @@ -0,0 +1,126 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../logic/game_controller.dart'; +import '../../models/game_board.dart'; +import '../../core/theme_manager.dart'; +import '../../services/audio_service.dart'; +import '../../core/app_colors.dart'; + +class ScoreBoard extends StatefulWidget { + const ScoreBoard({super.key}); + + @override + State createState() => _ScoreBoardState(); +} + +class _ScoreBoardState extends State { + @override + Widget build(BuildContext context) { + final controller = context.watch(); + final themeManager = context.watch(); + final theme = themeManager.currentColors; + final themeType = themeManager.currentThemeType; + + int redScore = controller.board.scoreRed; + int blueScore = controller.board.scoreBlue; + + bool isRedTurn = controller.board.currentPlayer == Player.red; + bool isMuted = AudioService.instance.isMuted; + + // --- LOGICA PER I NOMI --- + String nameRed = "ROSSO"; + String nameBlue = themeType == AppThemeType.cyberpunk ? "VERDE" : "BLU"; + + if (controller.isOnline) { + nameRed = controller.onlineHostName.toUpperCase(); + nameBlue = controller.onlineGuestName.toUpperCase(); + } else if (controller.isVsCPU) { + nameRed = "TU"; + nameBlue = "CPU"; + } + + return Container( + padding: const EdgeInsets.only(top: 10, bottom: 20, left: 20, right: 20), + decoration: BoxDecoration( + color: theme.background.withOpacity(0.95), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.3), + offset: const Offset(0, 4), + blurRadius: 8, + ), + ], + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(30), + bottomRight: Radius.circular(30), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _PlayerScore(color: theme.playerRed, score: redScore, isTurn: isRedTurn, textColor: theme.text, title: nameRed), + + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "TETRAQ", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.w900, + color: theme.text, + letterSpacing: 4, + shadows: [Shadow(color: Colors.black.withOpacity(0.3), offset: const Offset(1, 2), blurRadius: 2)] + ) + ), + IconButton( + icon: Icon(isMuted ? Icons.volume_off : Icons.volume_up, color: theme.text.withOpacity(0.7)), + onPressed: () { + setState(() { + AudioService.instance.toggleMute(); + }); + }, + ), + ], + ), + + _PlayerScore(color: theme.playerBlue, score: blueScore, isTurn: !isRedTurn, textColor: theme.text, title: nameBlue), + ], + ), + ); + } +} + +class _PlayerScore extends StatelessWidget { + final Color color; + final int score; + final bool isTurn; + final Color textColor; + final String title; + + const _PlayerScore({required this.color, required this.score, required this.isTurn, required this.textColor, required this.title}); + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(title, style: TextStyle(fontWeight: FontWeight.bold, color: isTurn ? color : textColor.withOpacity(0.5), fontSize: 12)), + const SizedBox(height: 5), + AnimatedContainer( + duration: const Duration(milliseconds: 300), + padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 10), + decoration: BoxDecoration( + color: color.withOpacity(isTurn ? 1.0 : 0.2), + borderRadius: BorderRadius.circular(15), + border: isTurn ? Border.all(color: Colors.white.withOpacity(0.4), width: 2) : Border.all(color: Colors.transparent, width: 2), + boxShadow: isTurn ? [ + BoxShadow(color: color.withOpacity(0.5), offset: const Offset(0, 4), blurRadius: 6) + ] : [], + ), + child: Text('$score', style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: isTurn ? Colors.white : textColor.withOpacity(0.5))), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/ui/home/history_screen.dart b/lib/ui/home/history_screen.dart new file mode 100644 index 0000000..1ed13c0 --- /dev/null +++ b/lib/ui/home/history_screen.dart @@ -0,0 +1,128 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:intl/intl.dart'; +import '../../core/theme_manager.dart'; +import '../../services/storage_service.dart'; + +class HistoryScreen extends StatelessWidget { + const HistoryScreen({super.key}); + + @override + Widget build(BuildContext context) { + final theme = context.watch().currentColors; + final history = StorageService.instance.matchHistory; + + return Scaffold( + backgroundColor: theme.background, + appBar: AppBar( + title: Text("STORICO PARTITE", style: TextStyle(fontWeight: FontWeight.w900, color: theme.text, letterSpacing: 2)), + backgroundColor: Colors.transparent, + elevation: 0, + iconTheme: IconThemeData(color: theme.text), + ), + body: history.isEmpty + ? Center( + child: Text( + "Nessuna partita giocata.\nScendi in campo!", + textAlign: TextAlign.center, + style: TextStyle(color: theme.text.withOpacity(0.5), fontSize: 18, fontWeight: FontWeight.bold), + ), + ) + : ListView.builder( + padding: const EdgeInsets.all(20), + itemCount: history.length, + itemBuilder: (context, index) { + final match = history[index]; + + DateTime date = DateTime.parse(match['date']); + String formattedDate = DateFormat('dd MMM yyyy - HH:mm').format(date); + + // Leggiamo entrambi i nomi + String myName = match['myName'] ?? "IO"; // Usa 'IO' se è una partita vecchia + String opponent = match['opponent']; + + int myScore = match['myScore']; + int oppScore = match['oppScore']; + bool isOnline = match['isOnline']; + + bool isWin = myScore > oppScore; + bool isDraw = myScore == oppScore; + + Color resultColor = isWin ? Colors.green : (isDraw ? Colors.grey : theme.playerRed); + String resultText = isWin ? "VITTORIA" : (isDraw ? "PAREGGIO" : "SCONFITTA"); + + return Container( + margin: const EdgeInsets.only(bottom: 15), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: theme.text.withOpacity(0.05), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: resultColor.withOpacity(0.5), width: 2), + boxShadow: [ + BoxShadow(color: Colors.black.withOpacity(0.2), offset: const Offset(0, 4), blurRadius: 6), + ], + ), + child: Row( + children: [ + // Icona Tipo di Partita + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: resultColor.withOpacity(0.1), + shape: BoxShape.circle, + ), + child: Icon( + isOnline ? Icons.public : (opponent.contains("CPU") ? Icons.smart_toy : Icons.people_alt), + color: resultColor, + size: 28, + ), + ), + const SizedBox(width: 15), + + // Dati Partita (Ora con i nomi chiari) + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(resultText, style: TextStyle(color: resultColor, fontWeight: FontWeight.w900, fontSize: 16, letterSpacing: 1.5)), + const SizedBox(height: 5), + // NOMI GIOCATORI + RichText( + text: TextSpan( + children: [ + TextSpan(text: myName, style: TextStyle(color: theme.playerBlue, fontWeight: FontWeight.bold, fontSize: 15)), + TextSpan(text: " vs ", style: TextStyle(color: theme.text.withOpacity(0.5), fontStyle: FontStyle.italic, fontSize: 12)), + TextSpan(text: opponent, style: TextStyle(color: theme.playerRed, fontWeight: FontWeight.bold, fontSize: 15)), + ] + ) + ), + const SizedBox(height: 5), + Text(formattedDate, style: TextStyle(color: theme.text.withOpacity(0.5), fontSize: 12)), + ], + ), + ), + + // Punteggio + Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + decoration: BoxDecoration( + color: theme.background, + borderRadius: BorderRadius.circular(15), + border: Border.all(color: theme.gridLine.withOpacity(0.3)), + ), + child: Row( + children: [ + Text("$myScore", style: TextStyle(fontSize: 22, fontWeight: FontWeight.w900, color: theme.playerBlue)), + Text(" - ", style: TextStyle(fontSize: 18, color: theme.text.withOpacity(0.5))), + Text("$oppScore", style: TextStyle(fontSize: 22, fontWeight: FontWeight.w900, color: theme.playerRed)), + ], + ), + ), + ], + ), + ); + }, + ), + ); + } +} \ No newline at end of file diff --git a/lib/ui/home/home_screen.dart b/lib/ui/home/home_screen.dart new file mode 100644 index 0000000..13476e8 --- /dev/null +++ b/lib/ui/home/home_screen.dart @@ -0,0 +1,1244 @@ +// =========================================================================== +// FILE: lib/ui/home/home_screen.dart +// =========================================================================== + +import 'dart:ui'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:flutter/services.dart'; +import 'dart:math' as math; +import 'package:google_fonts/google_fonts.dart'; +import '../../core/theme_manager.dart'; +import '../../core/app_colors.dart'; +import '../../models/game_board.dart'; +import '../game/game_screen.dart'; +import '../settings/settings_screen.dart'; +import '../../logic/game_controller.dart'; +import '../../services/storage_service.dart'; +import '../multiplayer/lobby_screen.dart'; +import 'history_screen.dart'; + +// --- HELPER PER IL FONT --- +TextStyle _getTextStyle(AppThemeType themeType, TextStyle baseStyle) { + if (themeType == AppThemeType.doodle) { + return GoogleFonts.permanentMarker(textStyle: baseStyle); + } + return baseStyle; +} + +// =========================================================================== +// IL NOSTRO "PITTORE" DI SCARABOCCHI +// Genera bordi irregolari, tratti doppi a penna e riempimenti sbavati. +// =========================================================================== +class _DoodleBackgroundPainter extends CustomPainter { + final Color fillColor; + final Color strokeColor; + final int seed; + final bool isCircle; + + _DoodleBackgroundPainter({required this.fillColor, required this.strokeColor, required this.seed, this.isCircle = false}); + + @override + void paint(Canvas canvas, Size size) { + final math.Random random = math.Random(seed); + + double wobble() => random.nextDouble() * 6 - 3; + + final Paint fillPaint = Paint() + ..color = fillColor + ..style = PaintingStyle.fill; + + final Paint strokePaint = Paint() + ..color = strokeColor + ..strokeWidth = 2.5 + ..style = PaintingStyle.stroke + ..strokeCap = StrokeCap.round + ..strokeJoin = StrokeJoin.round; + + if (isCircle) { + final Rect rect = Rect.fromLTWH(wobble(), wobble(), size.width + wobble(), size.height + wobble()); + + canvas.save(); + canvas.translate(wobble(), wobble()); + canvas.drawOval(rect, fillPaint); + canvas.restore(); + + canvas.drawOval(rect, strokePaint); + + canvas.save(); + canvas.translate(random.nextDouble() * 4 - 2, random.nextDouble() * 4 - 2); + canvas.drawOval(rect, strokePaint..strokeWidth = 1.0..color = strokeColor.withOpacity(0.6)); + canvas.restore(); + } else { + final Path path = Path(); + path.moveTo(wobble(), wobble()); + path.lineTo(size.width + wobble(), wobble()); + path.lineTo(size.width + wobble(), size.height + wobble()); + path.lineTo(wobble(), size.height + wobble()); + path.close(); + + final Path fillPath = Path(); + fillPath.moveTo(wobble() * 1.5, wobble() * 1.5); + fillPath.lineTo(size.width + wobble() * 1.5, wobble() * 1.5); + fillPath.lineTo(size.width + wobble() * 1.5, size.height + wobble() * 1.5); + fillPath.lineTo(wobble() * 1.5, size.height + wobble() * 1.5); + fillPath.close(); + + canvas.drawPath(fillPath, fillPaint); + + canvas.drawPath(path, strokePaint); + + canvas.save(); + canvas.translate(random.nextDouble() * 3 - 1.5, random.nextDouble() * 3 - 1.5); + canvas.drawPath(path, strokePaint..strokeWidth = 1.0..color = strokeColor.withOpacity(0.6)); + canvas.restore(); + } + } + + @override + bool shouldRepaint(covariant _DoodleBackgroundPainter oldDelegate) { + return oldDelegate.fillColor != fillColor || oldDelegate.strokeColor != strokeColor; + } +} + +// --- WIDGET PERSONALIZZATI --- + +class _NeonShapeButton extends StatelessWidget { + final IconData icon; + final String label; + final bool isSelected; + final ThemeColors theme; + final AppThemeType themeType; + final VoidCallback onTap; + final bool isLocked; + final bool isSpecial; + + const _NeonShapeButton({ + required this.icon, required this.label, required this.isSelected, + required this.theme, required this.themeType, required this.onTap, + this.isLocked = false, this.isSpecial = false + }); + + Color _getDoodleColor() { + switch (label) { + case 'Rombo': return Colors.lightBlue.shade200; + case 'Croce': return Colors.green.shade200; + case 'Buco': return Colors.pink.shade200; + case 'Clessidra': return Colors.purple.shade200; + case 'Caos': return Colors.grey.shade300; + default: return Colors.lightBlue.shade200; + } + } + + @override + Widget build(BuildContext context) { + if (themeType == AppThemeType.doodle) { + Color doodleColor = isLocked ? Colors.grey : _getDoodleColor(); + Color inkColor = const Color(0xFF111122); + double tilt = (label.length % 2 == 0) ? -0.05 : 0.04; + + return Transform.rotate( + angle: tilt, + child: GestureDetector( + onTap: isLocked ? null : onTap, + child: CustomPaint( + painter: _DoodleBackgroundPainter( + fillColor: isSelected ? doodleColor : Colors.white.withOpacity(0.8), + strokeColor: inkColor, + seed: label.length * 3, + ), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(isLocked ? Icons.lock : icon, color: inkColor, size: 24), + const SizedBox(height: 2), + Text(isLocked ? "Liv. 10" : label, style: _getTextStyle(themeType, TextStyle(color: inkColor, fontSize: 11, fontWeight: FontWeight.w900, letterSpacing: 0.5))), + ], + ), + ), + ), + ), + ); + } + + // --- STILE STANDARD --- + Color mainColor = isSpecial && !isLocked ? Colors.purpleAccent : theme.playerBlue; + return GestureDetector( + onTap: isLocked ? null : onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 250), + curve: Curves.easeOutCubic, + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12), + transform: Matrix4.translationValues(0, isSelected ? 2 : 0, 0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: isLocked + ? [Colors.grey.withOpacity(0.1), Colors.black.withOpacity(0.2)] + : isSelected + ? [mainColor.withOpacity(0.3), mainColor.withOpacity(0.1)] + : [theme.text.withOpacity(0.1), theme.text.withOpacity(0.02)], + ), + border: Border.all( + color: isLocked ? Colors.transparent : (isSelected ? mainColor : Colors.white.withOpacity(0.1)), + width: isSelected ? 2 : 1, + ), + boxShadow: isLocked ? [] : isSelected + ? [BoxShadow(color: mainColor.withOpacity(0.5), blurRadius: 15, spreadRadius: 1, offset: const Offset(0, 0))] + : [ + BoxShadow(color: Colors.black.withOpacity(0.4), blurRadius: 6, offset: const Offset(2, 4)), + BoxShadow(color: Colors.white.withOpacity(0.05), blurRadius: 2, offset: const Offset(-1, -1)), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(isLocked ? Icons.lock : icon, color: isLocked ? Colors.grey.withOpacity(0.5) : (isSelected ? Colors.white : theme.text.withOpacity(0.6)), size: 24), + const SizedBox(height: 6), + Text(isLocked ? "Liv. 10" : label, style: _getTextStyle(themeType, TextStyle(color: isLocked ? Colors.grey.withOpacity(0.5) : (isSelected ? Colors.white : theme.text.withOpacity(0.6)), fontSize: 11, fontWeight: isSelected ? FontWeight.w900 : FontWeight.bold))), + ], + ), + ), + ); + } +} + +class _NeonSizeButton extends StatelessWidget { + final String label; + final bool isSelected; + final ThemeColors theme; + final AppThemeType themeType; + final VoidCallback onTap; + + const _NeonSizeButton({required this.label, required this.isSelected, required this.theme, required this.themeType, required this.onTap}); + + @override + Widget build(BuildContext context) { + if (themeType == AppThemeType.doodle) { + Color doodleColor = label == 'MAX' ? Colors.red.shade200 : Colors.cyan.shade100; + Color inkColor = const Color(0xFF111122); + double tilt = (label == 'M' || label == 'MAX') ? 0.05 : -0.04; + + return Transform.rotate( + angle: tilt, + child: GestureDetector( + onTap: onTap, + child: CustomPaint( + painter: _DoodleBackgroundPainter( + fillColor: isSelected ? doodleColor : Colors.white.withOpacity(0.8), + strokeColor: inkColor, + seed: label.codeUnitAt(0), + isCircle: true, + ), + child: SizedBox( + width: 50, height: 50, + child: Center( + child: Text(label, style: _getTextStyle(themeType, TextStyle(color: inkColor, fontSize: 18, fontWeight: FontWeight.w900))), + ), + ), + ), + ), + ); + } + + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 250), + curve: Curves.easeOutCubic, + width: 50, height: 50, + transform: Matrix4.translationValues(0, isSelected ? 2 : 0, 0), + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: isSelected + ? [theme.playerRed.withOpacity(0.3), theme.playerRed.withOpacity(0.1)] + : [theme.text.withOpacity(0.1), theme.text.withOpacity(0.02)], + ), + border: Border.all( + color: isSelected ? theme.playerRed : Colors.white.withOpacity(0.1), + width: isSelected ? 2 : 1, + ), + boxShadow: isSelected + ? [BoxShadow(color: theme.playerRed.withOpacity(0.5), blurRadius: 15, spreadRadius: 1)] + : [ + BoxShadow(color: Colors.black.withOpacity(0.4), blurRadius: 6, offset: const Offset(2, 4)), + BoxShadow(color: Colors.white.withOpacity(0.05), blurRadius: 2, offset: const Offset(-1, -1)), + ], + ), + child: Center( + child: Text(label, style: _getTextStyle(themeType, TextStyle(color: isSelected ? Colors.white : theme.text.withOpacity(0.6), fontSize: 14, fontWeight: isSelected ? FontWeight.w900 : FontWeight.bold))), + ), + ), + ); + } +} + +class _NeonTimeSwitch extends StatelessWidget { + final bool isTimeMode; + final ThemeColors theme; + final AppThemeType themeType; + final VoidCallback onTap; + + const _NeonTimeSwitch({required this.isTimeMode, required this.theme, required this.themeType, required this.onTap}); + + @override + Widget build(BuildContext context) { + if (themeType == AppThemeType.doodle) { + Color doodleColor = Colors.orange.shade200; + Color inkColor = const Color(0xFF111122); + + return Transform.rotate( + angle: -0.015, + child: GestureDetector( + onTap: onTap, + child: CustomPaint( + painter: _DoodleBackgroundPainter( + fillColor: isTimeMode ? doodleColor : Colors.white.withOpacity(0.8), + strokeColor: inkColor, + seed: 42, + ), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(isTimeMode ? Icons.timer : Icons.timer_off, color: inkColor, size: 28), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text(isTimeMode ? 'A TEMPO' : 'RELAX', style: _getTextStyle(themeType, TextStyle(color: inkColor, fontWeight: FontWeight.w900, fontSize: 16, letterSpacing: 2.0))), + Text(isTimeMode ? '15 sec a mossa' : 'Nessun limite', style: _getTextStyle(themeType, TextStyle(color: inkColor.withOpacity(0.8), fontSize: 13, fontWeight: FontWeight.bold))), + ], + ), + ], + ), + ), + ), + ), + ); + } + + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: isTimeMode + ? [Colors.amber.withOpacity(0.25), Colors.amber.withOpacity(0.05)] + : [theme.text.withOpacity(0.1), theme.text.withOpacity(0.02)], + ), + border: Border.all( + color: isTimeMode ? Colors.amber : Colors.white.withOpacity(0.1), + width: isTimeMode ? 2 : 1, + ), + boxShadow: isTimeMode + ? [BoxShadow(color: Colors.amber.withOpacity(0.3), blurRadius: 15, spreadRadius: 2)] + : [ + BoxShadow(color: Colors.black.withOpacity(0.4), blurRadius: 6, offset: const Offset(2, 4)), + BoxShadow(color: Colors.white.withOpacity(0.05), blurRadius: 2, offset: const Offset(-1, -1)), + ], + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(isTimeMode ? Icons.timer : Icons.timer_off, color: isTimeMode ? Colors.amber : theme.text.withOpacity(0.5), size: 28), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text(isTimeMode ? 'A TEMPO' : 'RELAX', style: _getTextStyle(themeType, TextStyle(color: isTimeMode ? Colors.white : theme.text.withOpacity(0.5), fontWeight: FontWeight.w900, fontSize: 14, letterSpacing: 1.5))), + Text(isTimeMode ? '15 sec a mossa' : 'Nessun limite', style: _getTextStyle(themeType, TextStyle(color: isTimeMode ? Colors.amber.shade200 : theme.text.withOpacity(0.4), fontSize: 11, fontWeight: FontWeight.bold))), + ], + ), + ], + ), + ), + ); + } +} + +// --------------------------------------------------------------------------- + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State with WidgetsBindingObserver { + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); + WidgetsBinding.instance.addPostFrameCallback((_) { + _checkPlayerName(); + }); + _checkClipboardForInvite(); + } + + @override + void dispose() { + WidgetsBinding.instance.removeObserver(this); + super.dispose(); + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.resumed) { + _checkClipboardForInvite(); + } + } + + void _checkPlayerName() { + if (StorageService.instance.playerName.isEmpty) { + _showNameDialog(); + } + } + + void _showNameDialog() { + final TextEditingController nameController = TextEditingController(text: StorageService.instance.playerName); + showDialog( + context: context, + barrierDismissible: false, + barrierColor: Colors.black.withOpacity(0.8), + builder: (context) { + final themeManager = context.watch(); + final theme = themeManager.currentColors; + final themeType = themeManager.currentThemeType; + Color inkColor = const Color(0xFF111122); + + Widget dialogContent = themeType == AppThemeType.doodle + ? CustomPaint( + painter: _DoodleBackgroundPainter(fillColor: Colors.yellow.shade100, strokeColor: inkColor, seed: 100), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 25.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('BENVENUTO!', style: _getTextStyle(themeType, TextStyle(color: inkColor, fontWeight: FontWeight.w900, fontSize: 28, letterSpacing: 2.0)), textAlign: TextAlign.center), + const SizedBox(height: 20), + Text('Scegli il tuo nome da battaglia', style: _getTextStyle(themeType, TextStyle(color: inkColor.withOpacity(0.8), fontSize: 18)), textAlign: TextAlign.center), + const SizedBox(height: 30), + TextField( + controller: nameController, textCapitalization: TextCapitalization.characters, textAlign: TextAlign.center, maxLength: 5, + style: _getTextStyle(themeType, TextStyle(color: inkColor, fontSize: 36, fontWeight: FontWeight.bold, letterSpacing: 8)), + decoration: InputDecoration( + hintText: 'NOME', hintStyle: _getTextStyle(themeType, TextStyle(color: inkColor.withOpacity(0.3), letterSpacing: 4)), + filled: false, counterText: "", + enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: inkColor, width: 3)), + focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red.shade200, width: 5)), + ), + ), + const SizedBox(height: 40), + GestureDetector( + onTap: () { + final name = nameController.text.trim(); + if (name.isNotEmpty) { + StorageService.instance.savePlayerName(name); + Navigator.of(context).pop(); + setState(() {}); + } + }, + child: CustomPaint( + painter: _DoodleBackgroundPainter(fillColor: Colors.green.shade200, strokeColor: inkColor, seed: 101), + child: Container( + width: double.infinity, height: 60, + alignment: Alignment.center, + child: Text('SALVA E GIOCA', style: _getTextStyle(themeType, TextStyle(color: inkColor, fontSize: 22, fontWeight: FontWeight.bold, letterSpacing: 1.5))), + ), + ), + ), + ], + ), + ), + ) + : Container( + decoration: BoxDecoration( + color: theme.background, + borderRadius: BorderRadius.circular(25), + border: Border.all(color: theme.playerBlue.withOpacity(0.5), width: 2), + boxShadow: [BoxShadow(color: theme.playerBlue.withOpacity(0.3), blurRadius: 20, spreadRadius: 5)] + ), + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 30.0, horizontal: 25.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('BENVENUTO IN TETRAQ!', style: _getTextStyle(themeType, TextStyle(color: theme.text, fontWeight: FontWeight.w900, fontSize: 24, letterSpacing: 1.5)), textAlign: TextAlign.center), + const SizedBox(height: 20), + Text('Scegli il tuo nome da battaglia per sfidare i tuoi amici online.', style: _getTextStyle(themeType, TextStyle(color: theme.text.withOpacity(0.8), fontSize: 16)), textAlign: TextAlign.center), + const SizedBox(height: 40), + TextField( + controller: nameController, textCapitalization: TextCapitalization.characters, textAlign: TextAlign.center, maxLength: 5, + style: _getTextStyle(themeType, TextStyle(color: theme.text, fontSize: 32, fontWeight: FontWeight.bold, letterSpacing: 8)), + decoration: InputDecoration( + hintText: 'NOME', hintStyle: _getTextStyle(themeType, TextStyle(color: theme.text.withOpacity(0.3), letterSpacing: 4)), + filled: true, fillColor: theme.text.withOpacity(0.05), counterText: "", + enabledBorder: OutlineInputBorder(borderSide: BorderSide(color: theme.gridLine.withOpacity(0.5), width: 2), borderRadius: BorderRadius.circular(15)), + focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: theme.playerBlue, width: 3), borderRadius: BorderRadius.circular(15)), + ), + ), + const SizedBox(height: 40), + SizedBox( + width: double.infinity, height: 55, + child: ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: theme.playerBlue, foregroundColor: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15))), + onPressed: () { + final name = nameController.text.trim(); + if (name.isNotEmpty) { + StorageService.instance.savePlayerName(name); + Navigator.of(context).pop(); + setState(() {}); + } + }, + child: Text('SALVA E GIOCA', style: _getTextStyle(themeType, const TextStyle(fontSize: 18, fontWeight: FontWeight.bold, letterSpacing: 1.5))), + ), + ), + ], + ), + ), + ), + ); + + if (themeType == AppThemeType.cyberpunk) dialogContent = _AnimatedCyberBorder(child: dialogContent); + return Dialog(backgroundColor: Colors.transparent, insetPadding: const EdgeInsets.all(20), child: dialogContent); + }, + ); + } + + Future _checkClipboardForInvite() async { + try { + ClipboardData? data = await Clipboard.getData(Clipboard.kTextPlain); + String? text = data?.text; + + if (text != null && text.contains("TetraQ") && text.contains("codice:")) { + RegExp regExp = RegExp(r'codice:\s*([A-Z0-9]{5})', caseSensitive: false); + Match? match = regExp.firstMatch(text); + + if (match != null) { + String roomCode = match.group(1)!.toUpperCase(); + await Clipboard.setData(const ClipboardData(text: '')); + if (mounted && ModalRoute.of(context)?.isCurrent == true) { + _promptJoinRoom(roomCode); + } + } + } + } catch (e) { + debugPrint("Errore lettura appunti: $e"); + } + } + + void _promptJoinRoom(String roomCode) { + showDialog( + context: context, + builder: (context) { + final theme = context.watch().currentColors; + final themeType = context.read().currentThemeType; + return AlertDialog( + backgroundColor: themeType == AppThemeType.doodle ? Colors.white : theme.background, + shape: themeType == AppThemeType.doodle ? RoundedRectangleBorder(borderRadius: BorderRadius.circular(15), side: BorderSide(color: theme.text, width: 2)) : null, + title: Text("Invito Trovato!", style: _getTextStyle(themeType, TextStyle(color: theme.text, fontWeight: FontWeight.bold))), + content: Text("Vuoi unirti alla stanza $roomCode?", style: _getTextStyle(themeType, TextStyle(color: theme.text))), + actions: [ + TextButton(onPressed: () => Navigator.pop(context), child: Text("No", style: _getTextStyle(themeType, const TextStyle(color: Colors.red)))), + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: themeType == AppThemeType.doodle ? Colors.transparent : theme.playerBlue, + elevation: 0, + side: themeType == AppThemeType.doodle ? BorderSide(color: theme.text, width: 1.5) : BorderSide.none, + ), + onPressed: () { + Navigator.of(context).pop(); + Navigator.push(context, MaterialPageRoute(builder: (_) => LobbyScreen(initialRoomCode: roomCode))); + }, + child: Text("Unisciti", style: _getTextStyle(themeType, TextStyle(color: themeType == AppThemeType.doodle ? theme.text : Colors.white, fontWeight: FontWeight.bold))), + ), + ], + ); + } + ); + } + + // --- MENU SETUP PARTITA (Popup per CPU e Locale) --- + void _showMatchSetupDialog(bool isVsCPU) { + int localRadius = 4; + ArenaShape localShape = ArenaShape.classic; + bool localTimeMode = true; + int cpuLevel = StorageService.instance.cpuLevel; + bool isChaosUnlocked = cpuLevel >= 10; + + showDialog( + context: context, + barrierColor: Colors.black.withOpacity(0.8), + builder: (ctx) { + final themeManager = ctx.watch(); + final theme = themeManager.currentColors; + final themeType = themeManager.currentThemeType; + Color inkColor = const Color(0xFF111122); + + return StatefulBuilder( + builder: (context, setStateDialog) { + Widget dialogContent = themeType == AppThemeType.doodle + ? Transform.rotate( + angle: 0.015, + child: CustomPaint( + painter: _DoodleBackgroundPainter(fillColor: Colors.white.withOpacity(0.95), strokeColor: inkColor, seed: 200), + child: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + child: Padding( + padding: const EdgeInsets.all(25.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(isVsCPU ? "SFIDA IA" : "MODALITÀ LOCALE", style: _getTextStyle(themeType, TextStyle(fontSize: 26, fontWeight: FontWeight.w900, color: inkColor, letterSpacing: 2))), + const SizedBox(height: 25), + + Text("FORMA ARENA", style: _getTextStyle(themeType, TextStyle(fontSize: 14, fontWeight: FontWeight.w900, color: inkColor.withOpacity(0.6), letterSpacing: 1.5))), + const SizedBox(height: 15), + Wrap( + spacing: 12, runSpacing: 12, alignment: WrapAlignment.center, + children: [ + _NeonShapeButton(icon: Icons.diamond_outlined, label: 'Rombo', isSelected: localShape == ArenaShape.classic, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localShape = ArenaShape.classic)), + _NeonShapeButton(icon: Icons.add, label: 'Croce', isSelected: localShape == ArenaShape.cross, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localShape = ArenaShape.cross)), + _NeonShapeButton(icon: Icons.donut_large, label: 'Buco', isSelected: localShape == ArenaShape.donut, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localShape = ArenaShape.donut)), + _NeonShapeButton(icon: Icons.hourglass_bottom, label: 'Clessidra', isSelected: localShape == ArenaShape.hourglass, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localShape = ArenaShape.hourglass)), + _NeonShapeButton(icon: Icons.all_inclusive, label: 'Caos', isSelected: localShape == ArenaShape.chaos, theme: theme, themeType: themeType, isSpecial: true, isLocked: !isChaosUnlocked, onTap: () => setStateDialog(() => localShape = ArenaShape.chaos)), + ], + ), + + const SizedBox(height: 25), + Divider(color: inkColor.withOpacity(0.3), thickness: 2.5), + const SizedBox(height: 20), + + Text("GRANDEZZA", style: _getTextStyle(themeType, TextStyle(fontSize: 14, fontWeight: FontWeight.w900, color: inkColor.withOpacity(0.6), letterSpacing: 1.5))), + const SizedBox(height: 15), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + _NeonSizeButton(label: 'S', isSelected: localRadius == 3, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localRadius = 3)), + _NeonSizeButton(label: 'M', isSelected: localRadius == 4, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localRadius = 4)), + _NeonSizeButton(label: 'L', isSelected: localRadius == 5, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localRadius = 5)), + _NeonSizeButton(label: 'MAX', isSelected: localRadius == 6, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localRadius = 6)), + ], + ), + + const SizedBox(height: 25), + Divider(color: inkColor.withOpacity(0.3), thickness: 2.5), + const SizedBox(height: 20), + + Text("TEMPO", style: _getTextStyle(themeType, TextStyle(fontSize: 14, fontWeight: FontWeight.w900, color: inkColor.withOpacity(0.6), letterSpacing: 1.5))), + const SizedBox(height: 10), + _NeonTimeSwitch(isTimeMode: localTimeMode, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localTimeMode = !localTimeMode)), + + const SizedBox(height: 35), + + Transform.rotate( + angle: -0.02, + child: GestureDetector( + onTap: () { + Navigator.pop(ctx); + context.read().startNewGame(localRadius, vsCPU: isVsCPU, shape: localShape, timeMode: localTimeMode); + Navigator.push(context, MaterialPageRoute(builder: (_) => const GameScreen())); + }, + child: CustomPaint( + painter: _DoodleBackgroundPainter(fillColor: Colors.green.shade200, strokeColor: inkColor, seed: 300), + child: Container( + height: 65, width: double.infinity, + alignment: Alignment.center, + child: Text("AVVIA PARTITA", style: _getTextStyle(themeType, TextStyle(fontSize: 22, fontWeight: FontWeight.w900, letterSpacing: 3.0, color: inkColor))), + ), + ), + ), + ) + ], + ), + ), + ), + ), + ) + : Container( + decoration: BoxDecoration( + gradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [theme.background.withOpacity(0.95), theme.background.withOpacity(0.8)]), + borderRadius: BorderRadius.circular(25), + border: themeType == AppThemeType.cyberpunk ? null : Border.all(color: Colors.white.withOpacity(0.15), width: 1.5), + boxShadow: themeType == AppThemeType.cyberpunk ? [] : [BoxShadow(color: Colors.black.withOpacity(0.5), blurRadius: 20, offset: const Offset(4, 10))], + ), + child: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(isVsCPU ? "SFIDA IA" : "MODALITÀ LOCALE", style: _getTextStyle(themeType, TextStyle(fontSize: 24, fontWeight: FontWeight.w900, color: theme.text, letterSpacing: 2))), + const SizedBox(height: 20), + + Text("FORMA ARENA", style: _getTextStyle(themeType, TextStyle(fontSize: 12, fontWeight: FontWeight.w900, color: theme.text.withOpacity(0.5), letterSpacing: 1.5))), + const SizedBox(height: 10), + Wrap( + spacing: 10, runSpacing: 10, alignment: WrapAlignment.center, + children: [ + _NeonShapeButton(icon: Icons.diamond_outlined, label: 'Rombo', isSelected: localShape == ArenaShape.classic, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localShape = ArenaShape.classic)), + _NeonShapeButton(icon: Icons.add, label: 'Croce', isSelected: localShape == ArenaShape.cross, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localShape = ArenaShape.cross)), + _NeonShapeButton(icon: Icons.donut_large, label: 'Buco', isSelected: localShape == ArenaShape.donut, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localShape = ArenaShape.donut)), + _NeonShapeButton(icon: Icons.hourglass_bottom, label: 'Clessidra', isSelected: localShape == ArenaShape.hourglass, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localShape = ArenaShape.hourglass)), + _NeonShapeButton(icon: Icons.all_inclusive, label: 'Caos', isSelected: localShape == ArenaShape.chaos, theme: theme, themeType: themeType, isSpecial: true, isLocked: !isChaosUnlocked, onTap: () => setStateDialog(() => localShape = ArenaShape.chaos)), + ], + ), + + const SizedBox(height: 20), + Divider(color: Colors.white.withOpacity(0.05), thickness: 2), + const SizedBox(height: 20), + + Text("GRANDEZZA", style: _getTextStyle(themeType, TextStyle(fontSize: 12, fontWeight: FontWeight.w900, color: theme.text.withOpacity(0.5), letterSpacing: 1.5))), + const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + _NeonSizeButton(label: 'S', isSelected: localRadius == 3, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localRadius = 3)), + _NeonSizeButton(label: 'M', isSelected: localRadius == 4, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localRadius = 4)), + _NeonSizeButton(label: 'L', isSelected: localRadius == 5, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localRadius = 5)), + _NeonSizeButton(label: 'MAX', isSelected: localRadius == 6, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localRadius = 6)), + ], + ), + + const SizedBox(height: 20), + Divider(color: Colors.white.withOpacity(0.05), thickness: 2), + const SizedBox(height: 20), + + Text("TEMPO", style: _getTextStyle(themeType, TextStyle(fontSize: 12, fontWeight: FontWeight.w900, color: theme.text.withOpacity(0.5), letterSpacing: 1.5))), + const SizedBox(height: 10), + _NeonTimeSwitch(isTimeMode: localTimeMode, theme: theme, themeType: themeType, onTap: () => setStateDialog(() => localTimeMode = !localTimeMode)), + + const SizedBox(height: 30), + + SizedBox( + width: double.infinity, height: 60, + child: ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: isVsCPU ? Colors.purple.shade400 : theme.playerRed, foregroundColor: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20))), + onPressed: () { + Navigator.pop(ctx); + context.read().startNewGame(localRadius, vsCPU: isVsCPU, shape: localShape, timeMode: localTimeMode); + Navigator.push(context, MaterialPageRoute(builder: (_) => const GameScreen())); + }, + child: const Text("AVVIA PARTITA", style: TextStyle(fontSize: 18, fontWeight: FontWeight.w900, letterSpacing: 2)), + ), + ) + ], + ), + ), + ), + ); + + if (themeType == AppThemeType.cyberpunk) { + dialogContent = _AnimatedCyberBorder(child: dialogContent); + } + + return Dialog(backgroundColor: Colors.transparent, insetPadding: const EdgeInsets.symmetric(horizontal: 15, vertical: 20), child: dialogContent); + }, + ); + } + ); + } + + // --- MENU TUTORIAL (TESTO AGGIORNATO PER TETRAQ) --- + void _showTutorialDialog() { + showDialog( + context: context, + barrierColor: Colors.black.withOpacity(0.8), + builder: (ctx) { + final themeManager = ctx.watch(); + final theme = themeManager.currentColors; + final themeType = themeManager.currentThemeType; + Color inkColor = const Color(0xFF111122); + + Widget dialogContent = themeType == AppThemeType.doodle + ? Transform.rotate( + angle: -0.01, + child: CustomPaint( + painter: _DoodleBackgroundPainter(fillColor: Colors.yellow.shade100, strokeColor: inkColor, seed: 400), + child: Padding( + padding: const EdgeInsets.all(25.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text("COME GIOCARE", style: _getTextStyle(themeType, TextStyle(fontSize: 28, fontWeight: FontWeight.w900, color: inkColor, letterSpacing: 2))), + const SizedBox(height: 20), + // TESTO MODIFICATO PER EVIDENZIARE IL POSIZIONAMENTO LIBERO + _TutorialStep(icon: Icons.line_axis, text: "Lo scopo del gioco è chiudere i 4 lati di un quadrato per conquistare un punto.", themeType: themeType, inkColor: inkColor, theme: theme), + const SizedBox(height: 15), + // TESTO MODIFICATO PER L'EFFETTO TOROIDALE + _TutorialStep(icon: Icons.all_out, text: "durante il gioco troverai dei bonus e dei malus impara a trarne profitto", themeType: themeType, inkColor: inkColor, theme: theme), + const SizedBox(height: 15), + // TESTO MODIFICATO PER LA VITTORIA E LE FORME + + GestureDetector( + onTap: () => Navigator.pop(ctx), + child: CustomPaint( + painter: _DoodleBackgroundPainter(fillColor: Colors.red.shade200, strokeColor: inkColor, seed: 401), + child: Container( + height: 50, width: 150, + alignment: Alignment.center, + child: Text("HO CAPITO!", style: _getTextStyle(themeType, TextStyle(fontSize: 18, fontWeight: FontWeight.w900, color: inkColor))), + ), + ), + ) + ], + ), + ), + ), + ) + : Container( + padding: const EdgeInsets.all(25.0), + decoration: BoxDecoration( + gradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [theme.background.withOpacity(0.95), theme.background.withOpacity(0.8)]), + borderRadius: BorderRadius.circular(25), + border: themeType == AppThemeType.cyberpunk ? null : Border.all(color: Colors.white.withOpacity(0.15), width: 1.5), + boxShadow: themeType == AppThemeType.cyberpunk ? [] : [BoxShadow(color: Colors.black.withOpacity(0.5), blurRadius: 20, offset: const Offset(4, 10))], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text("COME GIOCARE", style: _getTextStyle(themeType, TextStyle(fontSize: 24, fontWeight: FontWeight.w900, color: theme.text, letterSpacing: 2))), + const SizedBox(height: 20), + // TESTO MODIFICATO + _TutorialStep(icon: Icons.line_axis, text: "Lo scopo del gioco è chiudere i 4 lati di un quadrato per conquistare un punto.", themeType: themeType, inkColor: inkColor, theme: theme), + const SizedBox(height: 15), + // TESTO MODIFICATO PER L'EFFETTO TOROIDALE + _TutorialStep(icon: Icons.all_out, text: "durante il gioco troverai dei bonus e dei malus impara a trarne profitto", themeType: themeType, inkColor: inkColor, theme: theme), + const SizedBox(height: 15), + SizedBox( + width: double.infinity, height: 50, + child: ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: theme.playerBlue, foregroundColor: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15))), + onPressed: () => Navigator.pop(ctx), + child: const Text("CHIUDI", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w900, letterSpacing: 2)), + ), + ) + ], + ), + ); + + if (themeType == AppThemeType.cyberpunk) dialogContent = _AnimatedCyberBorder(child: dialogContent); + return Dialog(backgroundColor: Colors.transparent, insetPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20), child: dialogContent); + }, + ); + } + + Widget _buildCyberCard(Widget card, AppThemeType themeType) { + if (themeType == AppThemeType.cyberpunk) { + return _AnimatedCyberBorder(child: card); + } + return card; + } + + @override + Widget build(BuildContext context) { + SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); + + final themeManager = context.watch(); + final themeType = themeManager.currentThemeType; + final theme = themeManager.currentColors; + Color inkColor = const Color(0xFF111122); + + String? bgImage; + if (themeType == AppThemeType.wood) bgImage = 'assets/images/wood_bg.jpg'; + if (themeType == AppThemeType.doodle) bgImage = 'assets/images/doodle_bg.jpg'; + if (themeType == AppThemeType.cyberpunk) bgImage = 'assets/images/cyber_bg.jpg'; + + int wins = StorageService.instance.wins; + int losses = StorageService.instance.losses; + String playerName = StorageService.instance.playerName; + if (playerName.isEmpty) playerName = "GUEST"; + + Widget uiContent = SafeArea( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // --- HEADER --- + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: _showNameDialog, + child: Row( + children: [ + themeType == AppThemeType.doodle + ? CustomPaint( + painter: _DoodleBackgroundPainter(fillColor: Colors.white.withOpacity(0.8), strokeColor: inkColor, seed: 1, isCircle: true), + child: SizedBox(width: 50, height: 50, child: Icon(Icons.person, color: inkColor, size: 30)), + ) + : Container( + decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [BoxShadow(color: theme.playerBlue.withOpacity(0.3), blurRadius: 10, offset: const Offset(0, 4))]), + child: CircleAvatar(backgroundColor: theme.playerBlue.withOpacity(0.2), radius: 25, child: Icon(Icons.person, color: theme.playerBlue, size: 30)), + ), + const SizedBox(width: 12), + Text(playerName, style: _getTextStyle(themeType, TextStyle(color: themeType == AppThemeType.doodle ? inkColor : theme.text, fontSize: 26, fontWeight: FontWeight.w900, letterSpacing: 1.5, shadows: themeType == AppThemeType.doodle ? [] : [Shadow(color: Colors.black.withOpacity(0.5), offset: const Offset(1, 2), blurRadius: 2)]))), + ], + ), + ), + + GestureDetector( + onTap: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const HistoryScreen())), + child: themeType == AppThemeType.doodle + ? Transform.rotate( + angle: 0.04, + child: CustomPaint( + painter: _DoodleBackgroundPainter(fillColor: Colors.yellow.shade100, strokeColor: inkColor, seed: 2), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + child: Row( + children: [ + Icon(Icons.emoji_events, color: inkColor, size: 20), const SizedBox(width: 6), + Text("$wins", style: _getTextStyle(themeType, TextStyle(color: inkColor, fontWeight: FontWeight.w900))), const SizedBox(width: 12), + Icon(Icons.sentiment_very_dissatisfied, color: inkColor, size: 20), const SizedBox(width: 6), + Text("$losses", style: _getTextStyle(themeType, TextStyle(color: inkColor, fontWeight: FontWeight.w900))), + ], + ), + ), + ), + ) + : Container( + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10), + decoration: BoxDecoration( + gradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [theme.text.withOpacity(0.15), theme.text.withOpacity(0.02)]), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: Colors.white.withOpacity(0.1), width: 1.5), + boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.3), offset: const Offset(2, 4), blurRadius: 8), BoxShadow(color: Colors.white.withOpacity(0.05), offset: const Offset(-1, -1), blurRadius: 2)], + ), + child: Row( + children: [ + Icon(Icons.emoji_events, color: Colors.amber.shade600, size: 20), const SizedBox(width: 6), + Text("$wins", style: _getTextStyle(themeType, const TextStyle(color: Colors.white, fontWeight: FontWeight.w900))), const SizedBox(width: 12), + Icon(Icons.sentiment_very_dissatisfied, color: theme.playerRed.withOpacity(0.8), size: 20), const SizedBox(width: 6), + Text("$losses", style: _getTextStyle(themeType, const TextStyle(color: Colors.white, fontWeight: FontWeight.w900))), + ], + ), + ), + ) + ], + ), + + const Spacer(), + + Center( + child: Transform.rotate( + angle: themeType == AppThemeType.doodle ? -0.04 : 0, + child: Text( + "TETRAQ", + style: _getTextStyle(themeType, TextStyle( + fontSize: 65, + fontWeight: FontWeight.w900, + color: themeType == AppThemeType.doodle ? inkColor : theme.text, + letterSpacing: 10, + shadows: themeType == AppThemeType.doodle ? [] : [ + BoxShadow(color: Colors.black.withOpacity(0.6), offset: const Offset(3, 6), blurRadius: 8), + BoxShadow(color: theme.playerBlue.withOpacity(0.4), offset: const Offset(0, 0), blurRadius: 20), + ] + )) + ), + ), + ), + + const Spacer(), + + // --- MENU PRINCIPALE CON COLORI PASTELLO --- + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + _buildCyberCard( + _FeatureCard( + title: "ONLINE", subtitle: "Sfida il mondo", icon: Icons.public, color: Colors.lightBlue.shade200, theme: theme, themeType: themeType, isFeatured: true, + onTap: () { Navigator.push(context, MaterialPageRoute(builder: (_) => const LobbyScreen())); }, + ), + themeType + ), + const SizedBox(height: 14), + _buildCyberCard( + _FeatureCard( + title: "VS CPU", subtitle: "Allenati con l'IA", icon: Icons.smart_toy, color: Colors.purple.shade200, theme: theme, themeType: themeType, + onTap: () => _showMatchSetupDialog(true), + ), + themeType + ), + const SizedBox(height: 14), + _buildCyberCard( + _FeatureCard( + title: "LOCALE", subtitle: "Stesso schermo", icon: Icons.people_alt, color: Colors.red.shade200, theme: theme, themeType: themeType, + onTap: () => _showMatchSetupDialog(false), + ), + themeType + ), + const SizedBox(height: 14), + // --- NUOVO BOTTONE TUTORIAL --- + _buildCyberCard( + _FeatureCard( + title: "TUTORIAL", subtitle: "Come giocare", icon: Icons.school, color: Colors.indigo.shade200, theme: theme, themeType: themeType, + onTap: _showTutorialDialog, + ), + themeType + ), + const SizedBox(height: 14), + _buildCyberCard( + _FeatureCard( + title: "TEMI", subtitle: "Personalizza", icon: Icons.palette, color: Colors.teal.shade200, theme: theme, themeType: themeType, + onTap: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const SettingsScreen())), + ), + themeType + ), + ], + ), + const SizedBox(height: 10), + ], + ), + ), + ); + + return Scaffold( + backgroundColor: bgImage != null ? Colors.transparent : theme.background, + body: Stack( + children: [ + Container(color: theme.background), + if (bgImage != null) + Positioned.fill( + child: Image.asset(bgImage, fit: BoxFit.cover, alignment: Alignment.center), + ), + if (bgImage != null) + Positioned.fill( + child: themeType == AppThemeType.cyberpunk + ? Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, end: Alignment.bottomCenter, + colors: [Colors.black.withOpacity(0.2), Colors.black.withOpacity(0.7)] + ) + ), + ) + : const SizedBox(), + ), + Positioned.fill(child: uiContent), + ], + ), + ); + } +} + +// --- HELPER PER IL TESTO DEL TUTORIAL --- +class _TutorialStep extends StatelessWidget { + final IconData icon; + final String text; + final AppThemeType themeType; + final Color inkColor; + final ThemeColors theme; + + const _TutorialStep({required this.icon, required this.text, required this.themeType, required this.inkColor, required this.theme}); + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(icon, color: themeType == AppThemeType.doodle ? inkColor : theme.playerBlue, size: 28), + const SizedBox(width: 15), + Expanded( + child: Text(text, style: _getTextStyle(themeType, TextStyle(fontSize: 16, color: themeType == AppThemeType.doodle ? inkColor : theme.text.withOpacity(0.8), height: 1.3))), + ), + ], + ); + } +} + +// --- FEATURE CARD --- +class _FeatureCard extends StatelessWidget { + final String title; + final String subtitle; + final IconData icon; + final Color color; + final ThemeColors theme; + final AppThemeType themeType; + final VoidCallback onTap; + final bool isFeatured; + + const _FeatureCard({required this.title, required this.subtitle, required this.icon, required this.color, required this.theme, required this.themeType, required this.onTap, this.isFeatured = false}); + + @override + Widget build(BuildContext context) { + if (themeType == AppThemeType.doodle) { + double tilt = (title.length % 2 == 0) ? -0.015 : 0.02; + Color inkColor = const Color(0xFF111122); + + return Transform.rotate( + angle: tilt, + child: GestureDetector( + onTap: onTap, + child: CustomPaint( + painter: _DoodleBackgroundPainter( + fillColor: color, + strokeColor: inkColor, + seed: title.length * 5, + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 22.0, vertical: 16.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon(icon, color: inkColor, size: 32), + const SizedBox(width: 20), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(title, style: _getTextStyle(themeType, TextStyle(color: inkColor, fontSize: 24, fontWeight: FontWeight.w900))), + const SizedBox(height: 2), + Text(subtitle, style: _getTextStyle(themeType, TextStyle(color: inkColor.withOpacity(0.8), fontSize: 14, fontWeight: FontWeight.bold))), + ], + ), + ), + Icon(Icons.chevron_right_rounded, color: inkColor.withOpacity(0.6), size: 32), + ], + ), + ), + ), + ), + ); + } + + // --- STILE STANDARD --- + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 14.0), + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: isFeatured + ? [color.withOpacity(0.9), color.withOpacity(0.6)] + : [theme.background.withOpacity(0.9), theme.background.withOpacity(0.5)], + ), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: Colors.white.withOpacity(isFeatured ? 0.3 : 0.1), width: 1.5), + boxShadow: [ + BoxShadow(color: Colors.black.withOpacity(0.6), offset: const Offset(0, 8), blurRadius: 15), + BoxShadow(color: Colors.white.withOpacity(isFeatured ? 0.2 : 0.05), offset: const Offset(-1, -1), blurRadius: 5), + ] + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [Colors.white.withOpacity(0.3), Colors.white.withOpacity(0.05)], + ), + shape: BoxShape.circle, + border: Border.all(color: Colors.white.withOpacity(0.2)), + boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.2), blurRadius: 5, offset: const Offset(2, 4))] + ), + child: Icon(icon, color: isFeatured ? Colors.white : color, size: 26), + ), + const SizedBox(width: 20), + + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(title, style: TextStyle(color: isFeatured ? Colors.white : theme.text, fontSize: 18, fontWeight: FontWeight.w900, shadows: [Shadow(color: Colors.black.withOpacity(0.5), offset: const Offset(1, 2), blurRadius: 2)])), + const SizedBox(height: 2), + Text(subtitle, style: TextStyle(color: isFeatured ? Colors.white.withOpacity(0.8) : theme.text.withOpacity(0.5), fontSize: 12, fontWeight: FontWeight.bold)), + ], + ), + ), + + Icon(Icons.chevron_right_rounded, color: isFeatured ? Colors.white.withOpacity(0.7) : theme.text.withOpacity(0.3), size: 30), + ], + ), + ), + ); + } +} + +class _AnimatedCyberBorder extends StatefulWidget { + final Widget child; + const _AnimatedCyberBorder({required this.child}); + @override + State<_AnimatedCyberBorder> createState() => _AnimatedCyberBorderState(); +} + +class _AnimatedCyberBorderState extends State<_AnimatedCyberBorder> with SingleTickerProviderStateMixin { + late AnimationController _controller; + @override + void initState() { super.initState(); _controller = AnimationController(vsync: this, duration: const Duration(seconds: 3))..repeat(); } + @override + void dispose() { _controller.dispose(); super.dispose(); } + @override + Widget build(BuildContext context) { + final theme = context.watch().currentColors; + return AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return CustomPaint( + painter: _CyberBorderPainter(animationValue: _controller.value, color1: theme.playerBlue, color2: theme.playerRed), + child: Container( + decoration: BoxDecoration(color: theme.background.withOpacity(0.9), borderRadius: BorderRadius.circular(20), boxShadow: [BoxShadow(color: theme.playerBlue.withOpacity(0.3), blurRadius: 25, spreadRadius: 2)]), + padding: const EdgeInsets.all(3), + child: widget.child, + ), + ); + }, + child: widget.child, + ); + } +} + +class _CyberBorderPainter extends CustomPainter { + final double animationValue; + final Color color1; + final Color color2; + + _CyberBorderPainter({required this.animationValue, required this.color1, required this.color2}); + + @override + void paint(Canvas canvas, Size size) { + final rect = Offset.zero & size; + final RRect rrect = RRect.fromRectAndRadius(rect, const Radius.circular(20)); + final Paint paint = Paint() + ..shader = SweepGradient(colors: [color1, color2, color1, color2, color1], stops: const [0.0, 0.25, 0.5, 0.75, 1.0], transform: GradientRotation(animationValue * 2 * math.pi)).createShader(rect) + ..style = PaintingStyle.stroke + ..strokeWidth = 4.0 + ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 4); + canvas.drawRRect(rrect, paint); + } + + @override + bool shouldRepaint(covariant _CyberBorderPainter oldDelegate) => oldDelegate.animationValue != animationValue; +} \ No newline at end of file diff --git a/lib/ui/multiplayer/lobby_screen.dart b/lib/ui/multiplayer/lobby_screen.dart new file mode 100644 index 0000000..c7d5fc5 --- /dev/null +++ b/lib/ui/multiplayer/lobby_screen.dart @@ -0,0 +1,810 @@ +// =========================================================================== +// FILE: lib/ui/multiplayer/lobby_screen.dart +// =========================================================================== + +import 'dart:ui'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'dart:math' as math; +import '../../core/theme_manager.dart'; +import '../../core/app_colors.dart'; +import '../../models/game_board.dart'; +import '../../services/multiplayer_service.dart'; +import '../../services/storage_service.dart'; +import '../game/game_screen.dart'; +import '../../logic/game_controller.dart'; +import 'package:google_fonts/google_fonts.dart'; + +// --- HELPER PER IL FONT --- +TextStyle _getTextStyle(AppThemeType themeType, TextStyle baseStyle) { + if (themeType == AppThemeType.doodle) { + return GoogleFonts.permanentMarker(textStyle: baseStyle); + } + return baseStyle; +} + +// --- WIDGET 3D/NEON RIUTILIZZABILI COMPATTATI --- + +class _NeonShapeButton extends StatelessWidget { + final IconData icon; + final String label; + final bool isSelected; + final ThemeColors theme; + final AppThemeType themeType; + final VoidCallback onTap; + final bool isLocked; + final bool isSpecial; + + const _NeonShapeButton({ + required this.icon, required this.label, required this.isSelected, + required this.theme, required this.themeType, required this.onTap, + this.isLocked = false, this.isSpecial = false + }); + + Color _getDoodleColor() { + switch (label) { + case 'Rombo': return Colors.blue.shade700; + case 'Croce': return Colors.teal.shade700; + case 'Buco': return Colors.pink.shade600; + case 'Clessidra': return Colors.deepPurple.shade600; + case 'Caos': return Colors.blueGrey.shade800; + default: return Colors.blue.shade700; + } + } + + @override + Widget build(BuildContext context) { + if (themeType == AppThemeType.doodle) { + Color doodleColor = isLocked ? Colors.grey : _getDoodleColor(); + double tilt = (label.length % 2 == 0) ? -0.03 : 0.04; + + return Transform.rotate( + angle: tilt, + child: GestureDetector( + onTap: isLocked ? null : onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 6), + transform: Matrix4.translationValues(0, isSelected ? 3 : 0, 0), + decoration: BoxDecoration( + color: isSelected ? doodleColor : Colors.white, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(15), topRight: Radius.circular(8), + bottomLeft: Radius.circular(6), bottomRight: Radius.circular(18), + ), + border: Border.all(color: isSelected ? theme.text : doodleColor.withOpacity(0.5), width: isSelected ? 2.5 : 1.5), + boxShadow: isSelected + ? [BoxShadow(color: theme.text.withOpacity(0.8), offset: const Offset(3, 4), blurRadius: 0)] + : [BoxShadow(color: doodleColor.withOpacity(0.2), offset: const Offset(2, 2), blurRadius: 0)], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(isLocked ? Icons.lock : icon, color: isSelected ? Colors.white : doodleColor, size: 20), + const SizedBox(height: 2), + Text(isLocked ? "Liv. 10" : label, style: _getTextStyle(themeType, TextStyle(color: isSelected ? Colors.white : doodleColor, fontSize: 9, fontWeight: FontWeight.w900, letterSpacing: 0.2))), + ], + ), + ), + ), + ); + } + + Color mainColor = isSpecial && !isLocked ? Colors.purpleAccent : theme.playerBlue; + return GestureDetector( + onTap: isLocked ? null : onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 250), + curve: Curves.easeOutCubic, + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), + transform: Matrix4.translationValues(0, isSelected ? 2 : 0, 0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: isLocked + ? [Colors.grey.withOpacity(0.1), Colors.black.withOpacity(0.2)] + : isSelected + ? [mainColor.withOpacity(0.3), mainColor.withOpacity(0.1)] + : [theme.text.withOpacity(0.1), theme.text.withOpacity(0.02)], + ), + border: Border.all( + color: isLocked ? Colors.transparent : (isSelected ? mainColor : Colors.white.withOpacity(0.1)), + width: isSelected ? 2 : 1, + ), + boxShadow: isLocked ? [] : isSelected + ? [BoxShadow(color: mainColor.withOpacity(0.5), blurRadius: 15, spreadRadius: 1, offset: const Offset(0, 0))] + : [ + BoxShadow(color: Colors.black.withOpacity(0.4), blurRadius: 6, offset: const Offset(2, 4)), + BoxShadow(color: Colors.white.withOpacity(0.05), blurRadius: 2, offset: const Offset(-1, -1)), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(isLocked ? Icons.lock : icon, color: isLocked ? Colors.grey.withOpacity(0.5) : (isSelected ? Colors.white : theme.text.withOpacity(0.6)), size: 20), + const SizedBox(height: 4), + Text(isLocked ? "Liv. 10" : label, style: _getTextStyle(themeType, TextStyle(color: isLocked ? Colors.grey.withOpacity(0.5) : (isSelected ? Colors.white : theme.text.withOpacity(0.6)), fontSize: 9, fontWeight: isSelected ? FontWeight.w900 : FontWeight.bold))), + ], + ), + ), + ); + } +} + +class _NeonSizeButton extends StatelessWidget { + final String label; + final bool isSelected; + final ThemeColors theme; + final AppThemeType themeType; + final VoidCallback onTap; + + const _NeonSizeButton({required this.label, required this.isSelected, required this.theme, required this.themeType, required this.onTap}); + + @override + Widget build(BuildContext context) { + if (themeType == AppThemeType.doodle) { + Color doodleColor = label == 'MAX' ? Colors.red.shade700 : Colors.blueGrey.shade600; + double tilt = (label == 'M' || label == 'MAX') ? 0.05 : -0.04; + + return Transform.rotate( + angle: tilt, + child: GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + width: 42, height: 40, + transform: Matrix4.translationValues(0, isSelected ? 3 : 0, 0), + decoration: BoxDecoration( + color: isSelected ? doodleColor : Colors.white, + borderRadius: const BorderRadius.all(Radius.elliptical(25, 20)), + border: Border.all(color: isSelected ? theme.text : doodleColor.withOpacity(0.5), width: 2), + boxShadow: isSelected + ? [BoxShadow(color: theme.text.withOpacity(0.8), offset: const Offset(3, 4), blurRadius: 0)] + : [BoxShadow(color: doodleColor.withOpacity(0.2), offset: const Offset(2, 2), blurRadius: 0)], + ), + child: Center( + child: Text(label, style: _getTextStyle(themeType, TextStyle(color: isSelected ? Colors.white : doodleColor, fontSize: 13, fontWeight: FontWeight.w900))), + ), + ), + ), + ); + } + + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 250), + curve: Curves.easeOutCubic, + width: 42, height: 42, + transform: Matrix4.translationValues(0, isSelected ? 2 : 0, 0), + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: isSelected + ? [theme.playerRed.withOpacity(0.3), theme.playerRed.withOpacity(0.1)] + : [theme.text.withOpacity(0.1), theme.text.withOpacity(0.02)], + ), + border: Border.all(color: isSelected ? theme.playerRed : Colors.white.withOpacity(0.1), width: isSelected ? 2 : 1), + boxShadow: isSelected + ? [BoxShadow(color: theme.playerRed.withOpacity(0.5), blurRadius: 15, spreadRadius: 1)] + : [ + BoxShadow(color: Colors.black.withOpacity(0.4), blurRadius: 6, offset: const Offset(2, 4)), + BoxShadow(color: Colors.white.withOpacity(0.05), blurRadius: 2, offset: const Offset(-1, -1)), + ], + ), + child: Center( + child: Text(label, style: _getTextStyle(themeType, TextStyle(color: isSelected ? Colors.white : theme.text.withOpacity(0.6), fontSize: 12, fontWeight: isSelected ? FontWeight.w900 : FontWeight.bold))), + ), + ), + ); + } +} + +class _NeonTimeSwitch extends StatelessWidget { + final bool isTimeMode; + final ThemeColors theme; + final AppThemeType themeType; + final VoidCallback onTap; + + const _NeonTimeSwitch({required this.isTimeMode, required this.theme, required this.themeType, required this.onTap}); + + @override + Widget build(BuildContext context) { + if (themeType == AppThemeType.doodle) { + Color doodleColor = Colors.orange.shade700; + return Transform.rotate( + angle: -0.015, + child: GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + transform: Matrix4.translationValues(0, isTimeMode ? 3 : 0, 0), + decoration: BoxDecoration( + color: isTimeMode ? doodleColor : Colors.white, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(8), topRight: Radius.circular(15), + bottomLeft: Radius.circular(15), bottomRight: Radius.circular(6), + ), + border: Border.all(color: isTimeMode ? theme.text : doodleColor.withOpacity(0.5), width: 2.5), + boxShadow: isTimeMode + ? [BoxShadow(color: theme.text.withOpacity(0.8), offset: const Offset(4, 5), blurRadius: 0)] + : [BoxShadow(color: doodleColor.withOpacity(0.2), offset: const Offset(2, 2), blurRadius: 0)], + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(isTimeMode ? Icons.timer : Icons.timer_off, color: isTimeMode ? Colors.white : doodleColor, size: 24), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text(isTimeMode ? 'A TEMPO' : 'RELAX', style: _getTextStyle(themeType, TextStyle(color: isTimeMode ? Colors.white : doodleColor, fontWeight: FontWeight.w900, fontSize: 14, letterSpacing: 2.0))), + Text(isTimeMode ? '15 sec a mossa' : 'Nessun limite', style: _getTextStyle(themeType, TextStyle(color: isTimeMode ? Colors.white : doodleColor.withOpacity(0.8), fontSize: 11, fontWeight: FontWeight.bold))), + ], + ), + ], + ), + ), + ), + ); + } + + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: isTimeMode + ? [Colors.amber.withOpacity(0.25), Colors.amber.withOpacity(0.05)] + : [theme.text.withOpacity(0.1), theme.text.withOpacity(0.02)], + ), + border: Border.all(color: isTimeMode ? Colors.amber : Colors.white.withOpacity(0.1), width: isTimeMode ? 2 : 1), + boxShadow: isTimeMode + ? [BoxShadow(color: Colors.amber.withOpacity(0.3), blurRadius: 15, spreadRadius: 2)] + : [ + BoxShadow(color: Colors.black.withOpacity(0.4), blurRadius: 6, offset: const Offset(2, 4)), + BoxShadow(color: Colors.white.withOpacity(0.05), blurRadius: 2, offset: const Offset(-1, -1)), + ], + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(isTimeMode ? Icons.timer : Icons.timer_off, color: isTimeMode ? Colors.amber : theme.text.withOpacity(0.5), size: 24), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text(isTimeMode ? 'A TEMPO' : 'RELAX', style: _getTextStyle(themeType, TextStyle(color: isTimeMode ? Colors.white : theme.text.withOpacity(0.5), fontWeight: FontWeight.w900, fontSize: 13, letterSpacing: 1.5))), + Text(isTimeMode ? '15 sec a mossa' : 'Nessun limite', style: _getTextStyle(themeType, TextStyle(color: isTimeMode ? Colors.amber.shade200 : theme.text.withOpacity(0.4), fontSize: 10, fontWeight: FontWeight.bold))), + ], + ), + ], + ), + ), + ); + } +} + +class _NeonActionButton extends StatelessWidget { + final String label; + final Color color; + final VoidCallback onTap; + final ThemeColors theme; + final AppThemeType themeType; + + const _NeonActionButton({required this.label, required this.color, required this.onTap, required this.theme, required this.themeType}); + + @override + Widget build(BuildContext context) { + if (themeType == AppThemeType.doodle) { + double tilt = (label == "UNISCITI") ? -0.015 : 0.02; + return Transform.rotate( + angle: tilt, + child: GestureDetector( + onTap: onTap, + child: Container( + height: 50, + decoration: BoxDecoration( + color: color, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(10), topRight: Radius.circular(20), + bottomLeft: Radius.circular(25), bottomRight: Radius.circular(10), + ), + border: Border.all(color: theme.text, width: 3.0), + boxShadow: [BoxShadow(color: theme.text.withOpacity(0.9), offset: const Offset(4, 4), blurRadius: 0)], + ), + child: Center( + child: Text(label, style: _getTextStyle(themeType, const TextStyle(fontSize: 20, fontWeight: FontWeight.w900, letterSpacing: 3.0, color: Colors.white))), + ), + ), + ), + ); + } + + return GestureDetector( + onTap: onTap, + child: Container( + height: 50, + decoration: BoxDecoration( + gradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [color.withOpacity(0.9), color.withOpacity(0.6)]), + borderRadius: BorderRadius.circular(15), + border: Border.all(color: Colors.white.withOpacity(0.3), width: 1.5), + boxShadow: [ + BoxShadow(color: Colors.black.withOpacity(0.5), offset: const Offset(4, 8), blurRadius: 12), + BoxShadow(color: color.withOpacity(0.3), offset: const Offset(0, 0), blurRadius: 15, spreadRadius: 1), + ], + ), + child: Center( + child: Text(label, style: _getTextStyle(themeType, const TextStyle(fontSize: 16, fontWeight: FontWeight.w900, letterSpacing: 2.0, color: Colors.white, shadows: [Shadow(color: Colors.black, blurRadius: 2, offset: Offset(1, 1))]))), + ), + ), + ); + } +} + +class _AnimatedCyberBorder extends StatefulWidget { + final Widget child; + const _AnimatedCyberBorder({required this.child}); + @override + State<_AnimatedCyberBorder> createState() => _AnimatedCyberBorderState(); +} + +class _AnimatedCyberBorderState extends State<_AnimatedCyberBorder> with SingleTickerProviderStateMixin { + late AnimationController _controller; + @override + void initState() { super.initState(); _controller = AnimationController(vsync: this, duration: const Duration(seconds: 3))..repeat(); } + @override + void dispose() { _controller.dispose(); super.dispose(); } + @override + Widget build(BuildContext context) { + final theme = context.watch().currentColors; + return AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return CustomPaint( + painter: _CyberBorderPainter(animationValue: _controller.value, color1: theme.playerBlue, color2: theme.playerRed), + child: Container( + decoration: BoxDecoration(color: Colors.transparent, borderRadius: BorderRadius.circular(20), boxShadow: [BoxShadow(color: theme.playerBlue.withOpacity(0.15), blurRadius: 20, spreadRadius: 2)]), + padding: const EdgeInsets.all(3), + child: widget.child, + ), + ); + }, + child: widget.child, + ); + } +} + +class _CyberBorderPainter extends CustomPainter { + final double animationValue; + final Color color1; + final Color color2; + + _CyberBorderPainter({required this.animationValue, required this.color1, required this.color2}); + + @override + void paint(Canvas canvas, Size size) { + final rect = Offset.zero & size; + final RRect rrect = RRect.fromRectAndRadius(rect, const Radius.circular(20)); + final Paint paint = Paint() + ..shader = SweepGradient(colors: [color1, color2, color1, color2, color1], stops: const [0.0, 0.25, 0.5, 0.75, 1.0], transform: GradientRotation(animationValue * 2 * math.pi)).createShader(rect) + ..style = PaintingStyle.stroke + ..strokeWidth = 3.0 + ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 3); + canvas.drawRRect(rrect, paint); + } + + @override + bool shouldRepaint(covariant _CyberBorderPainter oldDelegate) => oldDelegate.animationValue != animationValue; +} + +// --------------------------------------------------------------------------- + +class LobbyScreen extends StatefulWidget { + final String? initialRoomCode; + + const LobbyScreen({super.key, this.initialRoomCode}); + + @override + State createState() => _LobbyScreenState(); +} + +class _LobbyScreenState extends State { + final MultiplayerService _multiplayerService = MultiplayerService(); + late TextEditingController _codeController; + + bool _isLoading = false; + String? _myRoomCode; + String _playerName = ''; + + int _selectedRadius = 4; + ArenaShape _selectedShape = ArenaShape.classic; + bool _isTimeMode = true; + + @override + void initState() { + super.initState(); + _codeController = TextEditingController(); + _playerName = StorageService.instance.playerName; + + if (widget.initialRoomCode != null && widget.initialRoomCode!.isNotEmpty) { + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { _codeController.text = widget.initialRoomCode!; }); + }); + } + } + + @override + void dispose() { _codeController.dispose(); super.dispose(); } + + Future _createRoom() async { + if (_isLoading) return; + setState(() => _isLoading = true); + + try { + String code = await _multiplayerService.createGameRoom(_selectedRadius, _playerName, _selectedShape.name, _isTimeMode); + + if (!mounted) return; + setState(() { _myRoomCode = code; _isLoading = false; }); + + _multiplayerService.shareInviteLink(code); + _showWaitingDialog(code); + } catch (e) { + if (mounted) { setState(() => _isLoading = false); _showError("Errore durante la creazione della partita."); } + } + } + + Future _joinRoom() async { + if (_isLoading) return; + FocusScope.of(context).unfocus(); + + String code = _codeController.text.trim().toUpperCase(); + if (code.isEmpty || code.length != 5) { _showError("Inserisci un codice valido di 5 caratteri."); return; } + + setState(() => _isLoading = true); + + try { + Map? roomData = await _multiplayerService.joinGameRoom(code, _playerName); + + if (!mounted) return; + setState(() => _isLoading = false); + + if (roomData != null) { + ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("Stanza trovata! Partita in avvio..."), backgroundColor: Colors.green)); + + int hostRadius = roomData['radius'] ?? 4; + String shapeStr = roomData['shape'] ?? 'classic'; + ArenaShape hostShape = ArenaShape.values.firstWhere((e) => e.name == shapeStr, orElse: () => ArenaShape.classic); + bool hostTimeMode = roomData['timeMode'] ?? true; + + context.read().startNewGame(hostRadius, isOnline: true, roomCode: code, isHost: false, shape: hostShape, timeMode: hostTimeMode); + Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => const GameScreen())); + } else { + _showError("Stanza non trovata, piena o partita già iniziata."); + } + } catch (e) { + if (mounted) { setState(() => _isLoading = false); _showError("Errore di connessione: $e"); } + } + } + + void _showError(String message) { ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(message, style: const TextStyle(color: Colors.white)), backgroundColor: Colors.red)); } + + void _showWaitingDialog(String code) { + showDialog( + context: context, + barrierDismissible: false, + builder: (context) { + final theme = context.watch().currentColors; + final themeType = context.read().currentThemeType; + + Widget dialogContent = Column( + mainAxisSize: MainAxisSize.min, + children: [ + CircularProgressIndicator(color: theme.playerRed), const SizedBox(height: 25), + Text("CODICE STANZA", style: _getTextStyle(themeType, TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: theme.text.withOpacity(0.6), letterSpacing: 2))), + Text(code, style: _getTextStyle(themeType, TextStyle(fontSize: 40, fontWeight: FontWeight.w900, color: theme.playerRed, letterSpacing: 8, shadows: themeType == AppThemeType.doodle ? [] : [Shadow(color: theme.playerRed.withOpacity(0.5), blurRadius: 10)]))), + const SizedBox(height: 25), + Transform.rotate( + angle: themeType == AppThemeType.doodle ? 0.02 : 0, + child: Container( + padding: const EdgeInsets.all(18), + decoration: BoxDecoration( + color: themeType == AppThemeType.doodle ? Colors.white : theme.text.withOpacity(0.05), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: themeType == AppThemeType.doodle ? theme.text : theme.playerBlue.withOpacity(0.3), width: themeType == AppThemeType.doodle ? 2 : 1.5), + boxShadow: themeType == AppThemeType.doodle + ? [BoxShadow(color: theme.text.withOpacity(0.8), offset: const Offset(4, 4))] + : [BoxShadow(color: theme.playerBlue.withOpacity(0.1), blurRadius: 10)] + ), + child: Column( + children: [ + Icon(Icons.share, color: theme.playerBlue, size: 32), const SizedBox(height: 12), + Text("Invita un amico", textAlign: TextAlign.center, style: _getTextStyle(themeType, TextStyle(color: theme.text, fontWeight: FontWeight.w900, fontSize: 18))), + const SizedBox(height: 8), + Text("Condividi il codice. La partita inizierà appena si unirà.", textAlign: TextAlign.center, style: _getTextStyle(themeType, TextStyle(color: themeType == AppThemeType.doodle ? theme.text : theme.text.withOpacity(0.8), fontSize: 14, height: 1.5))), + ], + ), + ), + ), + ], + ); + + if (themeType == AppThemeType.cyberpunk) { + dialogContent = _AnimatedCyberBorder(child: dialogContent); + } else { + dialogContent = Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: themeType == AppThemeType.doodle ? Colors.white.withOpacity(0.95) : theme.background, + borderRadius: BorderRadius.circular(25), + border: Border.all(color: themeType == AppThemeType.doodle ? theme.text : theme.gridLine.withOpacity(0.5), width: 2), + boxShadow: themeType == AppThemeType.doodle ? [BoxShadow(color: theme.text.withOpacity(0.6), offset: const Offset(8, 8))] : [] + ), + child: dialogContent + ); + } + + return StreamBuilder( + stream: _multiplayerService.listenToRoom(code), + builder: (context, snapshot) { + if (snapshot.hasData && snapshot.data!.exists) { + var data = snapshot.data!.data() as Map; + if (data['status'] == 'playing') { + WidgetsBinding.instance.addPostFrameCallback((_) { + Navigator.pop(context); + context.read().startNewGame(_selectedRadius, isOnline: true, roomCode: code, isHost: true, shape: _selectedShape, timeMode: _isTimeMode); + Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => const GameScreen())); + }); + } + } + + return Dialog( + backgroundColor: Colors.transparent, + insetPadding: const EdgeInsets.all(20), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + dialogContent, + const SizedBox(height: 20), + TextButton( + onPressed: () { FirebaseFirestore.instance.collection('games').doc(code).delete(); Navigator.pop(context); }, + child: Text("ANNULLA", style: _getTextStyle(themeType, TextStyle(color: Colors.red, fontWeight: FontWeight.w900, fontSize: 20, letterSpacing: 2.0, shadows: themeType == AppThemeType.doodle ? [] : [const Shadow(color: Colors.black, blurRadius: 2)]))), + ), + ], + ), + ); + }, + ); + } + ); + } + + @override + Widget build(BuildContext context) { + final themeManager = context.watch(); + final themeType = themeManager.currentThemeType; + final theme = themeManager.currentColors; + + String? bgImage; + if (themeType == AppThemeType.wood) bgImage = 'assets/images/wood_bg.jpg'; + if (themeType == AppThemeType.doodle) bgImage = 'assets/images/doodle_bg.jpg'; + if (themeType == AppThemeType.cyberpunk) bgImage = 'assets/images/cyber_bg.jpg'; + + int cpuLevel = StorageService.instance.cpuLevel; + bool isChaosUnlocked = cpuLevel >= 10; + + Color doodlePenColor = const Color(0xFF00008B); + + // --- PANNELLO HOST --- + Widget hostPanel = Transform.rotate( + angle: themeType == AppThemeType.doodle ? 0.01 : 0, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 15), + decoration: BoxDecoration( + // Sfondo ancora più scuro (0.85) per il tema Cyberpunk + color: themeType == AppThemeType.cyberpunk ? Colors.black.withOpacity(0.85) : (themeType == AppThemeType.doodle ? Colors.white.withOpacity(0.5) : Colors.transparent), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(themeType == AppThemeType.doodle ? 5 : 20), + topRight: const Radius.circular(20), + bottomLeft: const Radius.circular(20), + bottomRight: Radius.circular(themeType == AppThemeType.doodle ? 5 : 20), + ), + border: themeType == AppThemeType.cyberpunk ? null : Border.all(color: themeType == AppThemeType.doodle ? theme.text.withOpacity(0.5) : Colors.white.withOpacity(0.15), width: themeType == AppThemeType.doodle ? 2 : 1.5), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Rinomato da IMPOSTAZIONI STANZA a IMPOSTAZIONI GRIGLIA + Center(child: Text("IMPOSTAZIONI GRIGLIA", textAlign: TextAlign.center, style: _getTextStyle(themeType, TextStyle(fontSize: 12, fontWeight: FontWeight.w900, color: themeType == AppThemeType.doodle ? theme.text : theme.text.withOpacity(0.6), letterSpacing: 2.0)))), + const SizedBox(height: 10), + + Text("FORMA ARENA", style: _getTextStyle(themeType, TextStyle(fontSize: 10, fontWeight: FontWeight.w900, color: themeType == AppThemeType.doodle ? theme.text : theme.text.withOpacity(0.5), letterSpacing: 1.5))), + const SizedBox(height: 6), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _NeonShapeButton(icon: Icons.diamond_outlined, label: 'Rombo', isSelected: _selectedShape == ArenaShape.classic, theme: theme, themeType: themeType, onTap: () => setState(() => _selectedShape = ArenaShape.classic)), + _NeonShapeButton(icon: Icons.add, label: 'Croce', isSelected: _selectedShape == ArenaShape.cross, theme: theme, themeType: themeType, onTap: () => setState(() => _selectedShape = ArenaShape.cross)), + _NeonShapeButton(icon: Icons.donut_large, label: 'Buco', isSelected: _selectedShape == ArenaShape.donut, theme: theme, themeType: themeType, onTap: () => setState(() => _selectedShape = ArenaShape.donut)), + _NeonShapeButton(icon: Icons.hourglass_bottom, label: 'Clessidra', isSelected: _selectedShape == ArenaShape.hourglass, theme: theme, themeType: themeType, onTap: () => setState(() => _selectedShape = ArenaShape.hourglass)), + _NeonShapeButton(icon: Icons.all_inclusive, label: 'Caos', isSelected: _selectedShape == ArenaShape.chaos, theme: theme, themeType: themeType, isSpecial: true, isLocked: !isChaosUnlocked, onTap: () => setState(() => _selectedShape = ArenaShape.chaos)), + ], + ), + + const SizedBox(height: 12), + Divider(color: themeType == AppThemeType.doodle ? theme.text.withOpacity(0.5) : Colors.white.withOpacity(0.05), thickness: themeType == AppThemeType.doodle ? 2.5 : 1.5), + const SizedBox(height: 12), + + Text("GRANDEZZA", style: _getTextStyle(themeType, TextStyle(fontSize: 10, fontWeight: FontWeight.w900, color: themeType == AppThemeType.doodle ? theme.text : theme.text.withOpacity(0.5), letterSpacing: 1.5))), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + _NeonSizeButton(label: 'S', isSelected: _selectedRadius == 3, theme: theme, themeType: themeType, onTap: () => setState(() => _selectedRadius = 3)), + _NeonSizeButton(label: 'M', isSelected: _selectedRadius == 4, theme: theme, themeType: themeType, onTap: () => setState(() => _selectedRadius = 4)), + _NeonSizeButton(label: 'L', isSelected: _selectedRadius == 5, theme: theme, themeType: themeType, onTap: () => setState(() => _selectedRadius = 5)), + _NeonSizeButton(label: 'MAX', isSelected: _selectedRadius == 6, theme: theme, themeType: themeType, onTap: () => setState(() => _selectedRadius = 6)), + ], + ), + + const SizedBox(height: 12), + Divider(color: themeType == AppThemeType.doodle ? theme.text.withOpacity(0.5) : Colors.white.withOpacity(0.05), thickness: themeType == AppThemeType.doodle ? 2.5 : 1.5), + const SizedBox(height: 12), + + Text("TEMPO", style: _getTextStyle(themeType, TextStyle(fontSize: 10, fontWeight: FontWeight.w900, color: themeType == AppThemeType.doodle ? theme.text : theme.text.withOpacity(0.5), letterSpacing: 1.5))), + const SizedBox(height: 8), + _NeonTimeSwitch(isTimeMode: _isTimeMode, theme: theme, themeType: themeType, onTap: () => setState(() => _isTimeMode = !_isTimeMode)), + ], + ), + ), + ); + + if (themeType == AppThemeType.cyberpunk) { + hostPanel = _AnimatedCyberBorder(child: hostPanel); + } + + Widget uiContent = SafeArea( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // --- INTESTAZIONE COMPATTATA --- + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Transform.rotate( + angle: themeType == AppThemeType.doodle ? -0.02 : 0, + child: Text("MULTIPLAYER", style: _getTextStyle(themeType, TextStyle(fontSize: 20, fontWeight: FontWeight.w900, color: theme.text, letterSpacing: 1, shadows: themeType == AppThemeType.doodle ? [] : [Shadow(color: Colors.black.withOpacity(0.5), offset: const Offset(2, 2), blurRadius: 4)]))), + ), + Transform.rotate( + angle: themeType == AppThemeType.doodle ? 0.03 : 0, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), + decoration: BoxDecoration( + color: themeType == AppThemeType.doodle ? Colors.white : theme.playerRed.withOpacity(0.2), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: themeType == AppThemeType.doodle ? theme.playerRed : theme.playerRed.withOpacity(0.5), width: themeType == AppThemeType.doodle ? 2.5 : 1.0), + boxShadow: themeType == AppThemeType.doodle ? [BoxShadow(color: theme.text.withOpacity(0.6), offset: const Offset(2, 3), blurRadius: 0)] : [] + ), + child: Text("$_playerName", textAlign: TextAlign.center, style: _getTextStyle(themeType, TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: theme.playerRed, letterSpacing: 1))), + ), + ), + ], + ), + + const SizedBox(height: 20), + + // --- SEZIONE HOST --- + hostPanel, + const SizedBox(height: 15), + _NeonActionButton(label: "CREA PARTITA", color: theme.playerRed, onTap: _createRoom, theme: theme, themeType: themeType), + + const SizedBox(height: 20), + Row( + children: [ + Expanded(child: Divider(color: theme.text.withOpacity(0.4), thickness: themeType == AppThemeType.doodle ? 2 : 1.0)), + Padding(padding: const EdgeInsets.symmetric(horizontal: 10), child: Text("OPPURE", style: _getTextStyle(themeType, TextStyle(color: themeType == AppThemeType.doodle ? theme.text : theme.text.withOpacity(0.5), fontWeight: FontWeight.bold, letterSpacing: 2.0, fontSize: 13)))), + Expanded(child: Divider(color: theme.text.withOpacity(0.4), thickness: themeType == AppThemeType.doodle ? 2 : 1.0)), + ], + ), + const SizedBox(height: 20), + + // --- SEZIONE JOIN --- + Transform.rotate( + angle: themeType == AppThemeType.doodle ? 0.02 : 0, + child: Container( + decoration: themeType == AppThemeType.doodle ? BoxDecoration( + color: Colors.white, + borderRadius: const BorderRadius.only(topLeft: Radius.circular(20), bottomRight: Radius.circular(20), topRight: Radius.circular(5), bottomLeft: Radius.circular(5)), + border: Border.all(color: theme.text, width: 2.5), + boxShadow: [BoxShadow(color: theme.text.withOpacity(0.8), offset: const Offset(5, 5), blurRadius: 0)], + ) : BoxDecoration( + boxShadow: [BoxShadow(color: theme.playerBlue.withOpacity(0.15), blurRadius: 15, spreadRadius: 1)] + ), + child: TextField( + controller: _codeController, textCapitalization: TextCapitalization.characters, textAlign: TextAlign.center, maxLength: 5, + style: _getTextStyle(themeType, TextStyle(fontSize: 28, fontWeight: FontWeight.w900, color: theme.text, letterSpacing: 12, shadows: themeType == AppThemeType.doodle ? [] : [Shadow(color: theme.playerBlue.withOpacity(0.5), blurRadius: 8)])), + decoration: InputDecoration( + contentPadding: const EdgeInsets.symmetric(vertical: 12), + hintText: "CODICE", hintStyle: _getTextStyle(themeType, TextStyle(color: theme.text.withOpacity(0.3), letterSpacing: 10, fontSize: 20)), counterText: "", + filled: themeType != AppThemeType.doodle, + // Scurito anche il campo del codice per Cyberpunk (0.85 di opacità) + fillColor: themeType == AppThemeType.cyberpunk ? Colors.black.withOpacity(0.85) : theme.text.withOpacity(0.05), + enabledBorder: themeType == AppThemeType.doodle ? InputBorder.none : OutlineInputBorder(borderSide: BorderSide(color: theme.gridLine.withOpacity(0.5), width: 2.0), borderRadius: BorderRadius.circular(15)), + focusedBorder: themeType == AppThemeType.doodle ? InputBorder.none : OutlineInputBorder(borderSide: BorderSide(color: theme.playerBlue, width: 3.0), borderRadius: BorderRadius.circular(15)), + ), + ), + ), + ), + const SizedBox(height: 15), + _NeonActionButton(label: "UNISCITI", color: theme.playerBlue, onTap: _joinRoom, theme: theme, themeType: themeType), + + const SizedBox(height: 10), + ], + ), + ), + ); + + return Scaffold( + backgroundColor: bgImage != null ? Colors.transparent : theme.background, + extendBodyBehindAppBar: true, + appBar: AppBar(backgroundColor: Colors.transparent, elevation: 0, iconTheme: IconThemeData(color: theme.text)), + body: Stack( + children: [ + // 1. Sfondo + Container( + decoration: bgImage != null ? BoxDecoration(image: DecorationImage(image: AssetImage(bgImage), fit: BoxFit.cover)) : null, + child: bgImage != null && themeType == AppThemeType.cyberpunk + ? BackdropFilter(filter: ImageFilter.blur(sigmaX: 3.5, sigmaY: 3.5), child: Container(color: Colors.black.withOpacity(0.2))) + : bgImage != null && themeType != AppThemeType.cyberpunk + ? BackdropFilter(filter: ImageFilter.blur(sigmaX: 3.5, sigmaY: 3.5), child: Container(color: themeType == AppThemeType.doodle ? Colors.white.withOpacity(0.1) : Colors.transparent)) + : null, + ), + + // 2. Wi-Fi + if (themeType == AppThemeType.doodle) + Positioned( + top: 150, left: -20, right: -20, + child: Stack( + alignment: Alignment.center, + children: [ + Transform.rotate(angle: -0.06, child: Icon(Icons.wifi_tethering, size: 450, color: doodlePenColor.withOpacity(0.08))), + Transform.rotate(angle: 0.04, child: Icon(Icons.wifi_tethering, size: 430, color: doodlePenColor.withOpacity(0.06))), + Transform.rotate(angle: 0.01, child: Icon(Icons.wifi_tethering, size: 460, color: doodlePenColor.withOpacity(0.05))), + ], + ), + ) + else + Positioned( + top: 70, left: -50, right: -50, + child: Center( + child: Icon(Icons.wifi_tethering, size: 450, color: theme.playerBlue.withOpacity(0.12)), + ), + ), + + // 3. UI + _isLoading ? Center(child: CircularProgressIndicator(color: theme.playerRed)) : uiContent, + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/ui/settings/settings_screen.dart b/lib/ui/settings/settings_screen.dart new file mode 100644 index 0000000..c7f8249 --- /dev/null +++ b/lib/ui/settings/settings_screen.dart @@ -0,0 +1,113 @@ +// =========================================================================== +// FILE: lib/ui/settings/settings_screen.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../core/theme_manager.dart'; +import '../../core/app_colors.dart'; + +class SettingsScreen extends StatelessWidget { + const SettingsScreen({super.key}); + + @override + Widget build(BuildContext context) { + final themeManager = context.watch(); + final theme = themeManager.currentColors; + + return Scaffold( + backgroundColor: theme.background, + appBar: AppBar( + title: Text("SELEZIONA TEMA", style: TextStyle(fontWeight: FontWeight.bold, color: theme.text)), + backgroundColor: Colors.transparent, + elevation: 0, + iconTheme: IconThemeData(color: theme.text), + ), + body: ListView( + padding: const EdgeInsets.all(20), + children: [ + _ThemeCard( + title: "Minimal", + subtitle: "Linee pulite, sfondo chiaro", + type: AppThemeType.minimal, + previewColors: AppColors.minimal, + ), + const SizedBox(height: 15), + _ThemeCard( + title: "Quaderno (Doodle)", + subtitle: "Sfondo a quadretti, tratto a penna", + type: AppThemeType.doodle, + previewColors: AppColors.doodle, + ), + const SizedBox(height: 15), + _ThemeCard( + title: "Cyberpunk", + subtitle: "Nero profondo, luci al neon", + type: AppThemeType.cyberpunk, + previewColors: AppColors.cyberpunk, + ), + const SizedBox(height: 15), + _ThemeCard( + title: "Legno & Fiammiferi", + subtitle: "Tavolo di legno, linee come fiammiferi", + type: AppThemeType.wood, + previewColors: AppColors.wood, + ), + ], + ), + ); + } +} + +class _ThemeCard extends StatelessWidget { + final String title; + final String subtitle; + final AppThemeType type; + final ThemeColors previewColors; + + const _ThemeCard({required this.title, required this.subtitle, required this.type, required this.previewColors}); + + @override + Widget build(BuildContext context) { + final themeManager = context.watch(); + bool isSelected = themeManager.currentThemeType == type; + + return GestureDetector( + onTap: () { + themeManager.setTheme(type); + // --- LA MODIFICA È QUI --- + // Chiude la schermata e torna automaticamente alla Home! + Navigator.pop(context); + }, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: previewColors.background, + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: isSelected ? previewColors.playerBlue : previewColors.gridLine.withOpacity(0.5), + width: isSelected ? 4 : 2, + ), + boxShadow: isSelected ? [BoxShadow(color: previewColors.playerBlue.withOpacity(0.4), blurRadius: 10, spreadRadius: 2)] : [], + ), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: previewColors.text)), + Text(subtitle, style: TextStyle(fontSize: 14, color: previewColors.text.withOpacity(0.7))), + ], + ), + ), + Container(width: 20, height: 20, decoration: BoxDecoration(color: previewColors.playerRed, shape: BoxShape.circle)), + const SizedBox(width: 10), + Container(width: 20, height: 20, decoration: BoxDecoration(color: previewColors.playerBlue, shape: BoxShape.circle)), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/custom_button.dart b/lib/widgets/custom_button.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/widgets/custom_settings_button.dart b/lib/widgets/custom_settings_button.dart new file mode 100644 index 0000000..b24af75 --- /dev/null +++ b/lib/widgets/custom_settings_button.dart @@ -0,0 +1,183 @@ +import 'package:flutter/material.dart'; +import '../theme/app_colors.dart'; + +// Widget per i pulsanti di selezione della forma dell'arena +class NeonShapeButton extends StatelessWidget { + final IconData icon; + final String label; + final bool isSelected; + final VoidCallback onTap; + final ShapeBorder shape; // La forma geometrica del pulsante + + const NeonShapeButton({ + super.key, + required this.icon, + required this.label, + required this.isSelected, + required this.onTap, + this.shape = const RoundedRectangleBorder( // Forma di default + borderRadius: BorderRadius.all(Radius.circular(12.0))), + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: ShapeDecoration( + shape: shape, + color: isSelected + ? AppColors.neonGreen.withOpacity(0.2) // Sfondo luminoso se selezionato + : AppColors.surface.withOpacity(0.5), // Sfondo più scuro se non selezionato + shadows: isSelected + ? [ // Bagliore intenso se selezionato + BoxShadow( + color: AppColors.neonGreen.withOpacity(0.6), + blurRadius: 12.0, + spreadRadius: 2.0, + ), + ] + : [], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + icon, + color: isSelected ? AppColors.neonGreen : AppColors.textSecondary, + size: 28, + ), + const SizedBox(height: 4), + Text( + label, + style: TextStyle( + color: isSelected ? AppColors.textPrimary : AppColors.textSecondary, + fontSize: 12, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ], + ), + ), + ); + } +} + +// Widget per i pulsanti di selezione della taglia dell'arena +class NeonSizeButton extends StatelessWidget { + final String label; + final bool isSelected; + final VoidCallback onTap; + + const NeonSizeButton({ + super.key, + required this.label, + required this.isSelected, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, // Forma circolare + color: isSelected + ? AppColors.neonBlue.withOpacity(0.2) + : AppColors.surface.withOpacity(0.5), + border: Border.all( + color: isSelected ? AppColors.neonBlue : AppColors.surfaceLight, + width: 2.0, + ), + shadows: isSelected + ? [ + BoxShadow( + color: AppColors.neonBlue.withOpacity(0.6), + blurRadius: 10.0, + spreadRadius: 1.5, + ), + ] + : [], + ), + child: Center( + child: Text( + label, + style: TextStyle( + color: isSelected ? AppColors.textPrimary : AppColors.textSecondary, + fontSize: 16, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ), + ), + ); + } +} + +// Widget per l'interruttore della modalità tempo (Clessidra) +class NeonTimeSwitch extends StatelessWidget { + final bool isTimeMode; + final VoidCallback onTap; + + const NeonTimeSwitch({ + super.key, + required this.isTimeMode, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30.0), // Forma arrotondata per lo switch + color: isTimeMode + ? AppColors.neonGreen.withOpacity(0.2) + : AppColors.surface.withOpacity(0.5), + border: Border.all( + color: isTimeMode ? AppColors.neonGreen : AppColors.surfaceLight, + width: 2.0, + ), + shadows: isTimeMode + ? [ + BoxShadow( + color: AppColors.neonGreen.withOpacity(0.6), + blurRadius: 12.0, + spreadRadius: 2.0, + ), + ] + : [], + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.hourglass_empty, // Icona clessidra + color: isTimeMode ? AppColors.neonGreen : AppColors.textSecondary, + ), + const SizedBox(width: 8), + Text( + isTimeMode ? 'A TEMPO' : 'SENZA TEMPO', + style: TextStyle( + color: isTimeMode ? AppColors.textPrimary : AppColors.textSecondary, + fontWeight: isTimeMode ? FontWeight.bold : FontWeight.normal, + ), + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/game_over_dialog.dart b/lib/widgets/game_over_dialog.dart new file mode 100644 index 0000000..b5da460 --- /dev/null +++ b/lib/widgets/game_over_dialog.dart @@ -0,0 +1,160 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../logic/game_controller.dart'; +import '../core/theme_manager.dart'; +import '../core/app_colors.dart'; + +class GameOverDialog extends StatelessWidget { + const GameOverDialog({super.key}); + + @override + Widget build(BuildContext context) { + final game = context.read(); + final themeManager = context.read(); + final theme = themeManager.currentColors; + final themeType = themeManager.currentThemeType; + + int red = game.board.scoreRed; + int blue = game.board.scoreBlue; + + bool playerBeatCPU = game.isVsCPU && red > blue; + + // --- LOGICA NOMI --- + String nameRed = "ROSSO"; + String nameBlue = themeType == AppThemeType.cyberpunk ? "VERDE" : "BLU"; + + if (game.isOnline) { + nameRed = game.onlineHostName.toUpperCase(); + nameBlue = game.onlineGuestName.toUpperCase(); + } else if (game.isVsCPU) { + nameRed = "TU"; + nameBlue = "CPU"; + } + + // --- DETERMINA IL VINCITORE --- + String winnerText = ""; + Color winnerColor = theme.text; + + if (red > blue) { + winnerText = "VINCE $nameRed!"; + winnerColor = theme.playerRed; + } else if (blue > red) { + winnerText = "VINCE $nameBlue!"; + winnerColor = theme.playerBlue; + } else { + winnerText = "PAREGGIO!"; + winnerColor = theme.text; + } + + return AlertDialog( + backgroundColor: theme.background, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + side: BorderSide(color: winnerColor.withOpacity(0.5), width: 2), + ), + title: Text("FINE PARTITA", textAlign: TextAlign.center, style: TextStyle(color: theme.text, fontWeight: FontWeight.bold, fontSize: 22)), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(winnerText, textAlign: TextAlign.center, style: TextStyle(fontSize: 26, fontWeight: FontWeight.w900, color: winnerColor)), + const SizedBox(height: 20), + Container( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + color: theme.text.withOpacity(0.05), + borderRadius: BorderRadius.circular(15), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text("$nameRed: $red", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: theme.playerRed)), + Text(" - ", style: TextStyle(fontSize: 18, color: theme.text)), + Text("$nameBlue: $blue", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: theme.playerBlue)), + ], + ), + ), + + if (game.isVsCPU) ...[ + const SizedBox(height: 15), + Text("Difficoltà CPU: Livello ${game.cpuLevel}", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: theme.text.withOpacity(0.7))), + ] + ], + ), + actionsPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 10), + actionsAlignment: MainAxisAlignment.center, + actions: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (playerBeatCPU) + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: winnerColor, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 15), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + elevation: 5, + ), + onPressed: () { + Navigator.pop(context); + game.increaseLevelAndRestart(); + }, + child: const Text("PROSSIMO LIVELLO ➔", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)), + ) + else if (game.isOnline) + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: winnerColor == theme.text ? theme.playerBlue : winnerColor, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 15), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + elevation: 5, + ), + onPressed: () { + Navigator.pop(context); + if (game.board.isGameOver) { + game.requestRematch(); + } + }, + child: const Text("RIGIOCA ONLINE", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, letterSpacing: 1.5)), + ) + else + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: winnerColor == theme.text ? theme.playerBlue : winnerColor, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 15), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + elevation: 5, + ), + onPressed: () { + Navigator.pop(context); + game.startNewGame(game.board.radius, vsCPU: game.isVsCPU); + }, + child: const Text("RIGIOCA", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, letterSpacing: 2)), + ), + + const SizedBox(height: 12), + + OutlinedButton( + style: OutlinedButton.styleFrom( + foregroundColor: theme.text, + side: BorderSide(color: theme.text.withOpacity(0.3), width: 2), + padding: const EdgeInsets.symmetric(vertical: 15), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + ), + onPressed: () { + if (game.isOnline) { + game.disconnectOnlineGame(); + } + Navigator.pop(context); + Navigator.pop(context); + }, + child: Text("TORNA AL MENU", style: TextStyle(fontWeight: FontWeight.bold, color: theme.text, fontSize: 14, letterSpacing: 1.5)), + ), + ], + ) + ], + ); + } +} \ No newline at end of file diff --git a/macos/.DS_Store b/macos/.DS_Store new file mode 100644 index 0000000..07d2e1e Binary files /dev/null and b/macos/.DS_Store differ diff --git a/macos/.gitignore b/macos/.gitignore new file mode 100644 index 0000000..746adbb --- /dev/null +++ b/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..4b81f9b --- /dev/null +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..5caa9d1 --- /dev/null +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..9681093 --- /dev/null +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,22 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import app_links +import audioplayers_darwin +import cloud_firestore +import firebase_core +import share_plus +import shared_preferences_foundation + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin")) + AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) + FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) + FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) +} diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..ff5ddb3 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.15' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/macos/Podfile.lock b/macos/Podfile.lock new file mode 100644 index 0000000..7fb6e6d --- /dev/null +++ b/macos/Podfile.lock @@ -0,0 +1,1426 @@ +PODS: + - abseil/algorithm (1.20240722.0): + - abseil/algorithm/algorithm (= 1.20240722.0) + - abseil/algorithm/container (= 1.20240722.0) + - abseil/algorithm/algorithm (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/algorithm/container (1.20240722.0): + - abseil/algorithm/algorithm + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/base (1.20240722.0): + - abseil/base/atomic_hook (= 1.20240722.0) + - abseil/base/base (= 1.20240722.0) + - abseil/base/base_internal (= 1.20240722.0) + - abseil/base/config (= 1.20240722.0) + - abseil/base/core_headers (= 1.20240722.0) + - abseil/base/cycleclock_internal (= 1.20240722.0) + - abseil/base/dynamic_annotations (= 1.20240722.0) + - abseil/base/endian (= 1.20240722.0) + - abseil/base/errno_saver (= 1.20240722.0) + - abseil/base/fast_type_id (= 1.20240722.0) + - abseil/base/log_severity (= 1.20240722.0) + - abseil/base/malloc_internal (= 1.20240722.0) + - abseil/base/no_destructor (= 1.20240722.0) + - abseil/base/nullability (= 1.20240722.0) + - abseil/base/poison (= 1.20240722.0) + - abseil/base/prefetch (= 1.20240722.0) + - abseil/base/pretty_function (= 1.20240722.0) + - abseil/base/raw_logging_internal (= 1.20240722.0) + - abseil/base/spinlock_wait (= 1.20240722.0) + - abseil/base/strerror (= 1.20240722.0) + - abseil/base/throw_delegate (= 1.20240722.0) + - abseil/base/atomic_hook (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/base/base (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/cycleclock_internal + - abseil/base/dynamic_annotations + - abseil/base/log_severity + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/base/spinlock_wait + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/base/base_internal (1.20240722.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/base/config (1.20240722.0): + - abseil/xcprivacy + - abseil/base/core_headers (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/base/cycleclock_internal (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/xcprivacy + - abseil/base/dynamic_annotations (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/base/endian (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/xcprivacy + - abseil/base/errno_saver (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/base/fast_type_id (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/base/log_severity (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/base/malloc_internal (1.20240722.0): + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/base/no_destructor (1.20240722.0): + - abseil/base/config + - abseil/base/nullability + - abseil/xcprivacy + - abseil/base/nullability (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/base/poison (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal + - abseil/xcprivacy + - abseil/base/prefetch (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/base/pretty_function (1.20240722.0): + - abseil/xcprivacy + - abseil/base/raw_logging_internal (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/config + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/base/log_severity + - abseil/xcprivacy + - abseil/base/spinlock_wait (1.20240722.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/xcprivacy + - abseil/base/strerror (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/xcprivacy + - abseil/base/throw_delegate (1.20240722.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/cleanup/cleanup (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/cleanup/cleanup_internal + - abseil/xcprivacy + - abseil/cleanup/cleanup_internal (1.20240722.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/common (1.20240722.0): + - abseil/meta/type_traits + - abseil/types/optional + - abseil/xcprivacy + - abseil/container/common_policy_traits (1.20240722.0): + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/compressed_tuple (1.20240722.0): + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/container_memory (1.20240722.0): + - abseil/base/config + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/fixed_array (1.20240722.0): + - abseil/algorithm/algorithm + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/throw_delegate + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/xcprivacy + - abseil/container/flat_hash_map (1.20240722.0): + - abseil/algorithm/container + - abseil/base/core_headers + - abseil/container/container_memory + - abseil/container/hash_container_defaults + - abseil/container/raw_hash_map + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/flat_hash_set (1.20240722.0): + - abseil/algorithm/container + - abseil/base/core_headers + - abseil/container/container_memory + - abseil/container/hash_container_defaults + - abseil/container/raw_hash_set + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/hash_container_defaults (1.20240722.0): + - abseil/base/config + - abseil/container/hash_function_defaults + - abseil/xcprivacy + - abseil/container/hash_function_defaults (1.20240722.0): + - abseil/base/config + - abseil/container/common + - abseil/hash/hash + - abseil/meta/type_traits + - abseil/strings/cord + - abseil/strings/strings + - abseil/xcprivacy + - abseil/container/hash_policy_traits (1.20240722.0): + - abseil/container/common_policy_traits + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/hashtable_debug_hooks (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/container/hashtablez_sampler (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/no_destructor + - abseil/base/raw_logging_internal + - abseil/debugging/stacktrace + - abseil/memory/memory + - abseil/profiling/exponential_biased + - abseil/profiling/sample_recorder + - abseil/synchronization/synchronization + - abseil/time/time + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/inlined_vector (1.20240722.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/container/inlined_vector_internal + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/container/inlined_vector_internal (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/span + - abseil/xcprivacy + - abseil/container/layout (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/debugging/demangle_internal + - abseil/meta/type_traits + - abseil/strings/strings + - abseil/types/span + - abseil/utility/utility + - abseil/xcprivacy + - abseil/container/raw_hash_map (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/container/container_memory + - abseil/container/raw_hash_set + - abseil/xcprivacy + - abseil/container/raw_hash_set (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/endian + - abseil/base/prefetch + - abseil/base/raw_logging_internal + - abseil/container/common + - abseil/container/compressed_tuple + - abseil/container/container_memory + - abseil/container/hash_policy_traits + - abseil/container/hashtable_debug_hooks + - abseil/container/hashtablez_sampler + - abseil/hash/hash + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/utility/utility + - abseil/xcprivacy + - abseil/crc/cpu_detect (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/xcprivacy + - abseil/crc/crc32c (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/prefetch + - abseil/crc/cpu_detect + - abseil/crc/crc_internal + - abseil/crc/non_temporal_memcpy + - abseil/strings/str_format + - abseil/strings/strings + - abseil/xcprivacy + - abseil/crc/crc_cord_state (1.20240722.0): + - abseil/base/config + - abseil/base/no_destructor + - abseil/crc/crc32c + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/crc/crc_internal (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/prefetch + - abseil/base/raw_logging_internal + - abseil/crc/cpu_detect + - abseil/memory/memory + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/crc/non_temporal_arm_intrinsics (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/crc/non_temporal_memcpy (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/crc/non_temporal_arm_intrinsics + - abseil/xcprivacy + - abseil/debugging/bounded_utf8_length_sequence (1.20240722.0): + - abseil/base/config + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/debugging/debugging_internal (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/errno_saver + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/debugging/decode_rust_punycode (1.20240722.0): + - abseil/base/config + - abseil/base/nullability + - abseil/debugging/bounded_utf8_length_sequence + - abseil/debugging/utf8_for_code_point + - abseil/xcprivacy + - abseil/debugging/demangle_internal (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/debugging/demangle_rust + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/debugging/demangle_rust (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/debugging/decode_rust_punycode + - abseil/xcprivacy + - abseil/debugging/examine_stack (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/debugging/stacktrace + - abseil/debugging/symbolize + - abseil/xcprivacy + - abseil/debugging/stacktrace (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/raw_logging_internal + - abseil/debugging/debugging_internal + - abseil/xcprivacy + - abseil/debugging/symbolize (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/debugging/debugging_internal + - abseil/debugging/demangle_internal + - abseil/strings/strings + - abseil/xcprivacy + - abseil/debugging/utf8_for_code_point (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/flags/commandlineflag (1.20240722.0): + - abseil/base/config + - abseil/base/fast_type_id + - abseil/flags/commandlineflag_internal + - abseil/strings/strings + - abseil/types/optional + - abseil/xcprivacy + - abseil/flags/commandlineflag_internal (1.20240722.0): + - abseil/base/config + - abseil/base/fast_type_id + - abseil/xcprivacy + - abseil/flags/config (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/flags/path_util + - abseil/flags/program_name + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/xcprivacy + - abseil/flags/flag (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/flags/commandlineflag + - abseil/flags/config + - abseil/flags/flag_internal + - abseil/flags/reflection + - abseil/strings/strings + - abseil/xcprivacy + - abseil/flags/flag_internal (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/flags/commandlineflag + - abseil/flags/commandlineflag_internal + - abseil/flags/config + - abseil/flags/marshalling + - abseil/flags/reflection + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/utility/utility + - abseil/xcprivacy + - abseil/flags/marshalling (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/numeric/int128 + - abseil/strings/str_format + - abseil/strings/strings + - abseil/types/optional + - abseil/xcprivacy + - abseil/flags/path_util (1.20240722.0): + - abseil/base/config + - abseil/strings/strings + - abseil/xcprivacy + - abseil/flags/private_handle_accessor (1.20240722.0): + - abseil/base/config + - abseil/flags/commandlineflag + - abseil/flags/commandlineflag_internal + - abseil/strings/strings + - abseil/xcprivacy + - abseil/flags/program_name (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/flags/path_util + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/xcprivacy + - abseil/flags/reflection (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/no_destructor + - abseil/container/flat_hash_map + - abseil/flags/commandlineflag + - abseil/flags/commandlineflag_internal + - abseil/flags/config + - abseil/flags/private_handle_accessor + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/xcprivacy + - abseil/functional/any_invocable (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/utility/utility + - abseil/xcprivacy + - abseil/functional/bind_front (1.20240722.0): + - abseil/base/base_internal + - abseil/container/compressed_tuple + - abseil/meta/type_traits + - abseil/utility/utility + - abseil/xcprivacy + - abseil/functional/function_ref (1.20240722.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/functional/any_invocable + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/hash/city (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/xcprivacy + - abseil/hash/hash (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/container/fixed_array + - abseil/functional/function_ref + - abseil/hash/city + - abseil/hash/low_level_hash + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/types/optional + - abseil/types/variant + - abseil/utility/utility + - abseil/xcprivacy + - abseil/hash/low_level_hash (1.20240722.0): + - abseil/base/config + - abseil/base/endian + - abseil/base/prefetch + - abseil/numeric/int128 + - abseil/xcprivacy + - abseil/log/absl_check (1.20240722.0): + - abseil/log/internal/check_impl + - abseil/xcprivacy + - abseil/log/absl_log (1.20240722.0): + - abseil/log/internal/log_impl + - abseil/xcprivacy + - abseil/log/absl_vlog_is_on (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/log/internal/vlog_config + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/check (1.20240722.0): + - abseil/log/internal/check_impl + - abseil/log/internal/check_op + - abseil/log/internal/conditions + - abseil/log/internal/log_message + - abseil/log/internal/strip + - abseil/xcprivacy + - abseil/log/globals (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/raw_logging_internal + - abseil/hash/hash + - abseil/log/internal/vlog_config + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/internal/append_truncated (1.20240722.0): + - abseil/base/config + - abseil/strings/strings + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/check_impl (1.20240722.0): + - abseil/base/core_headers + - abseil/log/internal/check_op + - abseil/log/internal/conditions + - abseil/log/internal/log_message + - abseil/log/internal/strip + - abseil/xcprivacy + - abseil/log/internal/check_op (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/log/internal/nullguard + - abseil/log/internal/nullstream + - abseil/log/internal/strip + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/internal/conditions (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/log/internal/voidify + - abseil/xcprivacy + - abseil/log/internal/config (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/log/internal/fnmatch (1.20240722.0): + - abseil/base/config + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/internal/format (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/log/internal/append_truncated + - abseil/log/internal/config + - abseil/log/internal/globals + - abseil/strings/str_format + - abseil/strings/strings + - abseil/time/time + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/globals (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/raw_logging_internal + - abseil/strings/strings + - abseil/time/time + - abseil/xcprivacy + - abseil/log/internal/log_impl (1.20240722.0): + - abseil/log/absl_vlog_is_on + - abseil/log/internal/conditions + - abseil/log/internal/log_message + - abseil/log/internal/strip + - abseil/xcprivacy + - abseil/log/internal/log_message (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/base/log_severity + - abseil/base/raw_logging_internal + - abseil/base/strerror + - abseil/container/inlined_vector + - abseil/debugging/examine_stack + - abseil/log/globals + - abseil/log/internal/append_truncated + - abseil/log/internal/format + - abseil/log/internal/globals + - abseil/log/internal/log_sink_set + - abseil/log/internal/nullguard + - abseil/log/internal/proto + - abseil/log/log_entry + - abseil/log/log_sink + - abseil/log/log_sink_registry + - abseil/memory/memory + - abseil/strings/strings + - abseil/time/time + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/log_sink_set (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/no_destructor + - abseil/base/raw_logging_internal + - abseil/cleanup/cleanup + - abseil/log/globals + - abseil/log/internal/config + - abseil/log/internal/globals + - abseil/log/log_entry + - abseil/log/log_sink + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/nullguard (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/log/internal/nullstream (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/strings/strings + - abseil/xcprivacy + - abseil/log/internal/proto (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/strings/strings + - abseil/types/span + - abseil/xcprivacy + - abseil/log/internal/strip (1.20240722.0): + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/log/internal/log_message + - abseil/log/internal/nullstream + - abseil/xcprivacy + - abseil/log/internal/vlog_config (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/no_destructor + - abseil/log/internal/fnmatch + - abseil/memory/memory + - abseil/strings/strings + - abseil/synchronization/synchronization + - abseil/types/optional + - abseil/xcprivacy + - abseil/log/internal/voidify (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/log/log (1.20240722.0): + - abseil/log/internal/log_impl + - abseil/log/vlog_is_on + - abseil/xcprivacy + - abseil/log/log_entry (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/log/internal/config + - abseil/strings/strings + - abseil/time/time + - abseil/types/span + - abseil/xcprivacy + - abseil/log/log_sink (1.20240722.0): + - abseil/base/config + - abseil/log/log_entry + - abseil/xcprivacy + - abseil/log/log_sink_registry (1.20240722.0): + - abseil/base/config + - abseil/log/internal/log_sink_set + - abseil/log/log_sink + - abseil/xcprivacy + - abseil/log/vlog_is_on (1.20240722.0): + - abseil/log/absl_vlog_is_on + - abseil/xcprivacy + - abseil/memory (1.20240722.0): + - abseil/memory/memory (= 1.20240722.0) + - abseil/memory/memory (1.20240722.0): + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/meta (1.20240722.0): + - abseil/meta/type_traits (= 1.20240722.0) + - abseil/meta/type_traits (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/numeric/bits (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/numeric/int128 (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/numeric/bits + - abseil/types/compare + - abseil/xcprivacy + - abseil/numeric/representation (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/profiling/exponential_biased (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/xcprivacy + - abseil/profiling/sample_recorder (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/synchronization/synchronization + - abseil/time/time + - abseil/xcprivacy + - abseil/random/bit_gen_ref (1.20240722.0): + - abseil/base/core_headers + - abseil/base/fast_type_id + - abseil/meta/type_traits + - abseil/random/internal/distribution_caller + - abseil/random/internal/fast_uniform_bits + - abseil/random/random + - abseil/xcprivacy + - abseil/random/distributions (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/random/internal/distribution_caller + - abseil/random/internal/fast_uniform_bits + - abseil/random/internal/fastmath + - abseil/random/internal/generate_real + - abseil/random/internal/iostream_state_saver + - abseil/random/internal/traits + - abseil/random/internal/uniform_helper + - abseil/random/internal/wide_multiply + - abseil/strings/strings + - abseil/xcprivacy + - abseil/random/internal/distribution_caller (1.20240722.0): + - abseil/base/config + - abseil/base/fast_type_id + - abseil/utility/utility + - abseil/xcprivacy + - abseil/random/internal/fast_uniform_bits (1.20240722.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/random/internal/traits + - abseil/xcprivacy + - abseil/random/internal/fastmath (1.20240722.0): + - abseil/numeric/bits + - abseil/xcprivacy + - abseil/random/internal/generate_real (1.20240722.0): + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/random/internal/fastmath + - abseil/random/internal/traits + - abseil/xcprivacy + - abseil/random/internal/iostream_state_saver (1.20240722.0): + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/xcprivacy + - abseil/random/internal/nonsecure_base (1.20240722.0): + - abseil/base/core_headers + - abseil/container/inlined_vector + - abseil/meta/type_traits + - abseil/random/internal/pool_urbg + - abseil/random/internal/salted_seed_seq + - abseil/random/internal/seed_material + - abseil/types/span + - abseil/xcprivacy + - abseil/random/internal/pcg_engine (1.20240722.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/random/internal/fastmath + - abseil/random/internal/iostream_state_saver + - abseil/xcprivacy + - abseil/random/internal/platform (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/random/internal/pool_urbg (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/random/internal/randen + - abseil/random/internal/seed_material + - abseil/random/internal/traits + - abseil/random/seed_gen_exception + - abseil/types/span + - abseil/xcprivacy + - abseil/random/internal/randen (1.20240722.0): + - abseil/base/raw_logging_internal + - abseil/random/internal/platform + - abseil/random/internal/randen_hwaes + - abseil/random/internal/randen_slow + - abseil/xcprivacy + - abseil/random/internal/randen_engine (1.20240722.0): + - abseil/base/endian + - abseil/meta/type_traits + - abseil/random/internal/iostream_state_saver + - abseil/random/internal/randen + - abseil/xcprivacy + - abseil/random/internal/randen_hwaes (1.20240722.0): + - abseil/base/config + - abseil/random/internal/platform + - abseil/random/internal/randen_hwaes_impl + - abseil/xcprivacy + - abseil/random/internal/randen_hwaes_impl (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/numeric/int128 + - abseil/random/internal/platform + - abseil/xcprivacy + - abseil/random/internal/randen_slow (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/numeric/int128 + - abseil/random/internal/platform + - abseil/xcprivacy + - abseil/random/internal/salted_seed_seq (1.20240722.0): + - abseil/container/inlined_vector + - abseil/meta/type_traits + - abseil/random/internal/seed_material + - abseil/types/optional + - abseil/types/span + - abseil/xcprivacy + - abseil/random/internal/seed_material (1.20240722.0): + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/raw_logging_internal + - abseil/random/internal/fast_uniform_bits + - abseil/strings/strings + - abseil/types/optional + - abseil/types/span + - abseil/xcprivacy + - abseil/random/internal/traits (1.20240722.0): + - abseil/base/config + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/xcprivacy + - abseil/random/internal/uniform_helper (1.20240722.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/random/internal/traits + - abseil/xcprivacy + - abseil/random/internal/wide_multiply (1.20240722.0): + - abseil/base/config + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/random/internal/traits + - abseil/xcprivacy + - abseil/random/random (1.20240722.0): + - abseil/random/distributions + - abseil/random/internal/nonsecure_base + - abseil/random/internal/pcg_engine + - abseil/random/internal/pool_urbg + - abseil/random/internal/randen_engine + - abseil/random/seed_sequences + - abseil/xcprivacy + - abseil/random/seed_gen_exception (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/random/seed_sequences (1.20240722.0): + - abseil/base/config + - abseil/base/nullability + - abseil/random/internal/pool_urbg + - abseil/random/internal/salted_seed_seq + - abseil/random/internal/seed_material + - abseil/random/seed_gen_exception + - abseil/strings/string_view + - abseil/types/span + - abseil/xcprivacy + - abseil/status/status (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/config + - abseil/base/core_headers + - abseil/base/no_destructor + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/base/strerror + - abseil/container/inlined_vector + - abseil/debugging/stacktrace + - abseil/debugging/symbolize + - abseil/functional/function_ref + - abseil/memory/memory + - abseil/strings/cord + - abseil/strings/str_format + - abseil/strings/strings + - abseil/types/optional + - abseil/types/span + - abseil/xcprivacy + - abseil/status/statusor (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/meta/type_traits + - abseil/status/status + - abseil/strings/has_ostream_operator + - abseil/strings/str_format + - abseil/strings/strings + - abseil/types/variant + - abseil/utility/utility + - abseil/xcprivacy + - abseil/strings/charset (1.20240722.0): + - abseil/base/core_headers + - abseil/strings/string_view + - abseil/xcprivacy + - abseil/strings/cord (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/container/inlined_vector + - abseil/crc/crc32c + - abseil/crc/crc_cord_state + - abseil/functional/function_ref + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/strings/cord_internal + - abseil/strings/cordz_functions + - abseil/strings/cordz_info + - abseil/strings/cordz_statistics + - abseil/strings/cordz_update_scope + - abseil/strings/cordz_update_tracker + - abseil/strings/internal + - abseil/strings/strings + - abseil/types/compare + - abseil/types/optional + - abseil/types/span + - abseil/xcprivacy + - abseil/strings/cord_internal (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/base/throw_delegate + - abseil/container/compressed_tuple + - abseil/container/container_memory + - abseil/container/inlined_vector + - abseil/container/layout + - abseil/crc/crc_cord_state + - abseil/functional/function_ref + - abseil/meta/type_traits + - abseil/strings/strings + - abseil/types/span + - abseil/xcprivacy + - abseil/strings/cordz_functions (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/profiling/exponential_biased + - abseil/xcprivacy + - abseil/strings/cordz_handle (1.20240722.0): + - abseil/base/config + - abseil/base/no_destructor + - abseil/base/raw_logging_internal + - abseil/synchronization/synchronization + - abseil/xcprivacy + - abseil/strings/cordz_info (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/container/inlined_vector + - abseil/debugging/stacktrace + - abseil/strings/cord_internal + - abseil/strings/cordz_functions + - abseil/strings/cordz_handle + - abseil/strings/cordz_statistics + - abseil/strings/cordz_update_tracker + - abseil/synchronization/synchronization + - abseil/time/time + - abseil/types/span + - abseil/xcprivacy + - abseil/strings/cordz_statistics (1.20240722.0): + - abseil/base/config + - abseil/strings/cordz_update_tracker + - abseil/xcprivacy + - abseil/strings/cordz_update_scope (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/strings/cord_internal + - abseil/strings/cordz_info + - abseil/strings/cordz_update_tracker + - abseil/xcprivacy + - abseil/strings/cordz_update_tracker (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/strings/has_ostream_operator (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/strings/internal (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/strings/str_format (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/strings/str_format_internal + - abseil/strings/string_view + - abseil/types/span + - abseil/xcprivacy + - abseil/strings/str_format_internal (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/container/fixed_array + - abseil/container/inlined_vector + - abseil/functional/function_ref + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/numeric/representation + - abseil/strings/strings + - abseil/types/optional + - abseil/types/span + - abseil/utility/utility + - abseil/xcprivacy + - abseil/strings/string_view (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/base/throw_delegate + - abseil/xcprivacy + - abseil/strings/strings (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/nullability + - abseil/base/raw_logging_internal + - abseil/base/throw_delegate + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/numeric/bits + - abseil/numeric/int128 + - abseil/strings/charset + - abseil/strings/internal + - abseil/strings/string_view + - abseil/xcprivacy + - abseil/synchronization/graphcycles_internal (1.20240722.0): + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/synchronization/kernel_timeout_internal (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/time/time + - abseil/xcprivacy + - abseil/synchronization/synchronization (1.20240722.0): + - abseil/base/atomic_hook + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/malloc_internal + - abseil/base/raw_logging_internal + - abseil/debugging/stacktrace + - abseil/debugging/symbolize + - abseil/synchronization/graphcycles_internal + - abseil/synchronization/kernel_timeout_internal + - abseil/time/time + - abseil/xcprivacy + - abseil/time (1.20240722.0): + - abseil/time/internal (= 1.20240722.0) + - abseil/time/time (= 1.20240722.0) + - abseil/time/internal (1.20240722.0): + - abseil/time/internal/cctz (= 1.20240722.0) + - abseil/time/internal/cctz (1.20240722.0): + - abseil/time/internal/cctz/civil_time (= 1.20240722.0) + - abseil/time/internal/cctz/time_zone (= 1.20240722.0) + - abseil/time/internal/cctz/civil_time (1.20240722.0): + - abseil/base/config + - abseil/xcprivacy + - abseil/time/internal/cctz/time_zone (1.20240722.0): + - abseil/base/config + - abseil/time/internal/cctz/civil_time + - abseil/xcprivacy + - abseil/time/time (1.20240722.0): + - abseil/base/base + - abseil/base/config + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/time/internal/cctz/civil_time + - abseil/time/internal/cctz/time_zone + - abseil/types/optional + - abseil/xcprivacy + - abseil/types (1.20240722.0): + - abseil/types/any (= 1.20240722.0) + - abseil/types/bad_any_cast (= 1.20240722.0) + - abseil/types/bad_any_cast_impl (= 1.20240722.0) + - abseil/types/bad_optional_access (= 1.20240722.0) + - abseil/types/bad_variant_access (= 1.20240722.0) + - abseil/types/compare (= 1.20240722.0) + - abseil/types/optional (= 1.20240722.0) + - abseil/types/span (= 1.20240722.0) + - abseil/types/variant (= 1.20240722.0) + - abseil/types/any (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/fast_type_id + - abseil/meta/type_traits + - abseil/types/bad_any_cast + - abseil/utility/utility + - abseil/xcprivacy + - abseil/types/bad_any_cast (1.20240722.0): + - abseil/base/config + - abseil/types/bad_any_cast_impl + - abseil/xcprivacy + - abseil/types/bad_any_cast_impl (1.20240722.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/types/bad_optional_access (1.20240722.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/types/bad_variant_access (1.20240722.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/xcprivacy + - abseil/types/compare (1.20240722.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/types/optional (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/nullability + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/bad_optional_access + - abseil/utility/utility + - abseil/xcprivacy + - abseil/types/span (1.20240722.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/nullability + - abseil/base/throw_delegate + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/types/variant (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/types/bad_variant_access + - abseil/utility/utility + - abseil/xcprivacy + - abseil/utility/utility (1.20240722.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/meta/type_traits + - abseil/xcprivacy + - abseil/xcprivacy (1.20240722.0) + - app_links (6.4.1): + - FlutterMacOS + - audioplayers_darwin (0.0.1): + - FlutterMacOS + - BoringSSL-GRPC (0.0.37): + - BoringSSL-GRPC/Implementation (= 0.0.37) + - BoringSSL-GRPC/Interface (= 0.0.37) + - BoringSSL-GRPC/Implementation (0.0.37): + - BoringSSL-GRPC/Interface (= 0.0.37) + - BoringSSL-GRPC/Interface (0.0.37) + - cloud_firestore (6.1.2): + - Firebase/CoreOnly (~> 12.8.0) + - Firebase/Firestore (~> 12.8.0) + - firebase_core + - FlutterMacOS + - Firebase/CoreOnly (12.8.0): + - FirebaseCore (~> 12.8.0) + - Firebase/Firestore (12.8.0): + - Firebase/CoreOnly + - FirebaseFirestore (~> 12.8.0) + - firebase_core (4.4.0): + - Firebase/CoreOnly (~> 12.8.0) + - FlutterMacOS + - FirebaseAppCheckInterop (12.8.0) + - FirebaseCore (12.8.0): + - FirebaseCoreInternal (~> 12.8.0) + - GoogleUtilities/Environment (~> 8.1) + - GoogleUtilities/Logger (~> 8.1) + - FirebaseCoreExtension (12.8.0): + - FirebaseCore (~> 12.8.0) + - FirebaseCoreInternal (12.8.0): + - "GoogleUtilities/NSData+zlib (~> 8.1)" + - FirebaseFirestore (12.8.0): + - FirebaseCore (~> 12.8.0) + - FirebaseCoreExtension (~> 12.8.0) + - FirebaseFirestoreInternal (~> 12.8.0) + - FirebaseSharedSwift (~> 12.8.0) + - FirebaseFirestoreInternal (12.8.0): + - abseil/algorithm (~> 1.20240722.0) + - abseil/base (~> 1.20240722.0) + - abseil/container/flat_hash_map (~> 1.20240722.0) + - abseil/memory (~> 1.20240722.0) + - abseil/meta (~> 1.20240722.0) + - abseil/strings/strings (~> 1.20240722.0) + - abseil/time (~> 1.20240722.0) + - abseil/types (~> 1.20240722.0) + - FirebaseAppCheckInterop (~> 12.8.0) + - FirebaseCore (~> 12.8.0) + - "gRPC-C++ (~> 1.69.0)" + - gRPC-Core (~> 1.69.0) + - leveldb-library (~> 1.22) + - nanopb (~> 3.30910.0) + - FirebaseSharedSwift (12.8.0) + - FlutterMacOS (1.0.0) + - GoogleUtilities/Environment (8.1.0): + - GoogleUtilities/Privacy + - GoogleUtilities/Logger (8.1.0): + - GoogleUtilities/Environment + - GoogleUtilities/Privacy + - "GoogleUtilities/NSData+zlib (8.1.0)": + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (8.1.0) + - "gRPC-C++ (1.69.0)": + - "gRPC-C++/Implementation (= 1.69.0)" + - "gRPC-C++/Interface (= 1.69.0)" + - "gRPC-C++/Implementation (1.69.0)": + - abseil/algorithm/container (~> 1.20240722.0) + - abseil/base/base (~> 1.20240722.0) + - abseil/base/config (~> 1.20240722.0) + - abseil/base/core_headers (~> 1.20240722.0) + - abseil/base/log_severity (~> 1.20240722.0) + - abseil/base/no_destructor (~> 1.20240722.0) + - abseil/cleanup/cleanup (~> 1.20240722.0) + - abseil/container/flat_hash_map (~> 1.20240722.0) + - abseil/container/flat_hash_set (~> 1.20240722.0) + - abseil/container/inlined_vector (~> 1.20240722.0) + - abseil/flags/flag (~> 1.20240722.0) + - abseil/flags/marshalling (~> 1.20240722.0) + - abseil/functional/any_invocable (~> 1.20240722.0) + - abseil/functional/bind_front (~> 1.20240722.0) + - abseil/functional/function_ref (~> 1.20240722.0) + - abseil/hash/hash (~> 1.20240722.0) + - abseil/log/absl_check (~> 1.20240722.0) + - abseil/log/absl_log (~> 1.20240722.0) + - abseil/log/check (~> 1.20240722.0) + - abseil/log/globals (~> 1.20240722.0) + - abseil/log/log (~> 1.20240722.0) + - abseil/memory/memory (~> 1.20240722.0) + - abseil/meta/type_traits (~> 1.20240722.0) + - abseil/numeric/bits (~> 1.20240722.0) + - abseil/random/bit_gen_ref (~> 1.20240722.0) + - abseil/random/distributions (~> 1.20240722.0) + - abseil/random/random (~> 1.20240722.0) + - abseil/status/status (~> 1.20240722.0) + - abseil/status/statusor (~> 1.20240722.0) + - abseil/strings/cord (~> 1.20240722.0) + - abseil/strings/str_format (~> 1.20240722.0) + - abseil/strings/strings (~> 1.20240722.0) + - abseil/synchronization/synchronization (~> 1.20240722.0) + - abseil/time/time (~> 1.20240722.0) + - abseil/types/optional (~> 1.20240722.0) + - abseil/types/span (~> 1.20240722.0) + - abseil/types/variant (~> 1.20240722.0) + - abseil/utility/utility (~> 1.20240722.0) + - "gRPC-C++/Interface (= 1.69.0)" + - "gRPC-C++/Privacy (= 1.69.0)" + - gRPC-Core (= 1.69.0) + - "gRPC-C++/Interface (1.69.0)" + - "gRPC-C++/Privacy (1.69.0)" + - gRPC-Core (1.69.0): + - gRPC-Core/Implementation (= 1.69.0) + - gRPC-Core/Interface (= 1.69.0) + - gRPC-Core/Implementation (1.69.0): + - abseil/algorithm/container (~> 1.20240722.0) + - abseil/base/base (~> 1.20240722.0) + - abseil/base/config (~> 1.20240722.0) + - abseil/base/core_headers (~> 1.20240722.0) + - abseil/base/log_severity (~> 1.20240722.0) + - abseil/base/no_destructor (~> 1.20240722.0) + - abseil/cleanup/cleanup (~> 1.20240722.0) + - abseil/container/flat_hash_map (~> 1.20240722.0) + - abseil/container/flat_hash_set (~> 1.20240722.0) + - abseil/container/inlined_vector (~> 1.20240722.0) + - abseil/flags/flag (~> 1.20240722.0) + - abseil/flags/marshalling (~> 1.20240722.0) + - abseil/functional/any_invocable (~> 1.20240722.0) + - abseil/functional/bind_front (~> 1.20240722.0) + - abseil/functional/function_ref (~> 1.20240722.0) + - abseil/hash/hash (~> 1.20240722.0) + - abseil/log/check (~> 1.20240722.0) + - abseil/log/globals (~> 1.20240722.0) + - abseil/log/log (~> 1.20240722.0) + - abseil/memory/memory (~> 1.20240722.0) + - abseil/meta/type_traits (~> 1.20240722.0) + - abseil/numeric/bits (~> 1.20240722.0) + - abseil/random/bit_gen_ref (~> 1.20240722.0) + - abseil/random/distributions (~> 1.20240722.0) + - abseil/random/random (~> 1.20240722.0) + - abseil/status/status (~> 1.20240722.0) + - abseil/status/statusor (~> 1.20240722.0) + - abseil/strings/cord (~> 1.20240722.0) + - abseil/strings/str_format (~> 1.20240722.0) + - abseil/strings/strings (~> 1.20240722.0) + - abseil/synchronization/synchronization (~> 1.20240722.0) + - abseil/time/time (~> 1.20240722.0) + - abseil/types/optional (~> 1.20240722.0) + - abseil/types/span (~> 1.20240722.0) + - abseil/types/variant (~> 1.20240722.0) + - abseil/utility/utility (~> 1.20240722.0) + - BoringSSL-GRPC (= 0.0.37) + - gRPC-Core/Interface (= 1.69.0) + - gRPC-Core/Privacy (= 1.69.0) + - gRPC-Core/Interface (1.69.0) + - gRPC-Core/Privacy (1.69.0) + - leveldb-library (1.22.6) + - nanopb (3.30910.0): + - nanopb/decode (= 3.30910.0) + - nanopb/encode (= 3.30910.0) + - nanopb/decode (3.30910.0) + - nanopb/encode (3.30910.0) + - share_plus (0.0.1): + - FlutterMacOS + - shared_preferences_foundation (0.0.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - app_links (from `Flutter/ephemeral/.symlinks/plugins/app_links/macos`) + - audioplayers_darwin (from `Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos`) + - cloud_firestore (from `Flutter/ephemeral/.symlinks/plugins/cloud_firestore/macos`) + - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`) + - FlutterMacOS (from `Flutter/ephemeral`) + - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) + - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) + +SPEC REPOS: + trunk: + - abseil + - BoringSSL-GRPC + - Firebase + - FirebaseAppCheckInterop + - FirebaseCore + - FirebaseCoreExtension + - FirebaseCoreInternal + - FirebaseFirestore + - FirebaseFirestoreInternal + - FirebaseSharedSwift + - GoogleUtilities + - "gRPC-C++" + - gRPC-Core + - leveldb-library + - nanopb + +EXTERNAL SOURCES: + app_links: + :path: Flutter/ephemeral/.symlinks/plugins/app_links/macos + audioplayers_darwin: + :path: Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos + cloud_firestore: + :path: Flutter/ephemeral/.symlinks/plugins/cloud_firestore/macos + firebase_core: + :path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos + FlutterMacOS: + :path: Flutter/ephemeral + share_plus: + :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos + shared_preferences_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin + +SPEC CHECKSUMS: + abseil: a05cc83bf02079535e17169a73c5be5ba47f714b + app_links: 05a6ec2341985eb05e9f97dc63f5837c39895c3f + audioplayers_darwin: 761f2948df701d05b5db603220c384fb55720012 + BoringSSL-GRPC: dded2a44897e45f28f08ae87a55ee4bcd19bc508 + cloud_firestore: 71947b640bd24f6f849d9d185e5d0a619fa6b93b + Firebase: 9a58fdbc9d8655ed7b79a19cf9690bb007d3d46d + firebase_core: b1697fb64ff2b9ca16baaa821205f8b0c058e5d2 + FirebaseAppCheckInterop: ba3dc604a89815379e61ec2365101608d365cf7d + FirebaseCore: 0dbad74bda10b8fb9ca34ad8f375fb9dd3ebef7c + FirebaseCoreExtension: 6605938d51f765d8b18bfcafd2085276a252bee2 + FirebaseCoreInternal: fe5fa466aeb314787093a7dce9f0beeaad5a2a21 + FirebaseFirestore: 67f23000ca238ccbab79127ed59636a9a2689e74 + FirebaseFirestoreInternal: a0e7382af3d208898dcd1d4d52d8a7870632e881 + FirebaseSharedSwift: f57ed48f4542b2d7eb4738f4f23ba443f78b3780 + FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 + GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 + "gRPC-C++": cc207623316fb041a7a3e774c252cf68a058b9e8 + gRPC-Core: 860978b7db482de8b4f5e10677216309b5ff6330 + leveldb-library: cc8b8f8e013647a295ad3f8cd2ddf49a6f19be19 + nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 + share_plus: 510bf0af1a42cd602274b4629920c9649c52f4cc + shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb + +PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009 + +COCOAPODS: 1.16.2 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5cc1da2 --- /dev/null +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,877 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 3C3B77D9C6543C6F96CC6DE6 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB0544848CE73ECC942EC053 /* GoogleService-Info.plist */; }; + 85A75931F7ECD0EB77CE498A /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80513B2109C56F05875A556F /* Pods_RunnerTests.framework */; }; + 95E9466865C23EDBF45DBE77 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26DC9A629ECECA3B7B1FB1C4 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 16ADF5B9B0D7BE1235747D56 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 26DC9A629ECECA3B7B1FB1C4 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* tetraq.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = tetraq.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 6709546456D618E784965108 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 80513B2109C56F05875A556F /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8DB80F95FE8B5971B4CA415A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + AB0544848CE73ECC942EC053 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; + CFD16EECBFAC19BDBDEF85C7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + D2FF917B79A9277CE6AAC58E /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + FB8528B405F057F38C0319E0 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 85A75931F7ECD0EB77CE498A /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 95E9466865C23EDBF45DBE77 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 54B725C1324F2F2624EA6A2F /* Pods */, + AB0544848CE73ECC942EC053 /* GoogleService-Info.plist */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* tetraq.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + 54B725C1324F2F2624EA6A2F /* Pods */ = { + isa = PBXGroup; + children = ( + 8DB80F95FE8B5971B4CA415A /* Pods-Runner.debug.xcconfig */, + CFD16EECBFAC19BDBDEF85C7 /* Pods-Runner.release.xcconfig */, + 6709546456D618E784965108 /* Pods-Runner.profile.xcconfig */, + 16ADF5B9B0D7BE1235747D56 /* Pods-RunnerTests.debug.xcconfig */, + FB8528B405F057F38C0319E0 /* Pods-RunnerTests.release.xcconfig */, + D2FF917B79A9277CE6AAC58E /* Pods-RunnerTests.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 26DC9A629ECECA3B7B1FB1C4 /* Pods_Runner.framework */, + 80513B2109C56F05875A556F /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + EDF59C9071909BFF46CCA91E /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + C22224F57740212592AF6D8B /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 2588C10E70912472DCC74F2C /* [CP] Embed Pods Frameworks */, + 52F002E32F4B73150088FE23 /* Run Script */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* tetraq.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + 3C3B77D9C6543C6F96CC6DE6 /* GoogleService-Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 2588C10E70912472DCC74F2C /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 52F002E32F4B73150088FE23 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}\"\nfor framework in *.framework; do\n if [ -d \"$framework\" ]; then\n # 1. Crea fisicamente la cartella nascosta che Flutter si è dimenticato\n mkdir -p \"$framework/Versions/A/Resources\"\n \n # 2. Ripristina i puntatori interni\n ln -sfn A \"$framework/Versions/Current\"\n \n # 3. Crea la scorciatoia esterna richiesta da Apple\n ln -sfn Versions/Current/Resources \"$framework/Resources\"\n fi\ndone\n"; + }; + C22224F57740212592AF6D8B /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + EDF59C9071909BFF46CCA91E /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 16ADF5B9B0D7BE1235747D56 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tetraq.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/tetraq"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FB8528B405F057F38C0319E0 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tetraq.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/tetraq"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D2FF917B79A9277CE6AAC58E /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tetraq.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/tetraq"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2BX6QRR7GG; + ENABLE_APP_SANDBOX = YES; + ENABLE_INCOMING_NETWORK_CONNECTIONS = NO; + ENABLE_OUTGOING_NETWORK_CONNECTIONS = NO; + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; + ENABLE_RESOURCE_ACCESS_BLUETOOTH = NO; + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; + ENABLE_RESOURCE_ACCESS_CAMERA = NO; + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; + ENABLE_RESOURCE_ACCESS_LOCATION = NO; + ENABLE_RESOURCE_ACCESS_PRINTING = NO; + ENABLE_RESOURCE_ACCESS_USB = NO; + INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = TetraQ; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2BX6QRR7GG; + ENABLE_APP_SANDBOX = YES; + ENABLE_INCOMING_NETWORK_CONNECTIONS = NO; + ENABLE_OUTGOING_NETWORK_CONNECTIONS = NO; + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; + ENABLE_RESOURCE_ACCESS_BLUETOOTH = NO; + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; + ENABLE_RESOURCE_ACCESS_CAMERA = NO; + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; + ENABLE_RESOURCE_ACCESS_LOCATION = NO; + ENABLE_RESOURCE_ACCESS_PRINTING = NO; + ENABLE_RESOURCE_ACCESS_USB = NO; + INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = TetraQ; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 3; + DEVELOPMENT_TEAM = 2BX6QRR7GG; + ENABLE_APP_SANDBOX = YES; + ENABLE_INCOMING_NETWORK_CONNECTIONS = NO; + ENABLE_OUTGOING_NETWORK_CONNECTIONS = NO; + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; + ENABLE_RESOURCE_ACCESS_BLUETOOTH = NO; + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; + ENABLE_RESOURCE_ACCESS_CAMERA = NO; + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; + ENABLE_RESOURCE_ACCESS_LOCATION = NO; + ENABLE_RESOURCE_ACCESS_PRINTING = NO; + ENABLE_RESOURCE_ACCESS_USB = NO; + INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = TetraQ; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MARKETING_VERSION = 1.0.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..7c52662 --- /dev/null +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..b3c1761 --- /dev/null +++ b/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..96d3fee --- /dev/null +++ b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "info": { + "version": 1, + "author": "xcode" + }, + "images": [ + { + "size": "16x16", + "idiom": "mac", + "filename": "app_icon_16.png", + "scale": "1x" + }, + { + "size": "16x16", + "idiom": "mac", + "filename": "app_icon_32.png", + "scale": "2x" + }, + { + "size": "32x32", + "idiom": "mac", + "filename": "app_icon_32.png", + "scale": "1x" + }, + { + "size": "32x32", + "idiom": "mac", + "filename": "app_icon_64.png", + "scale": "2x" + }, + { + "size": "128x128", + "idiom": "mac", + "filename": "app_icon_128.png", + "scale": "1x" + }, + { + "size": "128x128", + "idiom": "mac", + "filename": "app_icon_256.png", + "scale": "2x" + }, + { + "size": "256x256", + "idiom": "mac", + "filename": "app_icon_256.png", + "scale": "1x" + }, + { + "size": "256x256", + "idiom": "mac", + "filename": "app_icon_512.png", + "scale": "2x" + }, + { + "size": "512x512", + "idiom": "mac", + "filename": "app_icon_512.png", + "scale": "1x" + }, + { + "size": "512x512", + "idiom": "mac", + "filename": "app_icon_1024.png", + "scale": "2x" + } + ] +} \ No newline at end of file diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..ca0387c Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..3873ff7 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..6e69bf2 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..f43dd6c Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..3e1413a Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..e27bd62 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..4a29a00 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..80e867a --- /dev/null +++ b/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..9c64748 --- /dev/null +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = tetraq + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.sanza.tetraq + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2026 com.sanza. All rights reserved. diff --git a/macos/Runner/Configs/Debug.xcconfig b/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Release.xcconfig b/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Warnings.xcconfig b/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..9804039 --- /dev/null +++ b/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.client + + com.apple.security.network.server + + + \ No newline at end of file diff --git a/macos/Runner/GoogleService-Info.plist b/macos/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..f4889f9 --- /dev/null +++ b/macos/Runner/GoogleService-Info.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + AIzaSyB77j18Jgeb9gBAEwp-uyOQvr4m-RJ_rAE + GCM_SENDER_ID + 705460445314 + PLIST_VERSION + 1 + BUNDLE_ID + com.sanza.tetraq + PROJECT_ID + tetraq-32a4a + STORAGE_BUCKET + tetraq-32a4a.firebasestorage.app + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:705460445314:ios:da11cbca5d1f6bc27b949b + + \ No newline at end of file diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist new file mode 100644 index 0000000..281cf0e --- /dev/null +++ b/macos/Runner/Info.plist @@ -0,0 +1,34 @@ + + + + + LSApplicationCategoryType + public.app-category.puzzle-games + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + \ No newline at end of file diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..3cc05eb --- /dev/null +++ b/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements new file mode 100644 index 0000000..b79f6de --- /dev/null +++ b/macos/Runner/Release.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.client + + + diff --git a/macos/RunnerTests/RunnerTests.swift b/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..61f3bd1 --- /dev/null +++ b/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/macos/tetraq_memory.txt b/macos/tetraq_memory.txt new file mode 100644 index 0000000..7734ac2 --- /dev/null +++ b/macos/tetraq_memory.txt @@ -0,0 +1,15 @@ +=== TETRAQ PROJECT BACKUP === + +=== pubspec.yaml === + +=== MAC OS CONFIG: Info.plist === + +=== MAC OS CONFIG: DebugProfile.entitlements === + +=== IOS CONFIG: Info.plist === + +=== ANDROID CONFIG: AndroidManifest.xml === + +=== ANDROID CONFIG: build.gradle.kts (app) === + +=== SOURCE CODE (lib/) === diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..0a29191 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,839 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: cd83f7d6bd4e4c0b0b4fef802e8796784032e1cc23d7b0e982cf5d05d9bbe182 + url: "https://pub.dev" + source: hosted + version: "1.3.66" + app_links: + dependency: "direct main" + description: + name: app_links + sha256: "3462d9defc61565fde4944858b59bec5be2b9d5b05f20aed190adb3ad08a7abc" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + app_links_linux: + dependency: transitive + description: + name: app_links_linux + sha256: f5f7173a78609f3dfd4c2ff2c95bd559ab43c80a87dc6a095921d96c05688c81 + url: "https://pub.dev" + source: hosted + version: "1.0.3" + app_links_platform_interface: + dependency: transitive + description: + name: app_links_platform_interface + sha256: "05f5379577c513b534a29ddea68176a4d4802c46180ee8e2e966257158772a3f" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + app_links_web: + dependency: transitive + description: + name: app_links_web + sha256: af060ed76183f9e2b87510a9480e56a5352b6c249778d07bd2c95fc35632a555 + url: "https://pub.dev" + source: hosted + version: "1.0.4" + archive: + dependency: transitive + description: + name: archive + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff + url: "https://pub.dev" + source: hosted + version: "4.0.9" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + audioplayers: + dependency: "direct main" + description: + name: audioplayers + sha256: c05c6147124cd63e725e861335a8b4d57300b80e6e92cea7c145c739223bbaef + url: "https://pub.dev" + source: hosted + version: "5.2.1" + audioplayers_android: + dependency: transitive + description: + name: audioplayers_android + sha256: b00e1a0e11365d88576320ec2d8c192bc21f1afb6c0e5995d1c57ae63156acb5 + url: "https://pub.dev" + source: hosted + version: "4.0.3" + audioplayers_darwin: + dependency: transitive + description: + name: audioplayers_darwin + sha256: "3034e99a6df8d101da0f5082dcca0a2a99db62ab1d4ddb3277bed3f6f81afe08" + url: "https://pub.dev" + source: hosted + version: "5.0.2" + audioplayers_linux: + dependency: transitive + description: + name: audioplayers_linux + sha256: "60787e73fefc4d2e0b9c02c69885402177e818e4e27ef087074cf27c02246c9e" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + audioplayers_platform_interface: + dependency: transitive + description: + name: audioplayers_platform_interface + sha256: "365c547f1bb9e77d94dd1687903a668d8f7ac3409e48e6e6a3668a1ac2982adb" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + audioplayers_web: + dependency: transitive + description: + name: audioplayers_web + sha256: "22cd0173e54d92bd9b2c80b1204eb1eb159ece87475ab58c9788a70ec43c2a62" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + audioplayers_windows: + dependency: transitive + description: + name: audioplayers_windows + sha256: "9536812c9103563644ada2ef45ae523806b0745f7a78e89d1b5fb1951de90e1a" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + sha256: "54484b2fc49f41b46f35b60a54b12351181eeaad22c0e3def276a81e17ae7c9b" + url: "https://pub.dev" + source: hosted + version: "6.1.2" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: dfaa8b2c0d0a824af289d4159816a5c78417feec264c2194081d645687195158 + url: "https://pub.dev" + source: hosted + version: "7.0.6" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: "35d01f502b3b701d700470d32a8f82704dac8341a66e86c074900cde5bab343d" + url: "https://pub.dev" + source: hosted + version: "5.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "28bb3ae56f117b5aec029d702a90f57d285cd975c3c5c281eaca38dbc47c5937" + url: "https://pub.dev" + source: hosted + version: "0.3.5+2" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "923085c881663ef685269b013e241b428e1fb03cdd0ebde265d9b40ff18abf80" + url: "https://pub.dev" + source: hosted + version: "4.4.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "83e7356c704131ca4d8d8dd57e360d8acecbca38b1a3705c7ae46cc34c708084" + url: "https://pub.dev" + source: hosted + version: "3.4.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" + url: "https://pub.dev" + source: hosted + version: "0.13.1" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: db9df7a5898d894eeda4c78143f35c30a243558be439518972366880b80bf88e + url: "https://pub.dev" + source: hosted + version: "8.0.2" + gtk: + dependency: transitive + description: + name: gtk + sha256: e8ce9ca4b1df106e4d72dad201d345ea1a036cc12c360f1a7d5a758f78ffa42c + url: "https://pub.dev" + source: hosted + version: "2.1.0" + hooks: + dependency: transitive + description: + name: hooks + sha256: "7a08a0d684cb3b8fb604b78455d5d352f502b68079f7b80b831c62220ab0a4f6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + image: + dependency: transitive + description: + name: image + sha256: f9881ff4998044947ec38d098bc7c8316ae1186fa786eddffdb867b9bc94dfce + url: "https://pub.dev" + source: hosted + version: "4.8.0" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: cb09e7dac6210041fad964ed7fbee004f14258b4eca4040f72d1234062ace4c8 + url: "https://pub.dev" + source: hosted + version: "4.11.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" + url: "https://pub.dev" + source: hosted + version: "0.17.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "100a1c87616ab6ed41ec263b083c0ef3261ee6cd1dc3b0f35f8ddfa4f996fe52" + url: "https://pub.dev" + source: hosted + version: "9.3.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e + url: "https://pub.dev" + source: hosted + version: "2.2.22" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675" + url: "https://pub.dev" + source: hosted + version: "7.0.2" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + posix: + dependency: transitive + description: + name: posix + sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" + url: "https://pub.dev" + source: hosted + version: "6.5.0" + provider: + dependency: "direct main" + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.dev" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + share_plus: + dependency: "direct main" + description: + name: share_plus + sha256: "14c8860d4de93d3a7e53af51bff479598c4e999605290756bbbe45cf65b37840" + url: "https://pub.dev" + source: hosted + version: "12.0.1" + share_plus_platform_interface: + dependency: transitive + description: + name: share_plus_platform_interface + sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: cbc40be9be1c5af4dab4d6e0de4d5d3729e6f3d65b89d21e1815d57705644a6f + url: "https://pub.dev" + source: hosted + version: "2.4.20" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" + url: "https://pub.dev" + source: hosted + version: "1.10.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0 + url: "https://pub.dev" + source: hosted + version: "3.4.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" + source: hosted + version: "0.7.7" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a + url: "https://pub.dev" + source: hosted + version: "3.2.2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: d0412fcf4c6b31ecfdb7762359b7206ffba3bbffd396c6d9f9c4616ece476c1f + url: "https://pub.dev" + source: hosted + version: "2.4.2" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f" + url: "https://pub.dev" + source: hosted + version: "3.1.5" + uuid: + dependency: transitive + description: + name: uuid + sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" + url: "https://pub.dev" + source: hosted + version: "4.5.3" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + win32: + dependency: transitive + description: + name: win32 + sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e + url: "https://pub.dev" + source: hosted + version: "5.15.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" + url: "https://pub.dev" + source: hosted + version: "6.6.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.10.7 <4.0.0" + flutter: ">=3.38.4" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..2549489 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,51 @@ +name: tetraq +description: A new Flutter project. +publish_to: 'none' +version: 1.0.0+4 +environment: + sdk: ^3.10.7 + +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.8 + + # I nostri "Superpoteri" + provider: ^6.1.2 # Per gestire lo stato (Temi, Punteggi) + shared_preferences: ^2.5.4 # Per salvare opzioni e record sul telefono + audioplayers: ^5.2.1 # Per la musica e gli effetti sonori + intl: ^0.20.2 # Necessario per le traduzioni + flutter_localizations: # Il sistema multilingua ufficiale + sdk: flutter + firebase_core: ^4.4.0 + cloud_firestore: ^6.1.2 + share_plus: ^12.0.1 + app_links: ^7.0.0 + google_fonts: ^8.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + flutter_launcher_icons: ^0.13.1 + +flutter: + uses-material-design: true + + # Abilita la generazione automatica delle traduzioni + generate: true + + # Dichiariamo le cartelle dove metteremo immagini e suoni + assets: + - assets/images/ + - assets/audio/bgm/ + - assets/audio/sfx/ + + +flutter_icons: + android: "ic_launcher" + ios: true + macos: + generate: true + image_path: "assets/icon/icona_master.png" + min_sdk_android: 21 # Serve per compatibilità con Android recenti \ No newline at end of file diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..b151669 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:tetraq/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/tetraq_memory.txt b/tetraq_memory.txt new file mode 100644 index 0000000..b851d52 --- /dev/null +++ b/tetraq_memory.txt @@ -0,0 +1,3750 @@ +=== TETRAQ PROJECT BACKUP === + +=== PROJECT STRUCTURE (LIB & ASSETS) === +assets/.DS_Store +assets/audio/sfx/cyber_box.wav +assets/audio/sfx/cyber_line.wav +assets/audio/sfx/doodle_box.wav +assets/audio/sfx/doodle_line.wav +assets/audio/sfx/minimal_box.wav +assets/audio/sfx/minimal_line.wav +assets/icon/icona_master.png +assets/images/.DS_Store +assets/images/doodle_bg.jpg +assets/images/doodle_bg1.jpg +assets/images/icona_big.jpeg +assets/images/wood_bg.jpg +lib/.DS_Store +lib/core/app_colors.dart +lib/core/constants.dart +lib/core/theme_manager.dart +lib/firebase_options.dart +lib/l10n/app_en.arb +lib/l10n/app_it.arb +lib/logic/ai_engine.dart +lib/logic/game_controller.dart +lib/main.dart +lib/models/game_board.dart +lib/models/player_info.dart +lib/services/audio_service.dart +lib/services/firebase_service.dart +lib/services/multiplayer_service.dart +lib/services/storage_service.dart +lib/ui/game/board_painter.dart +lib/ui/game/game_screen.dart +lib/ui/game/score_board.dart +lib/ui/home/history_screen.dart +lib/ui/home/home_screen.dart +lib/ui/multiplayer/lobby_screen.dart +lib/ui/settings/settings_screen.dart +lib/widgets/custom_button.dart +lib/widgets/custom_settings_button.dart +lib/widgets/game_over_dialog.dart + +=== pubspec.yaml === +name: tetraq +description: A new Flutter project. +publish_to: 'none' +version: 1.0.0+4 +environment: + sdk: ^3.10.7 + +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.8 + + # I nostri "Superpoteri" + provider: ^6.1.2 # Per gestire lo stato (Temi, Punteggi) + shared_preferences: ^2.5.4 # Per salvare opzioni e record sul telefono + audioplayers: ^5.2.1 # Per la musica e gli effetti sonori + intl: ^0.20.2 # Necessario per le traduzioni + flutter_localizations: # Il sistema multilingua ufficiale + sdk: flutter + firebase_core: ^4.4.0 + cloud_firestore: ^6.1.2 + share_plus: ^12.0.1 + app_links: ^7.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + flutter_launcher_icons: ^0.13.1 + +flutter: + uses-material-design: true + + # Abilita la generazione automatica delle traduzioni + generate: true + + # Dichiariamo le cartelle dove metteremo immagini e suoni + assets: + - assets/images/ + - assets/audio/bgm/ + - assets/audio/sfx/ + - assets/images/ + +flutter_icons: + android: "ic_launcher" + ios: true + macos: + generate: true + image_path: "assets/icon/icona_master.png" + min_sdk_android: 21 # Serve per compatibilità con Android recenti +=== MAC OS CONFIG: Info.plist === + + + + + LSApplicationCategoryType + public.app-category.puzzle-games + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + +=== MAC OS CONFIG: DebugProfile.entitlements === + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.client + + com.apple.security.network.server + + + +=== IOS CONFIG: Info.plist === + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Tetraq + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + tetraq + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + + +=== ANDROID CONFIG: AndroidManifest.xml === + + + + + + + + + + + + + + + + + + + + + + + + + + + +=== ANDROID CONFIG: build.gradle.kts (app) === +plugins { + id("com.android.application") + // START: FlutterFire Configuration + id("com.google.gms.google-services") + // END: FlutterFire Configuration + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.sanza.tetraq" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.sanza.tetraq" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} + +=== SOURCE CODE (lib/) === + +// =========================================================================== +// FILE: lib/core/app_colors.dart +// =========================================================================== + +import 'package:flutter/material.dart'; + +enum AppThemeType { minimal, doodle, cyberpunk, wood } + +class ThemeColors { + final Color background; + final Color gridLine; + final Color playerRed; + final Color playerBlue; + final Color text; + + const ThemeColors({ + required this.background, + required this.gridLine, + required this.playerRed, + required this.playerBlue, + required this.text, + }); +} + +class AppColors { + static const ThemeColors minimal = ThemeColors( + background: Color(0xFFF5F7FA), gridLine: Color(0xFFCFD8DC), + playerRed: Color(0xFFE53935), playerBlue: Color(0xFF1E88E5), text: Color(0xFF263238), + ); + + static const ThemeColors doodle = ThemeColors( + background: Color(0xFFFFF9E6), gridLine: Color(0xFFB0BEC5), + playerRed: Color(0xFFD32F2F), playerBlue: Color(0xFF1565C0), text: Color(0xFF37474F), + ); + + // --- TEMA CYBERPUNK AGGIORNATO --- + static const ThemeColors cyberpunk = ThemeColors( + background: Color(0xFF0A001A), // Sfondo notte profonda + gridLine: Color(0xFF6200EA), // Viola scuro elettrico (non fa confusione con le mosse) + playerRed: Color(0xFFFF007F), // Rosa Neon (invariato) + playerBlue: Color(0xFF69F0AE), // Verde Fluo brillante! (Green Accent) + text: Color(0xFFFFFFFF), + ); + + // --- TEMA LEGNO POTENZIATO --- + static const ThemeColors wood = ThemeColors( + background: Color(0xFF905D3B), // Marrone caldo e ricco (vero legno) + gridLine: Color(0xFF4A301E), // Marrone scurissimo per i solchi + playerRed: Color(0xFFE53935), // Rosso acceso per i fiammiferi + playerBlue: Color(0xFF29B6F6), // Azzurro acceso per i fiammiferi + text: Color(0xFFFBE9E7), // Panna chiaro per contrastare lo scuro + ); + + static ThemeColors getTheme(AppThemeType type) { + switch (type) { + case AppThemeType.minimal: return minimal; + case AppThemeType.doodle: return doodle; + case AppThemeType.cyberpunk: return cyberpunk; + case AppThemeType.wood: return wood; + } + } +} +// =========================================================================== +// FILE: lib/core/constants.dart +// =========================================================================== + +class Constants { + // Chiavi per salvare i dati sul telefono + static const String prefThemeKey = 'selected_theme'; + static const String prefLanguageKey = 'selected_language'; + static const String prefBoardSizeKey = 'board_size'; + + // Impostazioni della scacchiera a rombo - RAGGI INCREMENTATI + static const int minBoardRadius = 2; // Ex Normale, ora è Piccola + static const int maxBoardRadius = 5; // Formato MAX, enorme + static const int defaultBoardRadius = 3; // Ora il default è più grande +} +// =========================================================================== +// FILE: lib/core/theme_manager.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'app_colors.dart'; +import '../services/storage_service.dart'; + +class ThemeManager extends ChangeNotifier { + late AppThemeType _currentThemeType; + + ThemeManager() { + // Quando l'app parte, legge il tema dalla memoria! + _currentThemeType = AppThemeType.values[StorageService.instance.savedThemeIndex]; + } + + AppThemeType get currentThemeType => _currentThemeType; + ThemeColors get currentColors => AppColors.getTheme(_currentThemeType); + + void setTheme(AppThemeType type) { + _currentThemeType = type; + StorageService.instance.saveTheme(type); // Salva la scelta nel "disco fisso" + notifyListeners(); + } +} +// =========================================================================== +// FILE: lib/firebase_options.dart +// =========================================================================== + +// File generated by FlutterFire CLI. +// ignore_for_file: type=lint +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for web - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + return macos; + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } + } + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyBsXO595xVITDPrRnXrW8HPQLOe7Rz4Gg4', + appId: '1:705460445314:android:4d35fef29cfd63727b949b', + messagingSenderId: '705460445314', + projectId: 'tetraq-32a4a', + storageBucket: 'tetraq-32a4a.firebasestorage.app', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyB77j18Jgeb9gBAEwp-uyOQvr4m-RJ_rAE', + appId: '1:705460445314:ios:da11cbca5d1f6bc27b949b', + messagingSenderId: '705460445314', + projectId: 'tetraq-32a4a', + storageBucket: 'tetraq-32a4a.firebasestorage.app', + iosBundleId: 'com.sanza.tetraq', + ); + + static const FirebaseOptions macos = FirebaseOptions( + apiKey: 'AIzaSyB77j18Jgeb9gBAEwp-uyOQvr4m-RJ_rAE', + appId: '1:705460445314:ios:da11cbca5d1f6bc27b949b', + messagingSenderId: '705460445314', + projectId: 'tetraq-32a4a', + storageBucket: 'tetraq-32a4a.firebasestorage.app', + iosBundleId: 'com.sanza.tetraq', + ); +} + +// =========================================================================== +// FILE: lib/logic/ai_engine.dart +// =========================================================================== + +import 'dart:math'; +import '../models/game_board.dart'; + +class AIEngine { + static Line getBestMove(GameBoard board, int level) { + // IL FIX FONDAMENTALE È QUI: + // Filtriamo le linee in modo che la CPU veda SOLO quelle libere E giocabili! + List availableLines = board.lines.where((l) => l.owner == Player.none && l.isPlayable).toList(); + final random = Random(); + + // Se per qualche assurdo motivo non ci sono mosse, restituisce la prima linea a caso + // (Non dovrebbe mai succedere, ma ci protegge dai crash) + if (availableLines.isEmpty) return board.lines.first; + + // --- FORMULA DI DIFFICOLTÀ --- + double smartChance = 0.50 + ((level - 1) * 0.10); + if (smartChance > 1.0) smartChance = 1.0; + + bool beSmart = random.nextDouble() < smartChance; + + // --- REGOLA 1: Chiudere i quadrati --- + List closingMoves = []; + for (var line in availableLines) { + if (_willCloseBox(board, line)) { + closingMoves.add(line); + } + } + + if (closingMoves.isNotEmpty) { + if (beSmart || random.nextDouble() < 0.70) { + return closingMoves[random.nextInt(closingMoves.length)]; + } + } + + // --- REGOLA 2: Mosse Sicure --- + List safeMoves = []; + for (var line in availableLines) { + if (_isSafeMove(board, line)) { + safeMoves.add(line); + } + } + + if (safeMoves.isNotEmpty) { + if (beSmart) { + return safeMoves[random.nextInt(safeMoves.length)]; + } else { + if (random.nextDouble() < 0.5) { + return safeMoves[random.nextInt(safeMoves.length)]; + } + } + } + + // --- REGOLA 3: Mossa a caso --- + return availableLines[random.nextInt(availableLines.length)]; + } + + static bool _willCloseBox(GameBoard board, Line line) { + for (var box in board.boxes) { + // Ignora i box invisibili! + if (box.type == BoxType.invisible) continue; + + if (box.top == line || box.bottom == line || box.left == line || box.right == line) { + int linesCount = 0; + if (box.top.owner != Player.none || box.top == line) linesCount++; + if (box.bottom.owner != Player.none || box.bottom == line) linesCount++; + if (box.left.owner != Player.none || box.left == line) linesCount++; + if (box.right.owner != Player.none || box.right == line) linesCount++; + + if (linesCount == 4) return true; + } + } + return false; + } + + static bool _isSafeMove(GameBoard board, Line line) { + for (var box in board.boxes) { + // Ignora i box invisibili! + if (box.type == BoxType.invisible) continue; + + if (box.top == line || box.bottom == line || box.left == line || box.right == line) { + int currentLinesCount = 0; + if (box.top.owner != Player.none) currentLinesCount++; + if (box.bottom.owner != Player.none) currentLinesCount++; + if (box.left.owner != Player.none) currentLinesCount++; + if (box.right.owner != Player.none) currentLinesCount++; + + if (currentLinesCount == 2) return false; + } + } + return true; + } +} +// =========================================================================== +// FILE: lib/logic/game_controller.dart +// =========================================================================== + +import 'dart:async'; +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import '../models/game_board.dart'; +import 'ai_engine.dart'; +import '../services/audio_service.dart'; +import '../services/storage_service.dart'; +import '../core/app_colors.dart'; + +class GameController extends ChangeNotifier { + late GameBoard board; + bool isVsCPU = false; + bool isCPUThinking = false; + + bool isOnline = false; + String? roomCode; + bool isHost = false; + StreamSubscription? _onlineSubscription; + + bool opponentLeft = false; + bool _hasSavedResult = false; + + Timer? _blitzTimer; + int timeLeft = 15; + final int maxTime = 15; + + String effectText = ''; + Color effectColor = Colors.transparent; + Timer? _effectTimer; + + Player get myPlayer => isHost ? Player.red : Player.blue; + bool get isGameOver => board.isGameOver; + + int cpuLevel = 1; + int currentMatchLevel = 1; + int? currentSeed; + AppThemeType _activeTheme = AppThemeType.cyberpunk; + + String onlineHostName = "ROSSO"; + String onlineGuestName = "BLU"; + ArenaShape onlineShape = ArenaShape.classic; + + GameController({int radius = 3}) { + cpuLevel = StorageService.instance.cpuLevel; + startNewGame(radius); + } + + void startNewGame(int radius, {bool vsCPU = false, bool isOnline = false, String? roomCode, bool isHost = false, ArenaShape shape = ArenaShape.classic}) { + _onlineSubscription?.cancel(); + _onlineSubscription = null; + _blitzTimer?.cancel(); + _effectTimer?.cancel(); + effectText = ''; + _hasSavedResult = false; + + this.isVsCPU = vsCPU; + this.isOnline = isOnline; + this.roomCode = roomCode; + this.isHost = isHost; + + // Salviamo la forma scelta anche se siamo offline + onlineShape = shape; + + int levelToUse = isOnline ? (currentMatchLevel == 1 ? 2 : currentMatchLevel) : cpuLevel; + + // PASSIAMO LA FORMA AL MOTORE! + board = GameBoard(radius: radius, level: levelToUse, seed: currentSeed, shape: onlineShape); + + isCPUThinking = false; + opponentLeft = false; + + if (this.isOnline && this.roomCode != null) { + _listenToOnlineGame(this.roomCode!); + } + + _startTimer(); + notifyListeners(); + } + + void triggerSpecialEffect(String text, Color color) { + effectText = text; + effectColor = color; + notifyListeners(); + _effectTimer?.cancel(); + _effectTimer = Timer(const Duration(milliseconds: 1200), () { effectText = ''; notifyListeners(); }); + } + + void _playEffects(List newClosed, {required bool isOpponent}) { + if (newClosed.isEmpty) { + AudioService.instance.playLineSfx(_activeTheme); + if (!isOpponent) HapticFeedback.lightImpact(); + } else { + bool isGold = newClosed.any((b) => b.type == BoxType.gold); + bool isBomb = newClosed.any((b) => b.type == BoxType.bomb); + + if (isGold) { + AudioService.instance.playBonusSfx(); triggerSpecialEffect("+2", Colors.amber); HapticFeedback.heavyImpact(); + } else if (isBomb) { + AudioService.instance.playBombSfx(); triggerSpecialEffect("-1", Colors.redAccent); HapticFeedback.heavyImpact(); + } else { + AudioService.instance.playBoxSfx(_activeTheme); HapticFeedback.heavyImpact(); + } + } + } + + // --- FIX TIMER: SCENDE PER ENTRAMBI, MA SCADE SOLO PER CHI HA IL TURNO --- + void _startTimer() { + _blitzTimer?.cancel(); + timeLeft = maxTime; + + _blitzTimer = Timer.periodic(const Duration(seconds: 1), (timer) { + if (isGameOver || isCPUThinking) { timer.cancel(); return; } + + if (timeLeft > 0) { + timeLeft--; + notifyListeners(); + } else { + timer.cancel(); + // IL TIMEOUT FORZA LA MOSSA SOLO SE È IL MIO TURNO + // Evita che il telefono in attesa forzi mosse per conto dell'avversario + if (!isOnline || board.currentPlayer == myPlayer) { + _handleTimeOut(); + } + } + }); + } + + void _handleTimeOut() { + if (isOnline) { + Line randomMove = AIEngine.getBestMove(board, 5); + handleLineTap(randomMove, _activeTheme, forced: true); + } + else if (isVsCPU && board.currentPlayer == Player.red) { + Line randomMove = AIEngine.getBestMove(board, cpuLevel); + handleLineTap(randomMove, _activeTheme, forced: true); + } + else if (!isVsCPU) { + Line randomMove = AIEngine.getBestMove(board, 5); + handleLineTap(randomMove, _activeTheme, forced: true); + } + } + + void disconnectOnlineGame() { + _onlineSubscription?.cancel(); + _onlineSubscription = null; + _blitzTimer?.cancel(); + _effectTimer?.cancel(); + + if (isOnline && roomCode != null) { + FirebaseFirestore.instance.collection('games').doc(roomCode).update({'status': 'abandoned'}).catchError((e) => null); + } + + isOnline = false; + roomCode = null; + currentMatchLevel = 1; + currentSeed = null; + } + + void requestRematch() { + if (isOnline && roomCode != null) { + currentMatchLevel++; + int newSeed = DateTime.now().millisecondsSinceEpoch % 1000000; + FirebaseFirestore.instance.collection('games').doc(roomCode).update({ + 'moves': [], + 'matchLevel': currentMatchLevel, + 'status': 'playing', + 'seed': newSeed, + 'shape': onlineShape.name + }); + } + } + + @override + void dispose() { disconnectOnlineGame(); super.dispose(); } + + void _listenToOnlineGame(String code) { + _onlineSubscription = FirebaseFirestore.instance.collection('games').doc(code).snapshots().listen((doc) { + if (!doc.exists) return; + + var data = doc.data() as Map; + + onlineHostName = data['hostName'] ?? "ROSSO"; + onlineGuestName = (data['guestName'] != null && data['guestName'] != '') ? data['guestName'] : "BLU"; + + if (data['status'] == 'abandoned' && !board.isGameOver && !opponentLeft) { + opponentLeft = true; notifyListeners(); return; + } + + List moves = data['moves'] ?? []; + int hostLevel = data['matchLevel'] ?? 1; + int? hostSeed = data['seed']; + + String shapeStr = data['shape'] ?? 'classic'; + ArenaShape hostShape = ArenaShape.values.firstWhere((e) => e.name == shapeStr, orElse: () => ArenaShape.classic); + onlineShape = hostShape; + + if (hostLevel > currentMatchLevel || (isOnline && currentSeed == null && hostSeed != null) || (hostSeed != null && hostSeed != currentSeed)) { + currentMatchLevel = hostLevel; currentSeed = hostSeed; + int levelToUse = (currentMatchLevel == 1) ? 2 : currentMatchLevel; + board = GameBoard(radius: board.radius, level: levelToUse, seed: currentSeed, shape: onlineShape); + isCPUThinking = false; notifyListeners(); return; + } + + int firebaseMovesCount = moves.length; + int localMovesCount = board.lines.where((l) => l.owner != Player.none).length; + + if (firebaseMovesCount == 0 && localMovesCount > 0) { + int levelToUse = (currentMatchLevel == 1) ? 2 : currentMatchLevel; + board = GameBoard(radius: board.radius, level: levelToUse, seed: currentSeed, shape: onlineShape); + notifyListeners(); return; + } + + if (firebaseMovesCount > localMovesCount) { + bool newMovesApplied = false; // <-- FIX: Ci segniamo se abbiamo ricevuto mosse + + for (int i = localMovesCount; i < firebaseMovesCount; i++) { + var m = moves[i]; Line? lineToPlay; + for (var line in board.lines) { + if ((line.p1.x == m['x1'] && line.p1.y == m['y1'] && line.p2.x == m['x2'] && line.p2.y == m['y2']) || + (line.p1.x == m['x2'] && line.p1.y == m['y2'] && line.p2.x == m['x1'] && line.p2.y == m['y1'])) { + lineToPlay = line; break; + } + } + if (lineToPlay != null && lineToPlay.owner == Player.none) { + Player playerFromFirebase = (m['player'] == 'red') ? Player.red : Player.blue; + bool isOpponentMove = (playerFromFirebase != myPlayer); + List closedBefore = board.boxes.where((b) => b.owner != Player.none).toList(); + + board.playMove(lineToPlay, forcedPlayer: playerFromFirebase); + newMovesApplied = true; + + List newClosed = board.boxes.where((b) => b.owner != Player.none && !closedBefore.contains(b)).toList(); + if (isOpponentMove) _playEffects(newClosed, isOpponent: true); + } + } + + // --- FIX TIMER: SE L'AVVERSARIO HA MOSSO, RESETTIAMO IL TIMER --- + if (newMovesApplied) { + _startTimer(); + } + + if (board.isGameOver) _saveMatchResult(); + notifyListeners(); + } + }); + } + + void handleLineTap(Line line, AppThemeType theme, {bool forced = false}) { + if ((isCPUThinking || board.isGameOver || opponentLeft) && !forced) return; + if (isOnline && board.currentPlayer != myPlayer && !forced) return; + + _activeTheme = theme; + List closedBefore = board.boxes.where((b) => b.owner != Player.none).toList(); + + if (board.playMove(line)) { + List newClosed = board.boxes.where((b) => b.owner != Player.none && !closedBefore.contains(b)).toList(); + if (!forced) _playEffects(newClosed, isOpponent: false); + + _startTimer(); notifyListeners(); + + if (isOnline && roomCode != null) { + Map moveData = { + 'x1': line.p1.x, 'y1': line.p1.y, 'x2': line.p2.x, 'y2': line.p2.y, + 'player': myPlayer == Player.red ? 'red' : 'blue' + }; + FirebaseFirestore.instance.collection('games').doc(roomCode).update({ + 'moves': FieldValue.arrayUnion([moveData]) + }).catchError((e) => debugPrint("Errore: $e")); + + if (board.isGameOver) _saveMatchResult(); + + } else { + if (board.isGameOver) _saveMatchResult(); + else if (isVsCPU && board.currentPlayer == Player.blue) _checkCPUTurn(); + } + } + } + + void _checkCPUTurn() async { + if (isVsCPU && board.currentPlayer == Player.blue && !board.isGameOver) { + isCPUThinking = true; _blitzTimer?.cancel(); notifyListeners(); + await Future.delayed(const Duration(milliseconds: 600)); + + if (!board.isGameOver) { + List closedBefore = board.boxes.where((b) => b.owner != Player.none).toList(); + Line bestMove = AIEngine.getBestMove(board, cpuLevel); + board.playMove(bestMove); + + List newClosed = board.boxes.where((b) => b.owner != Player.none && !closedBefore.contains(b)).toList(); + _playEffects(newClosed, isOpponent: true); + + isCPUThinking = false; _startTimer(); notifyListeners(); + + if (board.isGameOver) _saveMatchResult(); + else _checkCPUTurn(); + } + } + } + + void _saveMatchResult() { + if (_hasSavedResult) return; + _hasSavedResult = true; + + String myRealName = StorageService.instance.playerName; + if (myRealName.isEmpty) myRealName = "IO"; + + if (isOnline) { + String oppName = isHost ? onlineGuestName : onlineHostName; + int myScore = isHost ? board.scoreRed : board.scoreBlue; + int oppScore = isHost ? board.scoreBlue : board.scoreRed; + StorageService.instance.saveMatchToHistory(myName: myRealName, opponent: oppName, myScore: myScore, oppScore: oppScore, isOnline: true); + } else if (isVsCPU) { + int myScore = board.scoreRed; int cpuScore = board.scoreBlue; + if (myScore > cpuScore) StorageService.instance.addWin(); + else if (cpuScore > myScore) StorageService.instance.addLoss(); + StorageService.instance.saveMatchToHistory(myName: myRealName, opponent: "CPU (Liv. $cpuLevel)", myScore: myScore, oppScore: cpuScore, isOnline: false); + } else { + StorageService.instance.saveMatchToHistory(myName: myRealName, opponent: "Ospite (Locale)", myScore: board.scoreRed, oppScore: board.scoreBlue, isOnline: false); + } + } + + void increaseLevelAndRestart() { + cpuLevel++; StorageService.instance.saveCpuLevel(cpuLevel); + startNewGame(board.radius, vsCPU: true, shape: board.shape); + } +} +// =========================================================================== +// FILE: lib/main.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'core/theme_manager.dart'; +import 'logic/game_controller.dart'; +import 'ui/home/home_screen.dart'; +import 'services/storage_service.dart'; // <-- Importiamo il servizio +import 'package:firebase_core/firebase_core.dart'; +import 'firebase_options.dart'; + +void main() async { + // Assicuriamoci che i motori di Flutter siano pronti + WidgetsFlutterBinding.ensureInitialized(); + + // 1. Accendiamo Firebase! (Questo ti era sfuggito) + await Firebase.initializeApp( + options: DefaultFirebaseOptions.currentPlatform, + ); + + // 2. Accendiamo la Memoria Locale! + await StorageService.instance.init(); + + runApp( + MultiProvider( + providers: [ + ChangeNotifierProvider(create: (_) => ThemeManager()), + ChangeNotifierProvider(create: (_) => GameController()), + ], + child: const TetraQApp(), + ), + ); +} + +class TetraQApp extends StatelessWidget { + const TetraQApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'TetraQ', + debugShowCheckedModeBanner: false, + theme: ThemeData( + fontFamily: 'Roboto', + useMaterial3: true, + ), + home: const HomeScreen(), + ); + } +} +// =========================================================================== +// FILE: lib/models/game_board.dart +// =========================================================================== + +import 'dart:math'; + +enum Player { red, blue, none } +enum BoxType { normal, gold, bomb, invisible } + +enum ArenaShape { classic, cross, donut, hourglass } + +class Dot { + final int x; + final int y; + Dot(this.x, this.y); + + @override + bool operator ==(Object other) => identical(this, other) || other is Dot && runtimeType == other.runtimeType && x == other.x && y == other.y; + @override + int get hashCode => x.hashCode ^ y.hashCode; +} + +class Line { + final Dot p1; + final Dot p2; + Player owner = Player.none; + bool isPlayable = false; + + Line(this.p1, this.p2); + + bool connects(Dot a, Dot b) { return (p1 == a && p2 == b) || (p1 == b && p2 == a); } +} + +class Box { + final int x; + final int y; + Player owner = Player.none; + late Line top, bottom, left, right; + BoxType type = BoxType.normal; + + Box(this.x, this.y); + + bool isClosed() { + if (type == BoxType.invisible) return false; + return top.owner != Player.none && bottom.owner != Player.none && left.owner != Player.none && right.owner != Player.none; + } + + int get value { + if (type == BoxType.gold) return 2; + if (type == BoxType.bomb) return -1; + return 1; + } +} + +class GameBoard { + final int radius; + final int level; + final int? seed; + final ArenaShape shape; + + List dots = []; + List lines = []; + List boxes = []; + + Player currentPlayer = Player.red; + int scoreRed = 0; + int scoreBlue = 0; + bool isGameOver = false; + + GameBoard({required this.radius, this.level = 1, this.seed, this.shape = ArenaShape.classic}) { + _generateBoard(); + } + + void _generateBoard() { + int size = radius * 2 + 1; + final random = seed != null ? Random(seed) : Random(); + + dots.clear(); + lines.clear(); + boxes.clear(); + + for (int y = 0; y < size; y++) { + for (int x = 0; x < size; x++) { + var box = Box(x, y); + + // Distanze dal centro della scacchiera + int dx = (x - radius).abs(); + int dy = (y - radius).abs(); + + // 1. Controllo base: Deve appartenere al Rombo primario + bool isVisible = (dx + dy) <= radius; + + // 2. LOGICA FORME (Scolpiamo i blocchi dall'interno) + if (isVisible) { + switch (shape) { + case ArenaShape.classic: + break; // Nessun taglio + + case ArenaShape.cross: + // Per fare una croce *all'interno* di un rombo, dobbiamo svuotare + // 4 "triangolini" vicini agli assi mediani. + // La logica è: se non sei sull'asse centrale verticale o orizzontale, sparisci. + // Aumentiamo lo spessore del braccio se il raggio è grande. + int spessoreBraccio = radius > 3 ? 1 : 0; + if (dx > spessoreBraccio && dy > spessoreBraccio) { + isVisible = false; + } + break; + + case ArenaShape.donut: + // Il Buco Nero (Donut). Svuotiamo il nucleo centrale. + int dimensioneBuco = radius > 3 ? 2 : 1; + if ((dx + dy) <= dimensioneBuco) { + isVisible = false; + } + break; + + case ArenaShape.hourglass: + // La Clessidra. Svuotiamo i due lobi laterali (sinistro e destro). + // Vogliamo mantenere solo l'alto e il basso. + if (dx > dy) { + isVisible = false; + } + // Manteniamo una singola scatola di giunzione al centro esatto + if (x == radius && y == radius) { + isVisible = true; + } + break; + } + } + + if (!isVisible) { + box.type = BoxType.invisible; + } else if (level > 1) { + double chance = random.nextDouble(); + if (chance < 0.10) { box.type = BoxType.gold; } + else if (chance > 0.90) { box.type = BoxType.bomb; } + } + boxes.add(box); + } + } + + // --- PULIZIA DEFINITIVA: ASSEGNAZIONE DELLE LINEE --- + for (var box in boxes) { + Dot tl = _getOrAddDot(box.x, box.y); + Dot tr = _getOrAddDot(box.x + 1, box.y); + Dot bl = _getOrAddDot(box.x, box.y + 1); + Dot br = _getOrAddDot(box.x + 1, box.y + 1); + + box.top = _getOrAddLine(tl, tr); + box.bottom = _getOrAddLine(bl, br); + box.left = _getOrAddLine(tl, bl); + box.right = _getOrAddLine(tr, br); + + // Le linee sono "giocabili" SOLO se appartengono a una scatola VISIBILE + if (box.type != BoxType.invisible) { + box.top.isPlayable = true; + box.bottom.isPlayable = true; + box.left.isPlayable = true; + box.right.isPlayable = true; + } + } + } + + Dot _getOrAddDot(int x, int y) { + for (var dot in dots) { if (dot.x == x && dot.y == y) return dot; } + var newDot = Dot(x, y); + dots.add(newDot); + return newDot; + } + + Line _getOrAddLine(Dot a, Dot b) { + for (var line in lines) { if (line.connects(a, b)) return line; } + var newLine = Line(a, b); + lines.add(newLine); + return newLine; + } + + bool playMove(Line lineToPlay, {Player? forcedPlayer}) { + if (isGameOver) return false; + + Player playerMakingMove = forcedPlayer ?? currentPlayer; + Line? actualLine; + for (var l in lines) { + if (l.connects(lineToPlay.p1, lineToPlay.p2)) { + actualLine = l; break; + } + } + + if (actualLine == null || actualLine.owner != Player.none || !actualLine.isPlayable) return false; + + actualLine.owner = playerMakingMove; + bool boxedClosed = false; + + for (var box in boxes) { + if (box.owner == Player.none && box.isClosed()) { + box.owner = playerMakingMove; + boxedClosed = true; + if (playerMakingMove == Player.red) { scoreRed += box.value; } + else { scoreBlue += box.value; } + } + } + + if (lines.where((l) => l.isPlayable).every((l) => l.owner != Player.none)) { isGameOver = true; } + + if (forcedPlayer == null) { + if (!boxedClosed && !isGameOver) { currentPlayer = (currentPlayer == Player.red) ? Player.blue : Player.red; } + } else { + if (!boxedClosed && !isGameOver) { currentPlayer = (forcedPlayer == Player.red) ? Player.blue : Player.red; } + else { currentPlayer = forcedPlayer; } + } + + return true; + } +} +// =========================================================================== +// FILE: lib/models/player_info.dart +// =========================================================================== + + +// =========================================================================== +// FILE: lib/services/audio_service.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'package:audioplayers/audioplayers.dart'; +import '../core/app_colors.dart'; + +class AudioService extends ChangeNotifier { + static final AudioService instance = AudioService._internal(); + AudioService._internal(); + + bool isMuted = false; + final AudioPlayer _sfxPlayer = AudioPlayer(); + + void toggleMute() { + isMuted = !isMuted; + notifyListeners(); + } + + void playLineSfx(AppThemeType theme) async { + if (isMuted) return; + String file = ''; + switch (theme) { + case AppThemeType.minimal: file = 'minimal_line.wav'; break; + case AppThemeType.doodle: + case AppThemeType.wood: + file = 'doodle_line.wav'; break; + case AppThemeType.cyberpunk: file = 'cyber_line.wav'; break; + } + await _sfxPlayer.play(AssetSource('audio/sfx/$file')); + } + + void playBoxSfx(AppThemeType theme) async { + if (isMuted) return; + String file = ''; + switch (theme) { + case AppThemeType.minimal: file = 'minimal_box.wav'; break; + case AppThemeType.doodle: + case AppThemeType.wood: + file = 'doodle_box.wav'; break; + case AppThemeType.cyberpunk: file = 'cyber_box.wav'; break; + } + await _sfxPlayer.play(AssetSource('audio/sfx/$file')); + } + + // --- NUOVI EFFETTI SPECIALI --- + void playBonusSfx() async { + if (isMuted) return; + // Assicurati di aggiungere questo file nella cartella assets/audio/sfx/ + await _sfxPlayer.play(AssetSource('audio/sfx/bonus.wav')); + } + + void playBombSfx() async { + if (isMuted) return; + // Assicurati di aggiungere questo file nella cartella assets/audio/sfx/ + await _sfxPlayer.play(AssetSource('audio/sfx/bomb.wav')); + } +} +// =========================================================================== +// FILE: lib/services/firebase_service.dart +// =========================================================================== + + +// =========================================================================== +// FILE: lib/services/multiplayer_service.dart +// =========================================================================== + +import 'dart:math'; +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:share_plus/share_plus.dart'; + +class MultiplayerService { + final FirebaseFirestore _firestore = FirebaseFirestore.instance; + + CollectionReference get _gamesCollection => _firestore.collection('games'); + + // AGGIUNTO shapeName + Future createGameRoom(int boardRadius, String hostName, String shapeName) async { + String roomCode = _generateRoomCode(); + int randomSeed = Random().nextInt(1000000); + + await _gamesCollection.doc(roomCode).set({ + 'status': 'waiting', + 'radius': boardRadius, + 'createdAt': FieldValue.serverTimestamp(), + 'players': ['host'], + 'turn': 'host', + 'moves': [], + 'seed': randomSeed, + 'hostName': hostName, + 'guestName': '', + 'shape': shapeName, // <-- SALVIAMO LA FORMA DELL'ARENA SU FIREBASE + }); + + return roomCode; + } + + Future?> joinGameRoom(String roomCode, String guestName) async { + DocumentSnapshot doc = await _gamesCollection.doc(roomCode).get(); + + if (doc.exists && doc['status'] == 'waiting') { + await _gamesCollection.doc(roomCode).update({ + 'status': 'playing', + 'players': FieldValue.arrayUnion(['guest']), + 'guestName': guestName, + }); + return doc.data() as Map; + } + return null; + } + + void shareInviteLink(String roomCode) { + String message = "Ehi! Giochiamo a TetraQ? 🎮\nCopia questo intero messaggio e apri l'app per entrare direttamente, oppure inserisci manualmente il codice: $roomCode"; + Share.share(message); + } + + Stream listenToRoom(String roomCode) { + return _gamesCollection.doc(roomCode).snapshots(); + } + + String _generateRoomCode() { + const chars = 'ACDEFGHJKLMNPQRSTUVWXYZ2345679'; + final random = Random(); + return String.fromCharCodes(Iterable.generate( + 5, (_) => chars.codeUnitAt(random.nextInt(chars.length)), + )); + } +} +// =========================================================================== +// FILE: lib/services/storage_service.dart +// =========================================================================== + +import 'dart:convert'; +import 'package:shared_preferences/shared_preferences.dart'; +import '../core/app_colors.dart'; + +class StorageService { + static final StorageService instance = StorageService._internal(); + StorageService._internal(); + + late SharedPreferences _prefs; + + // Si avvia quando apriamo l'app + Future init() async { + _prefs = await SharedPreferences.getInstance(); + } + + // --- IMPOSTAZIONI --- + int get savedThemeIndex => _prefs.getInt('theme') ?? AppThemeType.cyberpunk.index; + Future saveTheme(AppThemeType theme) async => await _prefs.setInt('theme', theme.index); + + int get savedRadius => _prefs.getInt('radius') ?? 2; + Future saveRadius(int radius) async => await _prefs.setInt('radius', radius); + + bool get isMuted => _prefs.getBool('isMuted') ?? false; + Future saveMuted(bool muted) async => await _prefs.setBool('isMuted', muted); + + // --- STATISTICHE VS CPU --- + int get wins => _prefs.getInt('wins') ?? 0; + Future addWin() async => await _prefs.setInt('wins', wins + 1); + + int get losses => _prefs.getInt('losses') ?? 0; + Future addLoss() async => await _prefs.setInt('losses', losses + 1); + + int get cpuLevel => _prefs.getInt('cpuLevel') ?? 1; + Future saveCpuLevel(int level) async => await _prefs.setInt('cpuLevel', level); + + // --- MULTIPLAYER --- + String get playerName => _prefs.getString('playerName') ?? ''; + Future savePlayerName(String name) async => await _prefs.setString('playerName', name); + + // --- STORICO PARTITE --- + List> get matchHistory { + List history = _prefs.getStringList('matchHistory') ?? []; + return history.map((e) => jsonDecode(e) as Map).toList(); + } + + // Salviamo sia il nostro nome che quello dell'avversario + Future saveMatchToHistory({required String myName, required String opponent, required int myScore, required int oppScore, required bool isOnline}) async { + List history = _prefs.getStringList('matchHistory') ?? []; + + Map match = { + 'date': DateTime.now().toIso8601String(), + 'myName': myName, + 'opponent': opponent, + 'myScore': myScore, + 'oppScore': oppScore, + 'isOnline': isOnline, + }; + + // Aggiungiamo in cima (il più recente per primo) + history.insert(0, jsonEncode(match)); + + // Teniamo solo le ultime 50 partite per non intasare la memoria + if (history.length > 50) { + history = history.sublist(0, 50); + } + + await _prefs.setStringList('matchHistory', history); + } +} +// =========================================================================== +// FILE: lib/ui/game/board_painter.dart +// =========================================================================== + +import 'dart:math'; +import 'package:flutter/material.dart'; +import '../../models/game_board.dart'; +import '../../core/app_colors.dart'; + +class BoardPainter extends CustomPainter { + final GameBoard board; + final ThemeColors theme; + final AppThemeType themeType; + + BoardPainter({required this.board, required this.theme, required this.themeType}); + + @override + void paint(Canvas canvas, Size size) { + if (themeType == AppThemeType.doodle) { + final Paint paperGridPaint = Paint() + ..color = Colors.grey.withOpacity(0.3) + ..strokeWidth = 1.0 + ..style = PaintingStyle.stroke; + + double paperStep = 20.0; + for (double i = 0; i <= size.width; i += paperStep) { + canvas.drawLine(Offset(i, 0), Offset(i, size.height), paperGridPaint); + } + for (double i = 0; i <= size.height; i += paperStep) { + canvas.drawLine(Offset(0, i), Offset(size.width, i), paperGridPaint); + } + } + + int gridPoints = board.radius * 2 + 2; + double spacing = size.width / gridPoints; + double offset = spacing / 2; + Offset getScreenPos(int x, int y) => Offset(x * spacing + offset, y * spacing + offset); + + // --- 1. DISEGNO AREE CONQUISTATE E ICONE --- + for (var box in board.boxes) { + // Ignoriamo totalmente le scatole invisibili (tagliate via dalle nuove forme) + if (box.type == BoxType.invisible) continue; + + Offset p1 = getScreenPos(box.x, box.y); + Offset p2 = getScreenPos(box.x + 1, box.y + 1); + Rect rect = Rect.fromPoints(p1, p2); + + if (box.owner != Player.none) { + final boxPaint = Paint() + ..style = PaintingStyle.fill + ..color = box.owner == Player.red ? theme.playerRed.withOpacity(0.6) : theme.playerBlue.withOpacity(0.6); + + if (themeType == AppThemeType.wood) { + _drawFlameBox(canvas, rect, box.owner == Player.red); + } else if (themeType == AppThemeType.doodle) { + Color penColor = box.owner == Player.red ? Colors.redAccent.shade700 : Colors.blueAccent.shade700; + _drawScribbleBox(canvas, rect, penColor); + } else { + canvas.drawRect(rect, boxPaint); + } + } + + if (box.type == BoxType.gold) { + _drawIconInBox(canvas, rect, Icons.star_rounded, Colors.amber); + } else if (box.type == BoxType.bomb) { + _drawIconInBox(canvas, rect, Icons.mood_bad_rounded, themeType == AppThemeType.cyberpunk ? Colors.greenAccent : Colors.deepPurple); + } + } + + // --- 2. DISEGNO LINEE --- + for (var line in board.lines) { + // FIX FONDAMENTALE PER LE FORME: Non disegnare linee non giocabili! + if (!line.isPlayable) continue; + + Offset p1 = getScreenPos(line.p1.x, line.p1.y); + Offset p2 = getScreenPos(line.p2.x, line.p2.y); + + Color lineColor = line.owner == Player.none + ? theme.gridLine.withOpacity(0.4) + : (line.owner == Player.red ? theme.playerRed : theme.playerBlue); + + if (themeType == AppThemeType.wood) { + if (line.owner == Player.none) { + canvas.drawLine(p1, p2, Paint()..color = const Color(0xFF3E2723).withOpacity(0.3)..strokeWidth = 4.5..strokeCap = StrokeCap.round); + } else { + _drawRealisticMatch(canvas, p1, p2, lineColor); + } + } else if (themeType == AppThemeType.cyberpunk) { + _drawNeonLine(canvas, p1, p2, lineColor, line.owner != Player.none); + } else if (themeType == AppThemeType.doodle) { + Color doodleColor = line.owner == Player.none ? Colors.black.withOpacity(0.05) : lineColor; + _drawWobblyLine(canvas, p1, p2, doodleColor, line.owner != Player.none); + } else { + canvas.drawLine(p1, p2, Paint()..color = lineColor..strokeWidth = 6.0..strokeCap = StrokeCap.round); + } + } + + // --- 3. DISEGNO PUNTINI (SOLO QUELLI UTILI) --- + final dotPaint = Paint()..style = PaintingStyle.fill; + + // Raccogliamo solo i puntini che appartengono a linee giocabili + Set activeDots = {}; + for (var line in board.lines) { + if (line.isPlayable) { + activeDots.add(line.p1); + activeDots.add(line.p2); + } + } + + for (var dot in activeDots) { + Offset pos = getScreenPos(dot.x, dot.y); + if (themeType == AppThemeType.wood) { + canvas.drawCircle(pos, 3.5, dotPaint..color = const Color(0xFF3E2723).withOpacity(0.2)); + } else if (themeType == AppThemeType.cyberpunk) { + canvas.drawCircle(pos, 6.0, Paint()..color = theme.gridLine.withOpacity(0.3)); + canvas.drawCircle(pos, 3.0, Paint()..color = Colors.white.withOpacity(0.5)); + } else if (themeType == AppThemeType.doodle) { + canvas.drawRect(Rect.fromCenter(center: pos, width: 4, height: 4), dotPaint..color = Colors.black.withOpacity(0.25)); + } else { + canvas.drawCircle(pos, 5.0, dotPaint..color = theme.text.withOpacity(0.6)); + } + } + } + + void _drawIconInBox(Canvas canvas, Rect rect, IconData icon, Color color) { + TextPainter textPainter = TextPainter(textDirection: TextDirection.ltr); + textPainter.text = TextSpan( + text: String.fromCharCode(icon.codePoint), + style: TextStyle( + color: color.withOpacity(0.7), + fontSize: rect.width * 0.45, + fontFamily: icon.fontFamily, + package: icon.fontPackage, + shadows: [Shadow(color: color.withOpacity(0.6), blurRadius: 10, offset: const Offset(0, 0))] + ), + ); + textPainter.layout(); + textPainter.paint(canvas, Offset(rect.center.dx - textPainter.width / 2, rect.center.dy - textPainter.height / 2)); + } + + void _drawFlameBox(Canvas canvas, Rect baseRect, bool isRed) { + final rand = Random((baseRect.left + baseRect.top).toInt()); + Offset center = baseRect.center; + + double w = baseRect.width * 0.35; + double h = baseRect.height * 0.55; + + Offset bottomCenter = Offset(center.dx, center.dy + h * 0.5); + + Color outerColor = isRed ? Colors.red.shade600.withOpacity(0.85) : Colors.blue.shade700.withOpacity(0.85); + Color midColor = isRed ? Colors.orangeAccent : Colors.lightBlueAccent; + Color coreColor = isRed ? Colors.yellowAccent : Colors.white; + + canvas.drawOval( + Rect.fromCenter(center: bottomCenter, width: w * 1.5, height: w * 0.5), + Paint() + ..color = Colors.black.withOpacity(0.4) + ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 4.0), + ); + + void drawFlameLayer(double scale, Color color, double tipOffsetX) { + Path path = Path(); + double fw = w * scale; + double fh = h * scale; + + path.moveTo(bottomCenter.dx, bottomCenter.dy); + + path.cubicTo( + bottomCenter.dx + fw, bottomCenter.dy, + bottomCenter.dx + fw * 0.8, bottomCenter.dy - fh * 0.6, + bottomCenter.dx + tipOffsetX, bottomCenter.dy - fh, + ); + + path.cubicTo( + bottomCenter.dx - fw * 0.8, bottomCenter.dy - fh * 0.6, + bottomCenter.dx - fw, bottomCenter.dy, + bottomCenter.dx, bottomCenter.dy, + ); + + canvas.drawPath( + path, + Paint() + ..color = color + ..style = PaintingStyle.fill + ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 1.5), + ); + } + + double randomTipX = (rand.nextDouble() - 0.5) * w * 0.8; + + drawFlameLayer(1.0, outerColor, randomTipX); + drawFlameLayer(0.65, midColor.withOpacity(0.9), randomTipX * 0.6); + drawFlameLayer(0.35, coreColor.withOpacity(0.9), randomTipX * 0.2); + } + + void _drawScribbleBox(Canvas canvas, Rect baseRect, Color color) { + final rand = Random((baseRect.left + baseRect.top).toInt()); + final paint = Paint() + ..color = color.withOpacity(0.85) + ..style = PaintingStyle.stroke + ..strokeWidth = 3.5 + ..strokeCap = StrokeCap.round + ..strokeJoin = StrokeJoin.round; + + final path = Path(); + Rect rect = baseRect.deflate(4.0); + + int numZigs = 15 + rand.nextInt(6); + double stepY = rect.height / numZigs; + + path.moveTo(rect.left + rand.nextDouble() * 5, rect.top + rand.nextDouble() * 5); + + for (int i = 1; i <= numZigs; i++) { + double targetX = (i % 2 != 0) ? rect.right + (rand.nextDouble() * 4 - 2) : rect.left + (rand.nextDouble() * 4 - 2); + double targetY = rect.top + stepY * i + (rand.nextDouble() - 0.5) * 3; + double ctrlX = rect.center.dx + (rand.nextDouble() - 0.5) * 20; + double ctrlY = targetY - stepY / 2; + path.quadraticBezierTo(ctrlX, ctrlY, targetX, targetY); + } + canvas.drawPath(path, paint); + } + + void _drawRealisticMatch(Canvas canvas, Offset p1, Offset p2, Color headColor) { + int seed = (p1.dx * 1000 + p1.dy).toInt(); + Random rand = Random(seed); + Vector2 dir = Vector2(p2.dx - p1.dx, p2.dy - p1.dy).normalized(); + double shrink = 8.0; + Offset start = Offset(p1.dx + dir.x * shrink, p1.dy + dir.y * shrink); + Offset end = Offset(p2.dx - dir.x * shrink, p2.dy - dir.y * shrink); + start += Offset(rand.nextDouble() * 4 - 2, rand.nextDouble() * 4 - 2); + end += Offset(rand.nextDouble() * 4 - 2, rand.nextDouble() * 4 - 2); + bool headAtEnd = rand.nextBool(); + Offset headPos = headAtEnd ? end : start; + Offset tailPos = headAtEnd ? start : end; + Vector2 matchDir = Vector2(headPos.dx - tailPos.dx, headPos.dy - tailPos.dy).normalized(); + canvas.drawLine(tailPos + const Offset(4, 4), headPos + const Offset(4, 4), Paint()..color = Colors.black.withOpacity(0.6)..strokeWidth = 7.0..strokeCap = StrokeCap.round); + canvas.drawLine(tailPos, headPos, Paint()..color = const Color(0xFF6D4C41)..strokeWidth = 7.0..strokeCap = StrokeCap.round); + canvas.drawLine(tailPos, headPos, Paint()..color = const Color(0xFFEDC498)..strokeWidth = 4.0..strokeCap = StrokeCap.round); + Offset burnPos = Offset(headPos.dx - matchDir.x * 8, headPos.dy - matchDir.y * 8); + canvas.drawLine(burnPos, headPos, Paint()..color = const Color(0xFF2E1A14)..strokeWidth = 6.0..strokeCap = StrokeCap.round); + canvas.save(); + canvas.translate(headPos.dx, headPos.dy); + double angle = atan2(matchDir.y, matchDir.x); + canvas.rotate(angle); + Rect headOval = Rect.fromCenter(center: Offset.zero, width: 18.0, height: 13.0); + canvas.drawOval(headOval.shift(const Offset(1, 2)), Paint()..color = Colors.black.withOpacity(0.6)); + canvas.drawOval(headOval, Paint()..color = headColor); + canvas.restore(); + } + + void _drawNeonLine(Canvas canvas, Offset p1, Offset p2, Color color, bool isConquered) { + double mainWidth = isConquered ? 6.0 : 3.0; + + canvas.drawLine(p1, p2, Paint() + ..color = color.withOpacity(isConquered ? 0.4 : 0.2) + ..strokeWidth = mainWidth * 4 + ..strokeCap = StrokeCap.round + ..maskFilter = MaskFilter.blur(BlurStyle.normal, isConquered ? 12.0 : 6.0) + ); + + if (isConquered) { + canvas.drawLine(p1, p2, Paint() + ..color = color.withOpacity(0.7) + ..strokeWidth = mainWidth * 2 + ..strokeCap = StrokeCap.round + ..maskFilter = const MaskFilter.blur(BlurStyle.normal, 6.0) + ); + } + + canvas.drawLine(p1, p2, Paint() + ..color = isConquered ? Colors.white.withOpacity(0.9) : color.withOpacity(0.6) + ..strokeWidth = mainWidth + ..strokeCap = StrokeCap.round + ); + } + + void _drawWobblyLine(Canvas canvas, Offset p1, Offset p2, Color color, bool isConquered) { + final random = Random((p1.dx + p1.dy + p2.dx + p2.dy).toInt()); + final dx = p2.dx - p1.dx; + final dy = p2.dy - p1.dy; + + double strokeW = isConquered ? 4.5 : 2.0; + + final basePaint = Paint() + ..color = color + ..strokeWidth = strokeW + ..style = PaintingStyle.stroke + ..strokeCap = StrokeCap.round; + + final mid1 = Offset(p1.dx + dx / 2 + (random.nextDouble() - 0.5) * 8, p1.dy + dy / 2 + (random.nextDouble() - 0.5) * 8); + canvas.drawPath(Path()..moveTo(p1.dx, p1.dy)..quadraticBezierTo(mid1.dx, mid1.dy, p2.dx, p2.dy), basePaint); + + final mid2 = Offset(p1.dx + dx / 2 + (random.nextDouble() - 0.5) * 6, p1.dy + dy / 2 + (random.nextDouble() - 0.5) * 6); + canvas.drawPath(Path()..moveTo(p1.dx, p1.dy)..quadraticBezierTo(mid2.dx, mid2.dy, p2.dx, p2.dy), basePaint..strokeWidth = strokeW * 0.5..color = color.withOpacity(0.8)); + } + + @override + bool shouldRepaint(covariant BoardPainter oldDelegate) => true; +} + +class Vector2 { + final double x, y; + Vector2(this.x, this.y); + double get length => sqrt(x * x + y * y); + Vector2 normalized() { + double l = length; + return l == 0 ? Vector2(0, 0) : Vector2(x / l, y / l); + } +} +// =========================================================================== +// FILE: lib/ui/game/game_screen.dart +// =========================================================================== + +import 'dart:ui'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../logic/game_controller.dart'; +import '../../core/theme_manager.dart'; +import '../../core/app_colors.dart'; +import 'board_painter.dart'; +import 'score_board.dart'; +import '../../widgets/game_over_dialog.dart'; +import '../../models/game_board.dart'; + +class GameScreen extends StatelessWidget { + const GameScreen({super.key}); + + @override + Widget build(BuildContext context) { + final themeManager = context.watch(); + final themeType = themeManager.currentThemeType; + final theme = themeManager.currentColors; + final gameController = context.watch(); + + // --- CONTROLLO EVENTI DI FINE PARTITA O ABBANDONO --- + WidgetsBinding.instance.addPostFrameCallback((_) { + if (gameController.opponentLeft) { + showDialog( + barrierDismissible: false, + context: context, + builder: (dialogContext) => AlertDialog( + backgroundColor: theme.background, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), + title: Text("VITTORIA A TAVOLINO!", textAlign: TextAlign.center, style: TextStyle(color: theme.playerRed, fontWeight: FontWeight.bold)), + content: Text("L'avversario ha abbandonato la stanza.\nSei il vincitore incontestato!", textAlign: TextAlign.center, style: TextStyle(color: theme.text, fontSize: 16)), + actionsAlignment: MainAxisAlignment.center, + actions: [ + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: theme.playerBlue, + foregroundColor: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)) + ), + onPressed: () { + gameController.disconnectOnlineGame(); + Navigator.pop(dialogContext); + Navigator.pop(context); + }, + child: const Text("MENU PRINCIPALE", style: TextStyle(fontWeight: FontWeight.bold)), + ) + ], + ) + ); + } else if (gameController.board.isGameOver) { + showDialog(barrierDismissible: false, context: context, builder: (_) => const GameOverDialog()); + } + }); + + String? bgImage; + if (themeType == AppThemeType.wood) bgImage = 'assets/images/wood_bg.jpg'; + if (themeType == AppThemeType.doodle) bgImage = 'assets/images/doodle_bg.jpg'; + + Color indicatorColor = themeType == AppThemeType.cyberpunk ? Colors.white : Colors.black; + + // --- IL CONTENUTO PRINCIPALE (Plancia e UI) --- + Widget gameContent = SafeArea( + child: Column( + children: [ + const ScoreBoard(), + + Expanded( + child: Center( + child: Padding( + padding: const EdgeInsets.all(10.0), + child: AspectRatio( + aspectRatio: 1, + child: LayoutBuilder( + builder: (context, constraints) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTapDown: (details) => _handleTap(details.localPosition, constraints.maxWidth, gameController, themeType), + child: CustomPaint( + size: Size(constraints.maxWidth, constraints.maxHeight), + painter: BoardPainter( + board: gameController.board, + theme: theme, + themeType: themeType, + ), + ), + ); + } + ), + ), + ), + ), + ), + + // --- ZONA INFERIORE: INDICATORE A SX, PULSANTE ESCI A DX --- + Padding( + padding: const EdgeInsets.only(bottom: 20.0, left: 20.0, right: 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (gameController.isVsCPU) + Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration( + color: indicatorColor.withOpacity(0.1), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: indicatorColor.withOpacity(0.3)), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.smart_toy_rounded, size: 16, color: indicatorColor), + const SizedBox(width: 8), + Text( + "LIVELLO CPU: ${gameController.cpuLevel}", + style: TextStyle( + color: indicatorColor, + fontWeight: FontWeight.bold, + fontSize: 13, + letterSpacing: 1.0, + ), + ), + ], + ), + ) + else + const SizedBox(), + + // --- PULSANTE ESCI --- + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.4), + offset: const Offset(0, 4), + blurRadius: 5, + ), + ], + ), + child: TextButton.icon( + style: TextButton.styleFrom( + backgroundColor: bgImage != null ? Colors.black87 : theme.background, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + side: BorderSide(color: Colors.white.withOpacity(0.1), width: 1), + ) + ), + icon: Icon(Icons.exit_to_app, color: bgImage != null ? Colors.white : theme.text, size: 20), + onPressed: () { + gameController.disconnectOnlineGame(); + Navigator.pop(context); + }, + label: Text("ESCI", style: TextStyle(color: bgImage != null ? Colors.white : theme.text, fontWeight: FontWeight.bold, fontSize: 14)), + ), + ), + ], + ), + ) + ], + ), + ); + + // --- STRUTTURA A LIVELLI (STACK) DELLO SCHERMO --- + return PopScope( + canPop: true, + onPopInvoked: (didPop) { + gameController.disconnectOnlineGame(); + }, + child: Scaffold( + backgroundColor: bgImage != null ? Colors.transparent : theme.background, + body: CustomPaint( + painter: themeType == AppThemeType.minimal + ? FullScreenGridPainter(Colors.black.withOpacity(0.06)) + : null, + child: Container( + decoration: bgImage != null + ? BoxDecoration( + image: DecorationImage( + image: AssetImage(bgImage), + fit: BoxFit.cover, + colorFilter: themeType == AppThemeType.doodle + ? ColorFilter.mode(Colors.white.withOpacity(0.7), BlendMode.lighten) + : null, + ), + ) + : null, + + // ========================================== + // LA MAGIA DELLO SFARFALLIO AVVIENE QUI + // ========================================== + child: Stack( + children: [ + // EFFETTO 1: TIMER LAMPEGGIANTE (Se restano 5 secondi) + if (!gameController.isCPUThinking && !gameController.isGameOver && gameController.timeLeft > 0 && gameController.timeLeft <= 5) + Positioned.fill( + child: BlitzBackgroundEffect( + timeLeft: gameController.timeLeft, + color: theme.playerRed, // Rosso Allarme! + ), + ), + + // --- NUOVO EFFETTO 2: POPUP ORO (+2) E BOMBA (-1) --- + if (gameController.effectText.isNotEmpty) + Positioned.fill( + child: SpecialEventBackgroundEffect( + text: gameController.effectText, + color: gameController.effectColor, + ), + ), + + // LA PLANCIA DI GIOCO SOPRA TUTTI GLI EFFETTI + Positioned.fill( + child: gameContent, + ), + ], + ), + ), + ), + ), + ); + } + + // ========================================== + // NUOVA GESTIONE DEI TOCCHI E DELLE DISTANZE + // ========================================== + void _handleTap(Offset tapPos, double size, GameController controller, AppThemeType themeType) { + final board = controller.board; + if (board.isGameOver) return; + + int gridPoints = board.radius * 2 + 2; + double spacing = size / gridPoints; + double offset = spacing / 2; + + Line? closestLine; + double minDistance = double.infinity; + double maxTouchDistance = spacing * 0.4; + + // Scorriamo TUTTE le linee valide della plancia + for (var line in board.lines) { + // FIX FONDAMENTALE: Ignoriamo le linee invisibili o già prese! + if (line.owner != Player.none || !line.isPlayable) continue; + + Offset screenP1 = Offset(line.p1.x * spacing + offset, line.p1.y * spacing + offset); + Offset screenP2 = Offset(line.p2.x * spacing + offset, line.p2.y * spacing + offset); + + double dist = _distanceToSegment(tapPos, screenP1, screenP2); + + if (dist < minDistance && dist < maxTouchDistance) { + minDistance = dist; + closestLine = line; + } + } + + if (closestLine != null) { + controller.handleLineTap(closestLine, themeType); + } + } + + // Calcolo della distanza su coordinate schermo reali + double _distanceToSegment(Offset p, Offset a, Offset b) { + double l2 = (a.dx - b.dx) * (a.dx - b.dx) + (a.dy - b.dy) * (a.dy - b.dy); + if (l2 == 0) return (p - a).distance; + double t = (((p.dx - a.dx) * (b.dx - a.dx) + (p.dy - a.dy) * (b.dy - a.dy)) / l2).clamp(0.0, 1.0); + Offset projection = Offset(a.dx + t * (b.dx - a.dx), a.dy + t * (b.dy - a.dy)); + return (p - projection).distance; + } +} + +// --- CLASSE PER LO SFONDO A QUADRETTI --- +class FullScreenGridPainter extends CustomPainter { + final Color gridColor; + FullScreenGridPainter(this.gridColor); + + @override + void paint(Canvas canvas, Size size) { + final Paint paperGridPaint = Paint() + ..color = gridColor + ..strokeWidth = 1.0 + ..style = PaintingStyle.stroke; + + double paperStep = 20.0; + for (double i = 0; i <= size.width; i += paperStep) { + canvas.drawLine(Offset(i, 0), Offset(i, size.height), paperGridPaint); + } + for (double i = 0; i <= size.height; i += paperStep) { + canvas.drawLine(Offset(0, i), Offset(size.width, i), paperGridPaint); + } + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +} + +// ============================================================== +// WIDGET ANIMATO PER IL TIMER (BATTITO CARDIACO / ALLARME) +// ============================================================== +class BlitzBackgroundEffect extends StatefulWidget { + final int timeLeft; + final Color color; + + const BlitzBackgroundEffect({super.key, required this.timeLeft, required this.color}); + + @override + State createState() => _BlitzBackgroundEffectState(); +} + +class _BlitzBackgroundEffectState extends State with SingleTickerProviderStateMixin { + late AnimationController _controller; + + @override + void initState() { + super.initState(); + _controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 400))..repeat(reverse: true); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return Container( + color: widget.color.withOpacity(0.12 * _controller.value), + child: Center( + child: ImageFiltered( + imageFilter: ImageFilter.blur(sigmaX: 2.0, sigmaY: 2.0), + child: Text( + '${widget.timeLeft}', + style: TextStyle( + fontSize: 300, + fontWeight: FontWeight.w900, + color: widget.color.withOpacity(0.35 + (0.3 * _controller.value)), + height: 1.0, + ), + ), + ), + ), + ); + }, + ); + } +} + +// ============================================================== +// WIDGET ANIMATO PER LE CASELLE SPECIALI (+2 / -1) +// ============================================================== +class SpecialEventBackgroundEffect extends StatefulWidget { + final String text; + final Color color; + + const SpecialEventBackgroundEffect({super.key, required this.text, required this.color}); + + @override + State createState() => _SpecialEventBackgroundEffectState(); +} + +class _SpecialEventBackgroundEffectState extends State with SingleTickerProviderStateMixin { + late AnimationController _controller; + late Animation _scaleAnimation; + late Animation _opacityAnimation; + + @override + void initState() { + super.initState(); + _controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 1000))..forward(); + + _scaleAnimation = Tween(begin: 0.5, end: 1.5).animate(CurvedAnimation(parent: _controller, curve: Curves.easeOutCubic)); + _opacityAnimation = Tween(begin: 0.9, end: 0.0).animate(CurvedAnimation(parent: _controller, curve: Curves.easeIn)); + } + + @override + void didUpdateWidget(covariant SpecialEventBackgroundEffect oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.text != widget.text) { + _controller.reset(); + _controller.forward(); + } + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return Center( + child: Transform.scale( + scale: _scaleAnimation.value, + child: Opacity( + opacity: _opacityAnimation.value, + child: ImageFiltered( + imageFilter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), + child: Text( + widget.text, + style: TextStyle( + fontSize: 250, + fontWeight: FontWeight.w900, + color: widget.color, + height: 1.0, + ), + ), + ), + ), + ), + ); + }, + ); + } +} +// =========================================================================== +// FILE: lib/ui/game/score_board.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../logic/game_controller.dart'; +import '../../models/game_board.dart'; +import '../../core/theme_manager.dart'; +import '../../services/audio_service.dart'; +import '../../core/app_colors.dart'; + +class ScoreBoard extends StatefulWidget { + const ScoreBoard({super.key}); + + @override + State createState() => _ScoreBoardState(); +} + +class _ScoreBoardState extends State { + @override + Widget build(BuildContext context) { + final controller = context.watch(); + final themeManager = context.watch(); + final theme = themeManager.currentColors; + final themeType = themeManager.currentThemeType; + + int redScore = controller.board.scoreRed; + int blueScore = controller.board.scoreBlue; + + bool isRedTurn = controller.board.currentPlayer == Player.red; + bool isMuted = AudioService.instance.isMuted; + + // --- LOGICA PER I NOMI --- + String nameRed = "ROSSO"; + String nameBlue = themeType == AppThemeType.cyberpunk ? "VERDE" : "BLU"; + + if (controller.isOnline) { + nameRed = controller.onlineHostName.toUpperCase(); + nameBlue = controller.onlineGuestName.toUpperCase(); + } else if (controller.isVsCPU) { + nameRed = "TU"; + nameBlue = "CPU"; + } + + return Container( + padding: const EdgeInsets.only(top: 10, bottom: 20, left: 20, right: 20), + decoration: BoxDecoration( + color: theme.background.withOpacity(0.95), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.3), + offset: const Offset(0, 4), + blurRadius: 8, + ), + ], + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(30), + bottomRight: Radius.circular(30), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _PlayerScore(color: theme.playerRed, score: redScore, isTurn: isRedTurn, textColor: theme.text, title: nameRed), + + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "TETRAQ", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.w900, + color: theme.text, + letterSpacing: 4, + shadows: [Shadow(color: Colors.black.withOpacity(0.3), offset: const Offset(1, 2), blurRadius: 2)] + ) + ), + IconButton( + icon: Icon(isMuted ? Icons.volume_off : Icons.volume_up, color: theme.text.withOpacity(0.7)), + onPressed: () { + setState(() { + AudioService.instance.toggleMute(); + }); + }, + ), + ], + ), + + _PlayerScore(color: theme.playerBlue, score: blueScore, isTurn: !isRedTurn, textColor: theme.text, title: nameBlue), + ], + ), + ); + } +} + +class _PlayerScore extends StatelessWidget { + final Color color; + final int score; + final bool isTurn; + final Color textColor; + final String title; + + const _PlayerScore({required this.color, required this.score, required this.isTurn, required this.textColor, required this.title}); + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(title, style: TextStyle(fontWeight: FontWeight.bold, color: isTurn ? color : textColor.withOpacity(0.5), fontSize: 12)), + const SizedBox(height: 5), + AnimatedContainer( + duration: const Duration(milliseconds: 300), + padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 10), + decoration: BoxDecoration( + color: color.withOpacity(isTurn ? 1.0 : 0.2), + borderRadius: BorderRadius.circular(15), + border: isTurn ? Border.all(color: Colors.white.withOpacity(0.4), width: 2) : Border.all(color: Colors.transparent, width: 2), + boxShadow: isTurn ? [ + BoxShadow(color: color.withOpacity(0.5), offset: const Offset(0, 4), blurRadius: 6) + ] : [], + ), + child: Text('$score', style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: isTurn ? Colors.white : textColor.withOpacity(0.5))), + ), + ], + ); + } +} +// =========================================================================== +// FILE: lib/ui/home/history_screen.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:intl/intl.dart'; +import '../../core/theme_manager.dart'; +import '../../services/storage_service.dart'; + +class HistoryScreen extends StatelessWidget { + const HistoryScreen({super.key}); + + @override + Widget build(BuildContext context) { + final theme = context.watch().currentColors; + final history = StorageService.instance.matchHistory; + + return Scaffold( + backgroundColor: theme.background, + appBar: AppBar( + title: Text("STORICO PARTITE", style: TextStyle(fontWeight: FontWeight.w900, color: theme.text, letterSpacing: 2)), + backgroundColor: Colors.transparent, + elevation: 0, + iconTheme: IconThemeData(color: theme.text), + ), + body: history.isEmpty + ? Center( + child: Text( + "Nessuna partita giocata.\nScendi in campo!", + textAlign: TextAlign.center, + style: TextStyle(color: theme.text.withOpacity(0.5), fontSize: 18, fontWeight: FontWeight.bold), + ), + ) + : ListView.builder( + padding: const EdgeInsets.all(20), + itemCount: history.length, + itemBuilder: (context, index) { + final match = history[index]; + + DateTime date = DateTime.parse(match['date']); + String formattedDate = DateFormat('dd MMM yyyy - HH:mm').format(date); + + // Leggiamo entrambi i nomi + String myName = match['myName'] ?? "IO"; // Usa 'IO' se è una partita vecchia + String opponent = match['opponent']; + + int myScore = match['myScore']; + int oppScore = match['oppScore']; + bool isOnline = match['isOnline']; + + bool isWin = myScore > oppScore; + bool isDraw = myScore == oppScore; + + Color resultColor = isWin ? Colors.green : (isDraw ? Colors.grey : theme.playerRed); + String resultText = isWin ? "VITTORIA" : (isDraw ? "PAREGGIO" : "SCONFITTA"); + + return Container( + margin: const EdgeInsets.only(bottom: 15), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: theme.text.withOpacity(0.05), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: resultColor.withOpacity(0.5), width: 2), + boxShadow: [ + BoxShadow(color: Colors.black.withOpacity(0.2), offset: const Offset(0, 4), blurRadius: 6), + ], + ), + child: Row( + children: [ + // Icona Tipo di Partita + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: resultColor.withOpacity(0.1), + shape: BoxShape.circle, + ), + child: Icon( + isOnline ? Icons.public : (opponent.contains("CPU") ? Icons.smart_toy : Icons.people_alt), + color: resultColor, + size: 28, + ), + ), + const SizedBox(width: 15), + + // Dati Partita (Ora con i nomi chiari) + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(resultText, style: TextStyle(color: resultColor, fontWeight: FontWeight.w900, fontSize: 16, letterSpacing: 1.5)), + const SizedBox(height: 5), + // NOMI GIOCATORI + RichText( + text: TextSpan( + children: [ + TextSpan(text: myName, style: TextStyle(color: theme.playerBlue, fontWeight: FontWeight.bold, fontSize: 15)), + TextSpan(text: " vs ", style: TextStyle(color: theme.text.withOpacity(0.5), fontStyle: FontStyle.italic, fontSize: 12)), + TextSpan(text: opponent, style: TextStyle(color: theme.playerRed, fontWeight: FontWeight.bold, fontSize: 15)), + ] + ) + ), + const SizedBox(height: 5), + Text(formattedDate, style: TextStyle(color: theme.text.withOpacity(0.5), fontSize: 12)), + ], + ), + ), + + // Punteggio + Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + decoration: BoxDecoration( + color: theme.background, + borderRadius: BorderRadius.circular(15), + border: Border.all(color: theme.gridLine.withOpacity(0.3)), + ), + child: Row( + children: [ + Text("$myScore", style: TextStyle(fontSize: 22, fontWeight: FontWeight.w900, color: theme.playerBlue)), + Text(" - ", style: TextStyle(fontSize: 18, color: theme.text.withOpacity(0.5))), + Text("$oppScore", style: TextStyle(fontSize: 22, fontWeight: FontWeight.w900, color: theme.playerRed)), + ], + ), + ), + ], + ), + ); + }, + ), + ); + } +} +// =========================================================================== +// FILE: lib/ui/home/home_screen.dart +// =========================================================================== + +// =========================================================================== +// FILE: lib/ui/home/home_screen.dart +// =========================================================================== + +import 'dart:ui'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:flutter/services.dart'; +import 'dart:math' as math; +import '../../core/theme_manager.dart'; +import '../../core/app_colors.dart'; +import '../../models/game_board.dart'; +import '../game/game_screen.dart'; +import '../settings/settings_screen.dart'; +import '../../logic/game_controller.dart'; +import '../../services/storage_service.dart'; +import '../multiplayer/lobby_screen.dart'; +import 'history_screen.dart'; + +// --- NUOVI WIDGET PERSONALIZZATI --- + +class _NeonShapeButton extends StatelessWidget { + final IconData icon; + final String label; + final bool isSelected; + final ThemeColors theme; + final VoidCallback onTap; + + const _NeonShapeButton({required this.icon, required this.label, required this.isSelected, required this.theme, required this.onTap}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: isSelected ? theme.playerBlue.withOpacity(0.2) : theme.text.withOpacity(0.05), + border: Border.all( + color: isSelected ? theme.playerBlue : theme.gridLine.withOpacity(0.3), + width: isSelected ? 2 : 1, + ), + boxShadow: isSelected ? [BoxShadow(color: theme.playerBlue.withOpacity(0.4), blurRadius: 12, spreadRadius: 2)] : [], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(icon, color: isSelected ? theme.playerBlue : theme.text.withOpacity(0.5), size: 24), + const SizedBox(height: 6), + Text(label, style: TextStyle(color: isSelected ? theme.text : theme.text.withOpacity(0.5), fontSize: 11, fontWeight: isSelected ? FontWeight.bold : FontWeight.normal)), + ], + ), + ), + ); + } +} + +class _NeonSizeButton extends StatelessWidget { + final String label; + final bool isSelected; + final ThemeColors theme; + final VoidCallback onTap; + + const _NeonSizeButton({required this.label, required this.isSelected, required this.theme, required this.onTap}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: isSelected ? theme.playerRed.withOpacity(0.2) : theme.text.withOpacity(0.05), + border: Border.all( + color: isSelected ? theme.playerRed : theme.gridLine.withOpacity(0.3), + width: isSelected ? 2 : 1, + ), + boxShadow: isSelected ? [BoxShadow(color: theme.playerRed.withOpacity(0.4), blurRadius: 10, spreadRadius: 1.5)] : [], + ), + child: Center( + child: Text(label, style: TextStyle(color: isSelected ? theme.text : theme.text.withOpacity(0.5), fontSize: 14, fontWeight: isSelected ? FontWeight.w900 : FontWeight.bold)), + ), + ), + ); + } +} + +class _NeonTimeSwitch extends StatelessWidget { + final bool isTimeMode; + final ThemeColors theme; + final VoidCallback onTap; + + const _NeonTimeSwitch({required this.isTimeMode, required this.theme, required this.onTap}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: isTimeMode ? Colors.amber.withOpacity(0.2) : theme.text.withOpacity(0.05), + border: Border.all( + color: isTimeMode ? Colors.amber : theme.gridLine.withOpacity(0.3), + width: isTimeMode ? 2 : 1, + ), + boxShadow: isTimeMode ? [BoxShadow(color: Colors.amber.withOpacity(0.4), blurRadius: 12, spreadRadius: 2)] : [], + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(isTimeMode ? Icons.timer : Icons.timer_off, color: isTimeMode ? Colors.amber : theme.text.withOpacity(0.5), size: 28), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + isTimeMode ? 'A TEMPO' : 'RELAX', + style: TextStyle(color: isTimeMode ? theme.text : theme.text.withOpacity(0.5), fontWeight: FontWeight.w900, fontSize: 14, letterSpacing: 1.5) + ), + Text( + isTimeMode ? '15 sec a mossa' : 'Nessun limite di tempo', + style: TextStyle(color: isTimeMode ? Colors.amber.shade200 : theme.text.withOpacity(0.4), fontSize: 11, fontWeight: FontWeight.bold) + ), + ], + ), + ], + ), + ), + ); + } +} + +// --------------------------------------------------------------------------- + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State with WidgetsBindingObserver { + // Il raggio di partenza è 4 (Taglia M) come richiesto + int _selectedRadius = 4; + ArenaShape _selectedShape = ArenaShape.classic; + bool _isTimeMode = false; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); + WidgetsBinding.instance.addPostFrameCallback((_) { + _checkPlayerName(); + }); + _checkClipboardForInvite(); + } + + @override + void dispose() { + WidgetsBinding.instance.removeObserver(this); + super.dispose(); + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.resumed) { + _checkClipboardForInvite(); + } + } + + void _checkPlayerName() { + if (StorageService.instance.playerName.isEmpty) { + _showNameDialog(); + } + } + + void _showNameDialog() { + final TextEditingController nameController = TextEditingController(); + showDialog( + context: context, + barrierDismissible: false, + barrierColor: Colors.black.withOpacity(0.8), + builder: (context) { + final themeManager = context.watch(); + final theme = themeManager.currentColors; + final themeType = themeManager.currentThemeType; + + Widget dialogContent; + + if (themeType == AppThemeType.cyberpunk) { + dialogContent = _AnimatedCyberBorder(child: _buildDialogContent(context, theme, nameController)); + } else if (themeType == AppThemeType.wood) { + dialogContent = Container( + decoration: BoxDecoration( + color: theme.background, + borderRadius: BorderRadius.circular(25), + border: Border.all(color: const Color(0xFF8B4513), width: 5), + boxShadow: [ + BoxShadow(color: Colors.black.withOpacity(0.6), blurRadius: 15, offset: const Offset(0, 8)), + const BoxShadow(color: Color(0xFFD2691E), blurRadius: 0, spreadRadius: 2, offset: Offset(0, 0)), + ], + ), + padding: const EdgeInsets.all(5), + child: _buildDialogContent(context, theme, nameController), + ); + } else if (themeType == AppThemeType.doodle) { + dialogContent = Container( + decoration: BoxDecoration( + color: theme.background, + borderRadius: BorderRadius.circular(25), + border: Border.all(color: theme.text, width: 3, style: BorderStyle.solid), + boxShadow: [ + BoxShadow(color: theme.text.withOpacity(0.3), blurRadius: 0, offset: const Offset(4, 4)), + BoxShadow(color: theme.text.withOpacity(0.3), blurRadius: 0, offset: const Offset(-2, -2)), + ], + ), + padding: const EdgeInsets.all(4), + child: _buildDialogContent(context, theme, nameController), + ); + } else { + dialogContent = Container( + decoration: BoxDecoration( + color: theme.background, + borderRadius: BorderRadius.circular(25), + border: Border.all(color: theme.playerBlue.withOpacity(0.5), width: 2), + boxShadow: [ + BoxShadow(color: theme.playerBlue.withOpacity(0.3), blurRadius: 20, spreadRadius: 5), + ] + ), + child: _buildDialogContent(context, theme, nameController), + ); + } + + return Dialog(backgroundColor: Colors.transparent, insetPadding: const EdgeInsets.all(20), child: dialogContent); + }, + ); + } + + Widget _buildDialogContent(BuildContext context, ThemeColors theme, TextEditingController controller) { + return SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 30.0, horizontal: 25.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('BENVENUTO IN TETRAQ!', style: TextStyle(color: theme.text, fontWeight: FontWeight.w900, fontSize: 24, letterSpacing: 1.5), textAlign: TextAlign.center), + const SizedBox(height: 20), + Text('Scegli il tuo nome da battaglia per sfidare i tuoi amici online.', style: TextStyle(color: theme.text.withOpacity(0.8), fontSize: 16), textAlign: TextAlign.center), + const SizedBox(height: 40), + TextField( + controller: controller, + textCapitalization: TextCapitalization.characters, + textAlign: TextAlign.center, + maxLength: 5, + style: TextStyle(color: theme.text, fontSize: 28, fontWeight: FontWeight.bold, letterSpacing: 4), + decoration: InputDecoration( + hintText: 'NOME', hintStyle: TextStyle(color: theme.text.withOpacity(0.3), letterSpacing: 4), + filled: true, fillColor: theme.text.withOpacity(0.05), counterText: "", + enabledBorder: OutlineInputBorder(borderSide: BorderSide(color: theme.gridLine.withOpacity(0.5), width: 2), borderRadius: BorderRadius.circular(15)), + focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: theme.playerBlue, width: 3), borderRadius: BorderRadius.circular(15)), + ), + ), + const SizedBox(height: 40), + SizedBox( + width: double.infinity, height: 55, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: theme.playerBlue, foregroundColor: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + elevation: 8, shadowColor: theme.playerBlue.withOpacity(0.5), + ), + onPressed: () { + final name = controller.text.trim(); + if (name.isNotEmpty) { + StorageService.instance.savePlayerName(name); + Navigator.of(context).pop(); + setState(() {}); + } + }, + child: const Text('SALVA E GIOCA', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, letterSpacing: 1.5)), + ), + ), + ], + ), + ), + ); + } + + Future _checkClipboardForInvite() async { + try { + ClipboardData? data = await Clipboard.getData(Clipboard.kTextPlain); + String? text = data?.text; + + if (text != null && text.contains("TetraQ") && text.contains("codice:")) { + RegExp regExp = RegExp(r'codice:\s*([A-Z0-9]{5})', caseSensitive: false); + Match? match = regExp.firstMatch(text); + + if (match != null) { + String roomCode = match.group(1)!.toUpperCase(); + await Clipboard.setData(const ClipboardData(text: '')); + if (mounted && ModalRoute.of(context)?.isCurrent == true) { + _promptJoinRoom(roomCode); + } + } + } + } catch (e) { + debugPrint("Errore lettura appunti: $e"); + } + } + + void _promptJoinRoom(String roomCode) { + showDialog( + context: context, + builder: (context) { + final theme = context.watch().currentColors; + return AlertDialog( + backgroundColor: theme.background, + title: Text("Invito Trovato!", style: TextStyle(color: theme.text, fontWeight: FontWeight.bold)), + content: Text("Vuoi unirti alla stanza $roomCode?", style: TextStyle(color: theme.text)), + actions: [ + TextButton(onPressed: () => Navigator.pop(context), child: const Text("No", style: TextStyle(color: Colors.red))), + ElevatedButton( + style: ElevatedButton.styleFrom(backgroundColor: theme.playerBlue), + onPressed: () { + Navigator.of(context).pop(); + Navigator.push(context, MaterialPageRoute(builder: (_) => LobbyScreen(initialRoomCode: roomCode, selectedRadius: _selectedRadius, selectedShape: _selectedShape))); + }, + child: const Text("Unisciti", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + ), + ], + ); + } + ); + } + + @override + Widget build(BuildContext context) { + // --- RIPRISTINATO: Forza la modalità a schermo intero e l'orientamento verticale --- + SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); + + final themeManager = context.watch(); + final themeType = themeManager.currentThemeType; + final theme = themeManager.currentColors; + + String? bgImage; + if (themeType == AppThemeType.wood) bgImage = 'assets/images/wood_bg.jpg'; + if (themeType == AppThemeType.doodle) bgImage = 'assets/images/doodle_bg.jpg'; + + int wins = StorageService.instance.wins; + int losses = StorageService.instance.losses; + String playerName = StorageService.instance.playerName; + if (playerName.isEmpty) playerName = "GUEST"; + + Widget uiContent = SafeArea( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + CircleAvatar( + backgroundColor: theme.playerBlue.withOpacity(0.2), + radius: 25, + child: Icon(Icons.person, color: theme.playerBlue, size: 30), + ), + const SizedBox(width: 10), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("BENVENUTO,", style: TextStyle(color: theme.text.withOpacity(0.5), fontSize: 10, fontWeight: FontWeight.bold, letterSpacing: 1.2)), + Text(playerName, style: TextStyle(color: theme.text, fontSize: 18, fontWeight: FontWeight.w900, letterSpacing: 1.5)), + ], + ), + ], + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + decoration: BoxDecoration( + color: theme.text.withOpacity(0.05), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: theme.gridLine.withOpacity(0.2)), + ), + child: Row( + children: [ + Icon(Icons.emoji_events, color: Colors.amber.shade600, size: 18), + const SizedBox(width: 4), + Text("$wins", style: TextStyle(color: theme.text, fontWeight: FontWeight.bold)), + const SizedBox(width: 10), + Icon(Icons.sentiment_very_dissatisfied, color: theme.playerRed.withOpacity(0.8), size: 18), + const SizedBox(width: 4), + Text("$losses", style: TextStyle(color: theme.text, fontWeight: FontWeight.bold)), + ], + ), + ) + ], + ), + + const SizedBox(height: 20), + + Center( + child: Column( + children: [ + Text( + "TETRAQ", + style: TextStyle( + fontSize: 50, + fontWeight: FontWeight.w900, + color: theme.text, + letterSpacing: 8, + shadows: [Shadow(color: Colors.black.withOpacity(0.3), offset: const Offset(2, 4), blurRadius: 4)] + ) + ), + Text( + "THE ROMBUS PUZZLE", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: theme.gridLine, + letterSpacing: 3, + ) + ), + ], + ), + ), + + const SizedBox(height: 20), + + // --- PANNELLO IMPOSTAZIONI ARENA CON LOGICA GRANDEZZA CORRETTA --- + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: theme.background.withOpacity(0.8), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: theme.gridLine.withOpacity(0.3)), + boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.2), blurRadius: 10, offset: const Offset(0, 4))], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // 1. SEZIONE FORMA + Text("FORMA DELL'ARENA", style: TextStyle(fontSize: 11, fontWeight: FontWeight.w900, color: theme.text.withOpacity(0.5), letterSpacing: 1.5)), + const SizedBox(height: 10), + Wrap( + spacing: 10, + runSpacing: 10, + alignment: WrapAlignment.center, + children: [ + _NeonShapeButton( + icon: Icons.diamond_outlined, label: 'Rombo', isSelected: _selectedShape == ArenaShape.classic, theme: theme, + onTap: () => setState(() => _selectedShape = ArenaShape.classic), + ), + _NeonShapeButton( + icon: Icons.add, label: 'Croce', isSelected: _selectedShape == ArenaShape.cross, theme: theme, + onTap: () => setState(() => _selectedShape = ArenaShape.cross), + ), + _NeonShapeButton( + icon: Icons.donut_large, label: 'Buco Nero', isSelected: _selectedShape == ArenaShape.donut, theme: theme, + onTap: () => setState(() => _selectedShape = ArenaShape.donut), + ), + _NeonShapeButton( + icon: Icons.hourglass_bottom, label: 'Clessidra', isSelected: _selectedShape == ArenaShape.hourglass, theme: theme, + onTap: () => setState(() => _selectedShape = ArenaShape.hourglass), + ), + ], + ), + + const SizedBox(height: 20), + Divider(color: theme.gridLine.withOpacity(0.2), height: 1), + const SizedBox(height: 20), + + // 2. SEZIONE TAGLIA (SCALA CORRETTA DA 3 A 6) + Text("GRANDEZZA", style: TextStyle(fontSize: 11, fontWeight: FontWeight.w900, color: theme.text.withOpacity(0.5), letterSpacing: 1.5)), + const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _NeonSizeButton(label: 'S', isSelected: _selectedRadius == 3, theme: theme, onTap: () => setState(() => _selectedRadius = 3)), + _NeonSizeButton(label: 'M', isSelected: _selectedRadius == 4, theme: theme, onTap: () => setState(() => _selectedRadius = 4)), + _NeonSizeButton(label: 'L', isSelected: _selectedRadius == 5, theme: theme, onTap: () => setState(() => _selectedRadius = 5)), + _NeonSizeButton(label: 'MAX', isSelected: _selectedRadius == 6, theme: theme, onTap: () => setState(() => _selectedRadius = 6)), + ], + ), + + const SizedBox(height: 20), + Divider(color: theme.gridLine.withOpacity(0.2), height: 1), + const SizedBox(height: 20), + + // 3. SEZIONE TEMPO + Text("MODALITÀ DI GIOCO", style: TextStyle(fontSize: 11, fontWeight: FontWeight.w900, color: theme.text.withOpacity(0.5), letterSpacing: 1.5)), + const SizedBox(height: 10), + _NeonTimeSwitch( + isTimeMode: _isTimeMode, + theme: theme, + onTap: () => setState(() => _isTimeMode = !_isTimeMode), + ), + ], + ), + ), + // -------------------------------------------------------------- + + const SizedBox(height: 20), + + Expanded( + child: GridView.count( + crossAxisCount: 2, + crossAxisSpacing: 15, + mainAxisSpacing: 15, + childAspectRatio: 1.1, + physics: const BouncingScrollPhysics(), + children: [ + _FeatureCard( + title: "ONLINE", subtitle: "Sfida il mondo", icon: Icons.public, color: theme.playerBlue, theme: theme, isFeatured: true, + onTap: () { + Navigator.push(context, MaterialPageRoute(builder: (_) => LobbyScreen(selectedRadius: _selectedRadius, selectedShape: _selectedShape))); + }, + ), + _FeatureCard( + title: "VS CPU", subtitle: "Allenati", icon: Icons.smart_toy, color: Colors.purple.shade400, theme: theme, + onTap: () async { + context.read().startNewGame(_selectedRadius, vsCPU: true, shape: _selectedShape); + await Navigator.push(context, MaterialPageRoute(builder: (_) => const GameScreen())); + setState(() {}); + }, + ), + _FeatureCard( + title: "LOCALE", subtitle: "Stesso schermo", icon: Icons.people_alt, color: theme.playerRed, theme: theme, + onTap: () { + context.read().startNewGame(_selectedRadius, vsCPU: false, shape: _selectedShape); + Navigator.push(context, MaterialPageRoute(builder: (_) => const GameScreen())); + }, + ), + Column( + children: [ + Expanded(child: _MiniCard(title: "STORICO", icon: Icons.history, color: Colors.orange.shade400, theme: theme, onTap: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const HistoryScreen())))), + const SizedBox(height: 15), + Expanded(child: _MiniCard(title: "TEMI", icon: Icons.palette, color: Colors.teal.shade400, theme: theme, onTap: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const SettingsScreen())))), + ], + ) + ], + ), + ), + ], + ), + ), + ); + + return Scaffold( + backgroundColor: bgImage != null ? Colors.transparent : theme.background, + body: Container( + decoration: bgImage != null ? BoxDecoration(image: DecorationImage(image: AssetImage(bgImage), fit: BoxFit.cover)) : null, + child: bgImage != null ? BackdropFilter(filter: ImageFilter.blur(sigmaX: 3.5, sigmaY: 3.5), child: Container(color: themeType == AppThemeType.doodle ? Colors.white.withOpacity(0.1) : Colors.transparent, child: uiContent)) : uiContent, + ), + ); + } +} + +class _FeatureCard extends StatelessWidget { + final String title; + final String subtitle; + final IconData icon; + final Color color; + final ThemeColors theme; + final VoidCallback onTap; + final bool isFeatured; + + const _FeatureCard({required this.title, required this.subtitle, required this.icon, required this.color, required this.theme, required this.onTap, this.isFeatured = false}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + decoration: BoxDecoration( + color: isFeatured ? color : theme.background, + borderRadius: BorderRadius.circular(25), + border: Border.all(color: isFeatured ? Colors.transparent : color.withOpacity(0.5), width: 2), + boxShadow: [BoxShadow(color: color.withOpacity(isFeatured ? 0.4 : 0.1), offset: const Offset(0, 8), blurRadius: 15)] + ), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + padding: const EdgeInsets.all(10), + decoration: BoxDecoration(color: isFeatured ? Colors.white.withOpacity(0.2) : color.withOpacity(0.1), shape: BoxShape.circle), + child: Icon(icon, color: isFeatured ? Colors.white : color, size: 32), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: TextStyle(color: isFeatured ? Colors.white : theme.text, fontSize: 20, fontWeight: FontWeight.w900)), + Text(subtitle, style: TextStyle(color: isFeatured ? Colors.white.withOpacity(0.8) : theme.text.withOpacity(0.5), fontSize: 12, fontWeight: FontWeight.bold)), + ], + ) + ], + ), + ), + ), + ); + } +} + +class _MiniCard extends StatelessWidget { + final String title; + final IconData icon; + final Color color; + final ThemeColors theme; + final VoidCallback onTap; + + const _MiniCard({required this.title, required this.icon, required this.color, required this.theme, required this.onTap}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + decoration: BoxDecoration( + color: theme.background, + borderRadius: BorderRadius.circular(20), + border: Border.all(color: color.withOpacity(0.5), width: 1.5), + boxShadow: [BoxShadow(color: color.withOpacity(0.1), blurRadius: 10, offset: const Offset(0, 5))] + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(icon, color: color, size: 24), + const SizedBox(width: 8), + Text(title, style: TextStyle(color: theme.text, fontWeight: FontWeight.bold, fontSize: 14)), + ], + ), + ), + ); + } +} + +class _AnimatedCyberBorder extends StatefulWidget { + final Widget child; + const _AnimatedCyberBorder({required this.child}); + @override + State<_AnimatedCyberBorder> createState() => _AnimatedCyberBorderState(); +} + +class _AnimatedCyberBorderState extends State<_AnimatedCyberBorder> with SingleTickerProviderStateMixin { + late AnimationController _controller; + @override + void initState() { super.initState(); _controller = AnimationController(vsync: this, duration: const Duration(seconds: 3))..repeat(); } + @override + void dispose() { _controller.dispose(); super.dispose(); } + @override + Widget build(BuildContext context) { + final theme = context.watch().currentColors; + return AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return CustomPaint( + painter: _CyberBorderPainter(animationValue: _controller.value, color1: theme.playerBlue, color2: theme.playerRed), + child: Container( + decoration: BoxDecoration(color: theme.background.withOpacity(0.9), borderRadius: BorderRadius.circular(25), boxShadow: [BoxShadow(color: theme.playerBlue.withOpacity(0.3), blurRadius: 25, spreadRadius: 2)]), + padding: const EdgeInsets.all(3), + child: widget.child, + ), + ); + }, + child: widget.child, + ); + } +} + +class _CyberBorderPainter extends CustomPainter { + final double animationValue; + final Color color1; + final Color color2; + + _CyberBorderPainter({required this.animationValue, required this.color1, required this.color2}); + + @override + void paint(Canvas canvas, Size size) { + final rect = Offset.zero & size; + final RRect rrect = RRect.fromRectAndRadius(rect, const Radius.circular(25)); + final Paint paint = Paint() + ..shader = SweepGradient(colors: [color1, color2, color1, color2, color1], stops: const [0.0, 0.25, 0.5, 0.75, 1.0], transform: GradientRotation(animationValue * 2 * math.pi)).createShader(rect) + ..style = PaintingStyle.stroke + ..strokeWidth = 4.0 + ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 4); + canvas.drawRRect(rrect, paint); + } + + @override + bool shouldRepaint(covariant _CyberBorderPainter oldDelegate) => oldDelegate.animationValue != animationValue; +} +// =========================================================================== +// FILE: lib/ui/multiplayer/lobby_screen.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; +import '../../core/theme_manager.dart'; +import '../../models/game_board.dart'; // <-- IMPORTANTE +import '../../services/multiplayer_service.dart'; +import '../../services/storage_service.dart'; +import '../game/game_screen.dart'; +import '../../logic/game_controller.dart'; + +class LobbyScreen extends StatefulWidget { + final String? initialRoomCode; + final int selectedRadius; + final ArenaShape selectedShape; // <-- RICEVIAMO LA FORMA + + const LobbyScreen({super.key, this.initialRoomCode, this.selectedRadius = 2, this.selectedShape = ArenaShape.classic}); + + @override + State createState() => _LobbyScreenState(); +} + +class _LobbyScreenState extends State { + final MultiplayerService _multiplayerService = MultiplayerService(); + late TextEditingController _codeController; + + bool _isLoading = false; + String? _myRoomCode; + String _playerName = ''; + + @override + void initState() { + super.initState(); + _codeController = TextEditingController(); + _playerName = StorageService.instance.playerName; + + if (widget.initialRoomCode != null && widget.initialRoomCode!.isNotEmpty) { + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { _codeController.text = widget.initialRoomCode!; }); + }); + } + } + + @override + void dispose() { _codeController.dispose(); super.dispose(); } + + Future _createRoom() async { + if (_isLoading) return; + setState(() => _isLoading = true); + + try { + int radius = widget.selectedRadius; + // PASSIAMO ANCHE IL NOME DELLA FORMA! + String code = await _multiplayerService.createGameRoom(radius, _playerName, widget.selectedShape.name); + + if (!mounted) return; + setState(() { _myRoomCode = code; _isLoading = false; }); + + _multiplayerService.shareInviteLink(code); + _showWaitingDialog(code); + } catch (e) { + if (mounted) { setState(() => _isLoading = false); _showError("Errore durante la creazione della partita."); } + } + } + + Future _joinRoom() async { + if (_isLoading) return; + FocusScope.of(context).unfocus(); + + String code = _codeController.text.trim().toUpperCase(); + if (code.isEmpty || code.length != 5) { _showError("Inserisci un codice valido di 5 caratteri."); return; } + + setState(() => _isLoading = true); + + try { + Map? roomData = await _multiplayerService.joinGameRoom(code, _playerName); + + if (!mounted) return; + setState(() => _isLoading = false); + + if (roomData != null) { + ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("Stanza trovata! Partita in avvio..."), backgroundColor: Colors.green)); + + int hostRadius = roomData['radius'] ?? 2; + + // LEGGIAMO LA FORMA DELL'HOST + String shapeStr = roomData['shape'] ?? 'classic'; + ArenaShape hostShape = ArenaShape.values.firstWhere((e) => e.name == shapeStr, orElse: () => ArenaShape.classic); + + context.read().startNewGame(hostRadius, isOnline: true, roomCode: code, isHost: false, shape: hostShape); + Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => const GameScreen())); + } else { + _showError("Stanza non trovata, piena o partita già iniziata."); + } + } catch (e) { + if (mounted) { setState(() => _isLoading = false); _showError("Errore di connessione: $e"); } + } + } + + void _showError(String message) { ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(message, style: const TextStyle(color: Colors.white)), backgroundColor: Colors.red)); } + + void _showWaitingDialog(String code) { + showDialog( + context: context, + barrierDismissible: false, + builder: (context) { + final theme = context.watch().currentColors; + + return StreamBuilder( + stream: _multiplayerService.listenToRoom(code), + builder: (context, snapshot) { + if (snapshot.hasData && snapshot.data!.exists) { + var data = snapshot.data!.data() as Map; + if (data['status'] == 'playing') { + WidgetsBinding.instance.addPostFrameCallback((_) { + Navigator.pop(context); + int radius = widget.selectedRadius; + // AVVIAMO IL GIOCO CON LA FORMA SCELTA DALL'HOST! + context.read().startNewGame(radius, isOnline: true, roomCode: code, isHost: true, shape: widget.selectedShape); + Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => const GameScreen())); + }); + } + } + + return AlertDialog( + backgroundColor: theme.background, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), + title: Text("In attesa...", textAlign: TextAlign.center, style: TextStyle(color: theme.text, fontWeight: FontWeight.bold)), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const CircularProgressIndicator(), const SizedBox(height: 25), + Text("CODICE STANZA", style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: theme.text.withOpacity(0.6), letterSpacing: 2)), + Text(code, style: TextStyle(fontSize: 40, fontWeight: FontWeight.w900, color: theme.playerRed, letterSpacing: 8)), + const SizedBox(height: 20), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration(color: theme.text.withOpacity(0.05), borderRadius: BorderRadius.circular(15), border: Border.all(color: theme.playerBlue.withOpacity(0.3), width: 1.5)), + child: Column( + children: [ + Icon(Icons.auto_awesome, color: theme.playerBlue, size: 28), const SizedBox(height: 10), + Text("Condividi l'invito con un amico.", textAlign: TextAlign.center, style: TextStyle(color: theme.text, fontWeight: FontWeight.bold, fontSize: 14)), + const SizedBox(height: 5), + Text("Gli basterà copiare il messaggio e aprire l'app.", textAlign: TextAlign.center, style: TextStyle(color: theme.text.withOpacity(0.8), fontSize: 13, height: 1.4)), + ], + ), + ), + ], + ), + actionsAlignment: MainAxisAlignment.center, + actions: [ + TextButton( + onPressed: () { FirebaseFirestore.instance.collection('games').doc(code).delete(); Navigator.pop(context); }, + child: const Text("ANNULLA", style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold, fontSize: 16, letterSpacing: 1.5)), + ), + ], + ); + }, + ); + } + ); + } + + @override + Widget build(BuildContext context) { + final theme = context.watch().currentColors; + + return Scaffold( + backgroundColor: theme.background, + appBar: AppBar(title: Text("Multiplayer Online", style: TextStyle(color: theme.text, fontWeight: FontWeight.bold)), backgroundColor: Colors.transparent, elevation: 0, iconTheme: IconThemeData(color: theme.text)), + body: _isLoading ? Center(child: CircularProgressIndicator(color: theme.playerRed)) : Center( + child: SingleChildScrollView( + padding: const EdgeInsets.all(24.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Icon(Icons.wifi, size: 80, color: theme.playerBlue), const SizedBox(height: 10), + Text("Giocatore: $_playerName", textAlign: TextAlign.center, style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: theme.playerRed)), + const SizedBox(height: 40), + SizedBox(height: 60, child: ElevatedButton(style: ElevatedButton.styleFrom(backgroundColor: theme.playerRed, foregroundColor: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15))), onPressed: _createRoom, child: const Text("CREA PARTITA", style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, letterSpacing: 2)))), + const SizedBox(height: 40), + TextField( + controller: _codeController, textCapitalization: TextCapitalization.characters, textAlign: TextAlign.center, maxLength: 5, + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: theme.text, letterSpacing: 8), + decoration: InputDecoration(hintText: "CODICE", hintStyle: TextStyle(color: theme.text.withOpacity(0.3)), enabledBorder: OutlineInputBorder(borderSide: BorderSide(color: theme.text.withOpacity(0.3), width: 2), borderRadius: BorderRadius.circular(15)), focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: theme.playerBlue, width: 3), borderRadius: BorderRadius.circular(15))), + ), + const SizedBox(height: 16), + SizedBox(height: 60, child: ElevatedButton(style: ElevatedButton.styleFrom(backgroundColor: theme.playerBlue, foregroundColor: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15))), onPressed: _joinRoom, child: const Text("UNISCITI", style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, letterSpacing: 2)))), + ], + ), + ), + ), + ); + } +} +// =========================================================================== +// FILE: lib/ui/settings/settings_screen.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../core/theme_manager.dart'; +import '../../core/app_colors.dart'; + +class SettingsScreen extends StatelessWidget { + const SettingsScreen({super.key}); + + @override + Widget build(BuildContext context) { + final themeManager = context.watch(); + final theme = themeManager.currentColors; + + return Scaffold( + backgroundColor: theme.background, + appBar: AppBar( + title: Text("SELEZIONA TEMA", style: TextStyle(fontWeight: FontWeight.bold, color: theme.text)), + backgroundColor: Colors.transparent, + elevation: 0, + iconTheme: IconThemeData(color: theme.text), + ), + body: ListView( + padding: const EdgeInsets.all(20), + children: [ + _ThemeCard( + title: "Minimal", + subtitle: "Linee pulite, sfondo chiaro", + type: AppThemeType.minimal, + previewColors: AppColors.minimal, + ), + const SizedBox(height: 15), + _ThemeCard( + title: "Quaderno (Doodle)", + subtitle: "Sfondo a quadretti, tratto a penna", + type: AppThemeType.doodle, + previewColors: AppColors.doodle, + ), + const SizedBox(height: 15), + _ThemeCard( + title: "Cyberpunk", + subtitle: "Nero profondo, luci al neon", + type: AppThemeType.cyberpunk, + previewColors: AppColors.cyberpunk, + ), + const SizedBox(height: 15), + // --- NUOVA CARD TEMA LEGNO --- + _ThemeCard( + title: "Legno & Fiammiferi", + subtitle: "Tavolo di legno, linee come fiammiferi", + type: AppThemeType.wood, + previewColors: AppColors.wood, + ), + // ----------------------------- + ], + ), + ); + } +} + +class _ThemeCard extends StatelessWidget { + final String title; + final String subtitle; + final AppThemeType type; + final ThemeColors previewColors; + + const _ThemeCard({required this.title, required this.subtitle, required this.type, required this.previewColors}); + + @override + Widget build(BuildContext context) { + final themeManager = context.watch(); + bool isSelected = themeManager.currentThemeType == type; + + return GestureDetector( + onTap: () => themeManager.setTheme(type), + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: previewColors.background, + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: isSelected ? previewColors.playerBlue : previewColors.gridLine.withOpacity(0.5), + width: isSelected ? 4 : 2, + ), + boxShadow: isSelected ? [BoxShadow(color: previewColors.playerBlue.withOpacity(0.4), blurRadius: 10, spreadRadius: 2)] : [], + ), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: previewColors.text)), + Text(subtitle, style: TextStyle(fontSize: 14, color: previewColors.text.withOpacity(0.7))), + ], + ), + ), + Container(width: 20, height: 20, decoration: BoxDecoration(color: previewColors.playerRed, shape: BoxShape.circle)), + const SizedBox(width: 10), + Container(width: 20, height: 20, decoration: BoxDecoration(color: previewColors.playerBlue, shape: BoxShape.circle)), + ], + ), + ), + ); + } +} +// =========================================================================== +// FILE: lib/widgets/custom_button.dart +// =========================================================================== + + +// =========================================================================== +// FILE: lib/widgets/custom_settings_button.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import '../theme/app_colors.dart'; + +// Widget per i pulsanti di selezione della forma dell'arena +class NeonShapeButton extends StatelessWidget { + final IconData icon; + final String label; + final bool isSelected; + final VoidCallback onTap; + final ShapeBorder shape; // La forma geometrica del pulsante + + const NeonShapeButton({ + super.key, + required this.icon, + required this.label, + required this.isSelected, + required this.onTap, + this.shape = const RoundedRectangleBorder( // Forma di default + borderRadius: BorderRadius.all(Radius.circular(12.0))), + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: ShapeDecoration( + shape: shape, + color: isSelected + ? AppColors.neonGreen.withOpacity(0.2) // Sfondo luminoso se selezionato + : AppColors.surface.withOpacity(0.5), // Sfondo più scuro se non selezionato + shadows: isSelected + ? [ // Bagliore intenso se selezionato + BoxShadow( + color: AppColors.neonGreen.withOpacity(0.6), + blurRadius: 12.0, + spreadRadius: 2.0, + ), + ] + : [], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + icon, + color: isSelected ? AppColors.neonGreen : AppColors.textSecondary, + size: 28, + ), + const SizedBox(height: 4), + Text( + label, + style: TextStyle( + color: isSelected ? AppColors.textPrimary : AppColors.textSecondary, + fontSize: 12, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ], + ), + ), + ); + } +} + +// Widget per i pulsanti di selezione della taglia dell'arena +class NeonSizeButton extends StatelessWidget { + final String label; + final bool isSelected; + final VoidCallback onTap; + + const NeonSizeButton({ + super.key, + required this.label, + required this.isSelected, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, // Forma circolare + color: isSelected + ? AppColors.neonBlue.withOpacity(0.2) + : AppColors.surface.withOpacity(0.5), + border: Border.all( + color: isSelected ? AppColors.neonBlue : AppColors.surfaceLight, + width: 2.0, + ), + shadows: isSelected + ? [ + BoxShadow( + color: AppColors.neonBlue.withOpacity(0.6), + blurRadius: 10.0, + spreadRadius: 1.5, + ), + ] + : [], + ), + child: Center( + child: Text( + label, + style: TextStyle( + color: isSelected ? AppColors.textPrimary : AppColors.textSecondary, + fontSize: 16, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ), + ), + ); + } +} + +// Widget per l'interruttore della modalità tempo (Clessidra) +class NeonTimeSwitch extends StatelessWidget { + final bool isTimeMode; + final VoidCallback onTap; + + const NeonTimeSwitch({ + super.key, + required this.isTimeMode, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30.0), // Forma arrotondata per lo switch + color: isTimeMode + ? AppColors.neonGreen.withOpacity(0.2) + : AppColors.surface.withOpacity(0.5), + border: Border.all( + color: isTimeMode ? AppColors.neonGreen : AppColors.surfaceLight, + width: 2.0, + ), + shadows: isTimeMode + ? [ + BoxShadow( + color: AppColors.neonGreen.withOpacity(0.6), + blurRadius: 12.0, + spreadRadius: 2.0, + ), + ] + : [], + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.hourglass_empty, // Icona clessidra + color: isTimeMode ? AppColors.neonGreen : AppColors.textSecondary, + ), + const SizedBox(width: 8), + Text( + isTimeMode ? 'A TEMPO' : 'SENZA TEMPO', + style: TextStyle( + color: isTimeMode ? AppColors.textPrimary : AppColors.textSecondary, + fontWeight: isTimeMode ? FontWeight.bold : FontWeight.normal, + ), + ), + ], + ), + ), + ); + } +} +// =========================================================================== +// FILE: lib/widgets/game_over_dialog.dart +// =========================================================================== + +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../logic/game_controller.dart'; +import '../core/theme_manager.dart'; +import '../core/app_colors.dart'; + +class GameOverDialog extends StatelessWidget { + const GameOverDialog({super.key}); + + @override + Widget build(BuildContext context) { + final game = context.read(); + final themeManager = context.read(); + final theme = themeManager.currentColors; + final themeType = themeManager.currentThemeType; + + int red = game.board.scoreRed; + int blue = game.board.scoreBlue; + + bool playerBeatCPU = game.isVsCPU && red > blue; + + // --- LOGICA NOMI --- + String nameRed = "ROSSO"; + String nameBlue = themeType == AppThemeType.cyberpunk ? "VERDE" : "BLU"; + + if (game.isOnline) { + nameRed = game.onlineHostName.toUpperCase(); + nameBlue = game.onlineGuestName.toUpperCase(); + } else if (game.isVsCPU) { + nameRed = "TU"; + nameBlue = "CPU"; + } + + // --- DETERMINA IL VINCITORE --- + String winnerText = ""; + Color winnerColor = theme.text; + + if (red > blue) { + winnerText = "VINCE $nameRed!"; + winnerColor = theme.playerRed; + } else if (blue > red) { + winnerText = "VINCE $nameBlue!"; + winnerColor = theme.playerBlue; + } else { + winnerText = "PAREGGIO!"; + winnerColor = theme.text; + } + + return AlertDialog( + backgroundColor: theme.background, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + side: BorderSide(color: winnerColor.withOpacity(0.5), width: 2), + ), + title: Text("FINE PARTITA", textAlign: TextAlign.center, style: TextStyle(color: theme.text, fontWeight: FontWeight.bold, fontSize: 22)), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(winnerText, textAlign: TextAlign.center, style: TextStyle(fontSize: 26, fontWeight: FontWeight.w900, color: winnerColor)), + const SizedBox(height: 20), + Container( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + color: theme.text.withOpacity(0.05), + borderRadius: BorderRadius.circular(15), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text("$nameRed: $red", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: theme.playerRed)), + Text(" - ", style: TextStyle(fontSize: 18, color: theme.text)), + Text("$nameBlue: $blue", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: theme.playerBlue)), + ], + ), + ), + + if (game.isVsCPU) ...[ + const SizedBox(height: 15), + Text("Difficoltà CPU: Livello ${game.cpuLevel}", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: theme.text.withOpacity(0.7))), + ] + ], + ), + actionsPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 10), + actionsAlignment: MainAxisAlignment.center, + actions: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (playerBeatCPU) + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: winnerColor, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 15), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + elevation: 5, + ), + onPressed: () { + Navigator.pop(context); + game.increaseLevelAndRestart(); + }, + child: const Text("PROSSIMO LIVELLO ➔", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)), + ) + else if (game.isOnline) + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: winnerColor == theme.text ? theme.playerBlue : winnerColor, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 15), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + elevation: 5, + ), + onPressed: () { + Navigator.pop(context); + if (game.board.isGameOver) { + game.requestRematch(); + } + }, + child: const Text("RIGIOCA ONLINE", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, letterSpacing: 1.5)), + ) + else + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: winnerColor == theme.text ? theme.playerBlue : winnerColor, + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 15), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + elevation: 5, + ), + onPressed: () { + Navigator.pop(context); + game.startNewGame(game.board.radius, vsCPU: game.isVsCPU); + }, + child: const Text("RIGIOCA", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, letterSpacing: 2)), + ), + + const SizedBox(height: 12), + + OutlinedButton( + style: OutlinedButton.styleFrom( + foregroundColor: theme.text, + side: BorderSide(color: theme.text.withOpacity(0.3), width: 2), + padding: const EdgeInsets.symmetric(vertical: 15), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + ), + onPressed: () { + if (game.isOnline) { + game.disconnectOnlineGame(); + } + Navigator.pop(context); + Navigator.pop(context); + }, + child: Text("TORNA AL MENU", style: TextStyle(fontWeight: FontWeight.bold, color: theme.text, fontSize: 14, letterSpacing: 1.5)), + ), + ], + ) + ], + ); + } +} \ No newline at end of file