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/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +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 index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +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..620e46e --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '13.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..9ca67d9 --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,48 @@ +PODS: + - Flutter (1.0.0) + - Google-Mobile-Ads-SDK (11.13.0): + - GoogleUserMessagingPlatform (>= 1.1) + - google_mobile_ads (5.3.1): + - Flutter + - Google-Mobile-Ads-SDK (~> 11.13.0) + - webview_flutter_wkwebview + - GoogleUserMessagingPlatform (3.1.0) + - shared_preferences_foundation (0.0.1): + - Flutter + - FlutterMacOS + - webview_flutter_wkwebview (0.0.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - Flutter (from `Flutter`) + - google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`) + - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`) + +SPEC REPOS: + trunk: + - Google-Mobile-Ads-SDK + - GoogleUserMessagingPlatform + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + google_mobile_ads: + :path: ".symlinks/plugins/google_mobile_ads/ios" + shared_preferences_foundation: + :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + webview_flutter_wkwebview: + :path: ".symlinks/plugins/webview_flutter_wkwebview/darwin" + +SPEC CHECKSUMS: + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + Google-Mobile-Ads-SDK: 14f57f2dc33532a24db288897e26494640810407 + google_mobile_ads: fe0e2c1764ad95323dd0e3081d0bb2d58411f957 + GoogleUserMessagingPlatform: befe603da6501006420c206222acd449bba45a9c + shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6 + webview_flutter_wkwebview: 29eb20d43355b48fe7d07113835b9128f84e3af4 + +PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e + +COCOAPODS: 1.16.2 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 150ae6f..c0e5d54 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -7,10 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + 0A725DCED1CD98FFB2302DCE /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77DE2DA095E51846864B8323 /* Pods_RunnerTests.framework */; }; 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 */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 892AD903CF9CF6401853688E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C17158024398284F8AFFB89 /* 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 */; }; @@ -42,11 +44,15 @@ /* Begin PBXFileReference section */ 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 = ""; }; + 16622FECA3EBEF8EB65B3451 /* 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 = ""; }; 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 = ""; }; + 430C66C34C3442E77FF42FC9 /* 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 = ""; }; + 4C449A31118EAE166EA6F0E7 /* 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 = ""; }; 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 = ""; }; + 77DE2DA095E51846864B8323 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 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 = ""; }; @@ -55,6 +61,10 @@ 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 = ""; }; + 9C17158024398284F8AFFB89 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A7B396FC7090E1529EF1895D /* 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 = ""; }; + E3F4FE4B993EBC989F4C963F /* 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 = ""; }; + F2F92AAC40F014CF652C59C0 /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,6 +72,15 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 892AD903CF9CF6401853688E /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C6050980F0BFBC4078BF1FB9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0A725DCED1CD98FFB2302DCE /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -94,6 +113,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, + ED39DAD180D309D951343F67 /* Pods */, + C882BDE0FEF4272B17FD0811 /* Frameworks */, ); sourceTree = ""; }; @@ -121,6 +142,29 @@ path = Runner; sourceTree = ""; }; + C882BDE0FEF4272B17FD0811 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 9C17158024398284F8AFFB89 /* Pods_Runner.framework */, + 77DE2DA095E51846864B8323 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + ED39DAD180D309D951343F67 /* Pods */ = { + isa = PBXGroup; + children = ( + 4C449A31118EAE166EA6F0E7 /* Pods-Runner.debug.xcconfig */, + E3F4FE4B993EBC989F4C963F /* Pods-Runner.release.xcconfig */, + 16622FECA3EBEF8EB65B3451 /* Pods-Runner.profile.xcconfig */, + 430C66C34C3442E77FF42FC9 /* Pods-RunnerTests.debug.xcconfig */, + A7B396FC7090E1529EF1895D /* Pods-RunnerTests.release.xcconfig */, + F2F92AAC40F014CF652C59C0 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -128,8 +172,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + D9965B2772196F9BC76EC2E1 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, + C6050980F0BFBC4078BF1FB9 /* Frameworks */, ); buildRules = ( ); @@ -145,12 +191,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 520C38BB116D4F7C1080344A /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 60E1658554BB66F9045D2A2F /* [CP] Embed Pods Frameworks */, + 98993E38BEFD6F91AB8FA262 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -238,6 +287,45 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 520C38BB116D4F7C1080344A /* [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; + }; + 60E1658554BB66F9045D2A2F /* [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; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -253,6 +341,45 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + 98993E38BEFD6F91AB8FA262 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + D9965B2772196F9BC76EC2E1 /* [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 */ @@ -379,6 +506,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 430C66C34C3442E77FF42FC9 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -396,6 +524,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = A7B396FC7090E1529EF1895D /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -411,6 +540,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; + baseConfigurationReference = F2F92AAC40F014CF652C59C0 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/lib/models/game_rank_dto.dart b/lib/models/game_rank_dto.dart index e5cf990..9d6fd30 100644 --- a/lib/models/game_rank_dto.dart +++ b/lib/models/game_rank_dto.dart @@ -2,14 +2,20 @@ class GameRankDto { final String playerName; - final int primaryScore; // 스도쿠에서는 시간(초) + final int primaryScore; // 시간 (초) + final int? secondaryScore; // 점수 (저장된 값, 예: 0~4) - GameRankDto({required this.playerName, required this.primaryScore}); + GameRankDto({ + required this.playerName, + required this.primaryScore, + this.secondaryScore + }); factory GameRankDto.fromJson(Map json) { return GameRankDto( playerName: json['playerName'], primaryScore: (json['primaryScore'] as num).toInt(), + secondaryScore: (json['secondaryScore'] as num?)?.toInt(), ); } } \ No newline at end of file diff --git a/lib/models/sudoku_game_dto.dart b/lib/models/sudoku_game_dto.dart index a7d8720..d80725b 100644 --- a/lib/models/sudoku_game_dto.dart +++ b/lib/models/sudoku_game_dto.dart @@ -1,23 +1,23 @@ // lib/models/sudoku_game_dto.dart -// 🔽 [수정] PuzzleData.kt의 새 DTO (puzzleId -> blockSize) class SudokuGameDto { + final int puzzleId; // 👈 [추가] 서버에서 보낸 ID final String question; final String solution; - final int blockSize; // 예: 3 (3x3 블록) - - // 🔽 [추가] blockSize로부터 gridSize 계산 (예: 9) + final int blockSize; final int gridSize; SudokuGameDto({ + required this.puzzleId, // 👈 [추가] required this.question, required this.solution, required this.blockSize, - }) : gridSize = blockSize * blockSize; // 생성 시 gridSize 자동 계산 + }) : gridSize = blockSize * blockSize; factory SudokuGameDto.fromJson(Map json) { int bs = json['blockSize'] ?? 3; return SudokuGameDto( + puzzleId: json['puzzleId'], // 👈 [추가] 서버의 puzzleId 매핑 question: json['question'], solution: json['solution'], blockSize: bs, diff --git a/lib/models/unified_rank_dto.dart b/lib/models/unified_rank_dto.dart index 7405fe8..66b8088 100644 --- a/lib/models/unified_rank_dto.dart +++ b/lib/models/unified_rank_dto.dart @@ -1,6 +1,7 @@ // lib/models/unified_rank_dto.dart class UnifiedRankDto { + final String userId; // 👈 [추가] 앱-고유 ID final String gameType; final String? contextId; final String playerName; @@ -8,6 +9,7 @@ class UnifiedRankDto { final int? secondaryScore; UnifiedRankDto({ + required this.userId, // 👈 [추가] 생성자에 추가 required this.gameType, this.contextId, required this.playerName, @@ -18,6 +20,7 @@ class UnifiedRankDto { // Dart 객체를 JSON으로 변환 (서버 전송용) Map toJson() { return { + 'userId': userId, // 👈 [추가] 'gameType': gameType, 'contextId': contextId, 'playerName': playerName, diff --git a/lib/screens/game_screen.dart b/lib/screens/game_screen.dart index b930e70..e45663c 100644 --- a/lib/screens/game_screen.dart +++ b/lib/screens/game_screen.dart @@ -1,21 +1,31 @@ import 'dart:async'; +import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:sudoku_app/models/sudoku_game_dto.dart'; import 'package:sudoku_app/models/sudoku_theme.dart'; import 'package:sudoku_app/models/unified_rank_dto.dart'; import 'package:sudoku_app/services/puzzle_service.dart'; +import 'package:sudoku_app/services/identity_service.dart'; import 'package:sudoku_app/widgets/ad_banner_widget.dart'; import 'package:sudoku_app/widgets/number_pad.dart'; import 'package:sudoku_app/widgets/sudoku_board.dart'; +import 'package:sudoku_app/models/game_rank_dto.dart'; + +// 랭킹 팝업의 2단계 UI 상태를 관리하기 위한 enum +enum _RankSubmissionStep { enterName, submitting, showList } class GameScreen extends StatefulWidget { final SudokuGameDto gameData; final String themeName; + final String userId; + final String? userName; const GameScreen({ super.key, required this.gameData, required this.themeName, + required this.userId, + required this.userName, }); @override @@ -24,6 +34,7 @@ class GameScreen extends StatefulWidget { class _GameScreenState extends State { final PuzzleService _puzzleService = PuzzleService(); + final IdentityService _identityService = IdentityService(); late final int blockSize; late final int gridSize; @@ -41,6 +52,11 @@ class _GameScreenState extends State { Set incorrectCells = {}; bool isValidating = false; + _RankSubmissionStep _rankStep = _RankSubmissionStep.enterName; + List _rankingList = []; + String _submittedPlayerName = ""; + + // "A" -> 10 (파싱용) int _charToInt(String char) { if (char == '0') return 0; @@ -96,7 +112,6 @@ class _GameScreenState extends State { if (selectedNumberPad != null) { - // 오답 블로킹 if (incorrectCells.isNotEmpty && !incorrectCells.contains(index)) { ScaffoldMessenger.of(context).showSnackBar( const SnackBar( @@ -104,15 +119,13 @@ class _GameScreenState extends State { duration: Duration(seconds: 1), ), ); - return; // 입력 처리 중단 + return; } final int numberValue = selectedNumberPad!; puzzleCells[index] = numberValue; - // 정답과 비교 if (numberValue != solutionCells[index]) { - // 점수 차감 if (!incorrectCells.contains(index)) { if (score > 0) { score--; @@ -160,16 +173,38 @@ class _GameScreenState extends State { ); } + void _onRestartGameTapped() { + setState(() { + puzzleCells = originalCells.toList(); + incorrectCells.clear(); + selectedIndex = null; + selectedNumberPad = null; + score = 5; + + timer?.cancel(); + secondsElapsed = 0; + startTimer(); + }); + } + + void _onQuitGameTapped() { + Navigator.of(context).pop(); + } + + Future _validateGame() async { - // ... (기존과 동일) if (isValidating) return; setState(() { isValidating = true; }); + timer?.cancel(); String currentAnswer = puzzleCells.map(_intToChar).join(''); + try { final bool result = await _puzzleService.validateSolution( - widget.gameData.question, currentAnswer, blockSize, + widget.gameData.puzzleId, + currentAnswer, ); + if (result) { if(mounted) _showRankingDialog(); } else { @@ -194,36 +229,144 @@ class _GameScreenState extends State { } } + // 랭킹 등록 팝업 (2단계 UI) void _showRankingDialog() { - // ... (기존과 동일) - final nameController = TextEditingController(); + final nameController = TextEditingController(text: widget.userName); bool isSubmitting = false; + final bool hasExistingName = widget.userName != null; + + _rankStep = _RankSubmissionStep.enterName; + _rankingList = []; + _submittedPlayerName = ""; + String? dialogErrorMessage; // 👈 [신규] 팝업 내부 에러 메시지 + final String contextId = "SUDOKU_${gridSize}x${gridSize}_L${_difficultyLevel(widget.gameData.question)}"; + showDialog( context: context, barrierDismissible: false, builder: (ctx) { return StatefulBuilder( builder: (context, setDialogState) { - return AlertDialog( - title: const Text('🎉 성공! 기록을 남겨주세요.'), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text('($contextId)'), - Text('완료 시간: $secondsElapsed 초'), - const SizedBox(height: 20), - TextField( - controller: nameController, - decoration: const InputDecoration( - labelText: '이름 (10자 이내)', - border: OutlineInputBorder(), + + Widget closeButton = TextButton( + onPressed: () { + Navigator.of(ctx).pop(); + Navigator.of(context).pop(); + }, + child: const Text('닫기'), + ); + + Widget rankListWidget = Expanded( + child: _rankingList.isEmpty + ? const Center(child: Text("현재 랭킹이 없습니다.")) + : ListView.builder( + itemCount: _rankingList.length, + shrinkWrap: true, + itemBuilder: (context, index) { + final rank = _rankingList[index]; + final bool isMe = rank.playerName == _submittedPlayerName; + int displayScore = 5 - (rank.secondaryScore ?? 5); + + final min = (rank.primaryScore ~/ 60).toString().padLeft(2, '0'); + final sec = (rank.primaryScore % 60).toString().padLeft(2, '0'); + final time = '$min:$sec'; + + return ListTile( + selected: isMe, + selectedTileColor: Colors.blue.shade100, + leading: Text('${index + 1}.', style: const TextStyle(fontWeight: FontWeight.bold)), + title: Text(rank.playerName, style: TextStyle(fontWeight: isMe ? FontWeight.bold : FontWeight.normal)), + trailing: Text('$time (Score: $displayScore)', style: const TextStyle(fontWeight: FontWeight.bold, color: Colors.black87)), + ); + }, ), - maxLength: 10, + ); + + Widget nameEntryWidget = Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('완료 시간: $secondsElapsed 초 / 남은 점수: $score 점'), + const SizedBox(height: 20), + TextField( + controller: nameController, + readOnly: hasExistingName, + decoration: InputDecoration( + labelText: hasExistingName ? '등록된 이름' : '이름 (10자 이내)', + border: const OutlineInputBorder(), + // 🔽 [신규] 에러 메시지가 있으면 TextField에 에러 스타일 적용 + errorText: dialogErrorMessage, ), - ], - ), - actions: [ + maxLength: 10, + ), + ], + ); + + Widget submitButton = ElevatedButton( + onPressed: () async { + final playerName = nameController.text.trim(); + if (playerName.isEmpty) { + // SnackBar 대신 팝업 내부 에러로 변경 + setDialogState(() { + dialogErrorMessage = "이름을 입력해주세요."; + }); + return; + } + + setDialogState(() { + _rankStep = _RankSubmissionStep.submitting; + _submittedPlayerName = playerName; + dialogErrorMessage = null; // 👈 [신규] 에러 메시지 초기화 + }); + + final rankDto = UnifiedRankDto( + userId: widget.userId, + gameType: 'SUDOKU', + contextId: contextId, + playerName: playerName, + primaryScore: secondsElapsed, + secondaryScore: (5 - score), + ); + + try { + await _puzzleService.submitRank(rankDto); + + if (!hasExistingName) { + await _identityService.saveUserName(playerName); + } + + final ranks = await _puzzleService.fetchRanks('SUDOKU', contextId); + + setDialogState(() { + _rankingList = ranks; + _rankStep = _RankSubmissionStep.showList; + }); + + } catch (e) { + // 🔽 [수정] 랭킹 등록 실패 시 (이름 중복 등) + log("!!! 랭킹 등록 실패 !!!", error: e); + + setDialogState(() { + _rankStep = _RankSubmissionStep.enterName; // 1단계(이름 입력)로 복귀 + // 👈 [신규] 서버 에러 메시지를 팝업에 표시 + dialogErrorMessage = e.toString().replaceFirst("Exception: ", ""); + }); + // ❌ SnackBar 제거 + } + }, + child: const Text('랭킹 등록'), + ); + + Widget dialogContent; + if (_rankStep == _RankSubmissionStep.showList) { + dialogContent = rankListWidget; + } else { + dialogContent = nameEntryWidget; + } + + List dialogActions; + if (_rankStep == _RankSubmissionStep.enterName) { + dialogActions = [ TextButton( onPressed: () { Navigator.of(ctx).pop(); @@ -231,53 +374,31 @@ class _GameScreenState extends State { }, child: const Text('닫기'), ), - isSubmitting - ? const Padding( - padding: EdgeInsets.all(8.0), - child: CircularProgressIndicator(), - ) - : ElevatedButton( - onPressed: () async { - final playerName = nameController.text.trim(); - if (playerName.isEmpty) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('이름을 입력해주세요.')), - ); - return; - } - setDialogState(() { isSubmitting = true; }); - final rankDto = UnifiedRankDto( - gameType: 'SUDOKU', - contextId: contextId, - playerName: playerName, - primaryScore: secondsElapsed, - secondaryScore: null, - ); - try { - await _puzzleService.submitRank(rankDto); - if (!mounted) return; - Navigator.of(ctx).pop(); - Navigator.of(context).pop(); - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('랭킹이 등록되었습니다!')), - ); - } catch (e) { - setDialogState(() { isSubmitting = false; }); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text(e.toString())), - ); - } - }, - child: const Text('랭킹 등록'), - ), - ], + submitButton + ]; + } else if (_rankStep == _RankSubmissionStep.submitting) { + dialogActions = [const CircularProgressIndicator()]; + } else { + dialogActions = [closeButton]; + } + + return AlertDialog( + title: Text(_rankStep == _RankSubmissionStep.showList + ? '🏆 상위 10개 랭킹 ($contextId)' + : '🎉 성공! 기록을 남겨주세요.'), + content: SizedBox( + width: 400, + height: _rankStep == _RankSubmissionStep.showList ? 400 : null, + child: dialogContent, + ), + actions: dialogActions, ); }, ); }, ); } - + int _difficultyLevel(String question) { int holes = question.split('').where((c) => c == '0').length; double holeRatio = holes / (gridSize * gridSize); @@ -290,7 +411,6 @@ class _GameScreenState extends State { @override Widget build(BuildContext context) { - // 🔽 [수정] 타이머 텍스트를 AppBar로 이동시키기 위해 build 메서드 상단으로 이동 String formattedTime = '${(secondsElapsed ~/ 60).toString().padLeft(2, '0')}:${(secondsElapsed % 60).toString().padLeft(2, '0')}'; @@ -303,94 +423,107 @@ class _GameScreenState extends State { } return Scaffold( - appBar: AppBar( - title: const Text('Sudoku'), // 👈 [수정] 테마 이름 제거 - actions: [ - // 🔽 [수정] AppBar 우측에 타이머 추가 - Padding( - padding: const EdgeInsets.only(right: 20.0), - child: Center( - child: Text( - formattedTime, - style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + body: SafeArea( + child: Column( + children: [ + Expanded( + child: LayoutBuilder( + builder: (context, constraints) { + bool isLandscape = constraints.maxWidth > constraints.maxHeight; + if (isLandscape) { + return _buildLandscapeLayout(context, numberCounts, constraints, formattedTime); + } else { + return _buildPortraitLayout(context, numberCounts, constraints, formattedTime); + } + }, ), ), - ), - ], - ), - body: Column( - children: [ - // 1. 게임 콘텐츠 영역 - Expanded( - child: LayoutBuilder( - builder: (context, constraints) { - bool isLandscape = constraints.maxWidth > constraints.maxHeight; - if (isLandscape) { - return _buildLandscapeLayout(context, numberCounts); - } else { - return _buildPortraitLayout(context, numberCounts); - } - }, - ), - ), - - // 2. 광고 배너 - const AdBannerWidget(), - ], - ), - ); - } - - // 🔽 [수정] formattedTime 파라미터 제거 - Widget _buildPortraitLayout(BuildContext context, Map numberCounts) { - return Center( - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 600), - child: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - children: [ - _buildGameInfoWidget(), // 👈 [수정] 파라미터 제거 - const SizedBox(height: 15), - _buildSudokuBoardWidget(), - const SizedBox(height: 15), - _buildNumberPadWidget(context, numberCounts, isLandscape: false), - ], - ), - ), + const AdBannerWidget(), + ], ), ), ); } - // 🔽 [수정] formattedTime 파라미터 제거 - Widget _buildLandscapeLayout(BuildContext context, Map numberCounts) { - return Padding( - padding: const EdgeInsets.all(16.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Center( - child: AspectRatio( - aspectRatio: 1.0, - child: _buildSudokuBoardWidget(), + Widget _buildPortraitLayout(BuildContext context, Map numberCounts, BoxConstraints constraints, String formattedTime) { + final double boardWidth = (constraints.maxWidth > 600) ? 600 : constraints.maxWidth; + + return Center( + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: boardWidth), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0), + child: _buildGameInfoWidget(formattedTime), + ), + Expanded( + child: Center( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _buildSudokuBoardWidget(), + const SizedBox(height: 15), + _buildNumberPadWidget(context, numberCounts, isLandscape: false, boardWidth: boardWidth), + ], + ), + ), + ), ), ), - ), - const SizedBox(width: 16), + ], + ), + ), + ); + } + + Widget _buildLandscapeLayout(BuildContext context, Map numberCounts, BoxConstraints constraints, String formattedTime) { + + const double infoBarHeight = 60.0; + double boardWidth = constraints.maxHeight - infoBarHeight - 32.0; + + const double numberPadScaleRatio = 0.6; + double padWidth = boardWidth * numberPadScaleRatio; + + if (padWidth < 200) padWidth = 200; + if (padWidth > 350) padWidth = 350; + + double totalWidth = boardWidth + (padWidth + 100) + 16.0; + if (totalWidth > (constraints.maxWidth - 32.0)) { + double scale = (constraints.maxWidth - 32.0) / totalWidth; + boardWidth *= scale; + padWidth *= scale; + } + + return Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + _buildGameInfoWidget(formattedTime), Expanded( - flex: 4, - child: SingleChildScrollView( - child: Column( - children: [ - _buildGameInfoWidget(), // 👈 [수정] 파라미터 제거 - const SizedBox(height: 20), - _buildNumberPadWidget(context, numberCounts, isLandscape: true), - ], - ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: boardWidth, + child: _buildSudokuBoardWidget(), + ), + const SizedBox(width: 16), + SizedBox( + width: padWidth + 100, + child: SingleChildScrollView( + child: Column( + children: [ + _buildNumberPadWidget(context, numberCounts, isLandscape: true, boardWidth: boardWidth), + ], + ), + ), + ), + ], ), ), ], @@ -398,16 +531,13 @@ class _GameScreenState extends State { ); } - // 🔽 [수정] 상단 정보 (점수, 힌트, 되돌리기) - 타이머 제거 - Widget _buildGameInfoWidget() { + Widget _buildGameInfoWidget(String formattedTime) { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - // 1. 점수 Text('SCORE: $score', style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), - - // 2. 버튼 그룹 (힌트, 되돌리기) + Text(formattedTime, style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), Row( mainAxisSize: MainAxisSize.min, children: [ @@ -427,7 +557,6 @@ class _GameScreenState extends State { ); } - // 게임 보드 (변경 없음) Widget _buildSudokuBoardWidget() { return SudokuBoard( blockSize: blockSize, @@ -441,24 +570,62 @@ class _GameScreenState extends State { ); } - // 숫자 패드 (변경 없음) - Widget _buildNumberPadWidget(BuildContext context, Map numberCounts, {required bool isLandscape}) { - double? maxWidth = !isLandscape - ? 600 * 0.6 - : null; + Widget _buildNumberPadWidget(BuildContext context, Map numberCounts, {required bool isLandscape, required double boardWidth}) { + const double numberPadScaleRatio = 0.6; + double? padMaxWidth; + + if (!isLandscape) { + padMaxWidth = boardWidth * numberPadScaleRatio; + } else { + padMaxWidth = null; + } - return Center( - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity), - child: NumberPad( - blockSize: blockSize, - theme: activeTheme, - numberCounts: numberCounts, - selectedNumber: selectedNumberPad, - onNumberTapped: onNumberTapped, - isLandscape: isLandscape, - ), + Widget numberPadGrid = ConstrainedBox( + constraints: BoxConstraints(maxWidth: padMaxWidth ?? double.infinity), + child: NumberPad( + blockSize: blockSize, + theme: activeTheme, + numberCounts: numberCounts, + selectedNumber: selectedNumberPad, + onNumberTapped: onNumberTapped, + isLandscape: isLandscape, ), ); + + Widget quitButton = IconButton( + icon: Icon(Icons.close, color: Colors.red.shade700, size: 30), + onPressed: _onQuitGameTapped, + tooltip: "게임 종료", + ); + + Widget restartButton = IconButton( + icon: Icon(Icons.refresh, color: Colors.blue.shade700, size: 30), + onPressed: _onRestartGameTapped, + tooltip: "다시하기", + ); + + if (isLandscape) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + numberPadGrid, + const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [quitButton, restartButton], + ) + ], + ); + } else { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + quitButton, + Expanded(child: numberPadGrid), + restartButton, + ], + ); + } } } \ No newline at end of file diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 787c2a3..3c4af6a 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -4,6 +4,7 @@ import 'package:sudoku_app/models/sudoku_theme.dart'; import 'package:sudoku_app/screens/game_screen.dart'; import 'package:sudoku_app/screens/ranking_screen.dart'; import 'package:sudoku_app/services/puzzle_service.dart'; +import 'package:sudoku_app/services/identity_service.dart'; // 👈 ID 서비스 임포트 import 'package:sudoku_app/widgets/ad_banner_widget.dart'; class HomeScreen extends StatefulWidget { @@ -14,38 +15,39 @@ class HomeScreen extends StatefulWidget { } class _HomeScreenState extends State { - // 난이도 - double _difficultyLevel = 2.0; - final List levelLabels = ["Easy", "Normal", "Medium", "Hard", "Expert"]; + // 8단계 난이도 + double _difficultyLevel = 4.0; // 1.0 ~ 8.0 (기본값 Level 4: 중급 9x9) + final List levelLabels = [ + "입문 (4x4)", "초급 (4x4)", + "쉬움 (9x9)", "중급 (9x9)", "어려움 (9x9)", + "전문가 (16x16)", "마스터 (16x16)", "지옥 (16x16)" + ]; - // 그리드 크기 - double _blockSize = 3.0; - // 🔽 [수정] 16x16, 25x25 옵션 제거 - final List sizeLabels = ["4x4", "9x9"]; - - // 테마 이름 late String _selectedThemeName; - bool isLoading = false; final PuzzleService _puzzleService = PuzzleService(); + final IdentityService _identityService = IdentityService(); // 👈 ID 서비스 초기화 @override void initState() { super.initState(); - // 기본 테마를 '랜덤' 이름으로 설정 - _selectedThemeName = AppThemes.random; + _selectedThemeName = AppThemes.random; // 기본 테마 '랜덤' } Future _startGame() async { setState(() { isLoading = true; }); try { - final String level = _difficultyLevel.round().toString(); - final String blockSize = _blockSize.round().toString(); + // 1. 난이도 값(String) 전달 + final String difficulty = _difficultyLevel.round().toString(); - final SudokuGameDto gameData = await _puzzleService.startGame(level, blockSize); + // 2. 서버에서 게임 데이터 가져오기 + final SudokuGameDto gameData = await _puzzleService.startGame(difficulty); + + // 3. 로컬에서 앱-고유 ID와 저장된 이름 가져오기 + final String userId = await _identityService.getOrCreateUserId(); + final String? userName = await _identityService.getSavedUserName(); - // 선택된 '테마 이름(String)'을 그대로 전달 if (mounted) { Navigator.push( context, @@ -53,6 +55,8 @@ class _HomeScreenState extends State { builder: (context) => GameScreen( gameData: gameData, themeName: _selectedThemeName, + userId: userId, // 👈 ID 전달 + userName: userName, // 👈 이름 전달 ), ), ); @@ -76,6 +80,7 @@ class _HomeScreenState extends State { appBar: AppBar(title: const Text('스도쿠 게임')), body: LayoutBuilder( // 비율 기반 레이아웃 builder: (context, constraints) { + // 너비/높이 비율 변수 (0.6 = 너비가 높이의 60%를 넘지 않도록 함) const double maxContentRatio = 0.6; final double constrainedWidth = constraints.maxHeight * maxContentRatio; @@ -91,36 +96,22 @@ class _HomeScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - // 1. 난이도 선택 + // 1. 난이도 선택 (8단계) const Text("난이도", style: TextStyle(fontSize: 18)), + Text( + levelLabels[_difficultyLevel.round() - 1], + style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.blue), + ), Slider( value: _difficultyLevel, - min: 1.0, max: 5.0, divisions: 4, + min: 1.0, max: 8.0, divisions: 7, // 8단계 label: levelLabels[_difficultyLevel.round() - 1], onChanged: (newValue) => setState(() { _difficultyLevel = newValue; }), ), const SizedBox(height: 20), - // 2. 그리드 크기 선택 - const Text("그리드 크기", style: TextStyle(fontSize: 18)), - Text( - // 🔽 [수정] 인덱스 매핑 변경 (2.0 -> index 0) - sizeLabels[_blockSize.round() - 2], - style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.deepOrange), - ), - Slider( - value: _blockSize, - // 🔽 [수정] 최대값을 3.0으로, divisions를 1로 변경 - min: 2.0, max: 3.0, divisions: 1, - label: sizeLabels[_blockSize.round() - 2], - activeColor: Colors.deepOrange, - onChanged: (newValue) => setState(() { _blockSize = newValue; }), - ), - - const SizedBox(height: 20), - - // 3. 테마 선택 (String 기반) + // 2. 테마 선택 (String 기반) const Text("테마", style: TextStyle(fontSize: 18)), DropdownButton( value: _selectedThemeName, @@ -150,11 +141,19 @@ class _HomeScreenState extends State { const SizedBox(height: 10), + // "랭킹 보기" 버튼 TextButton( onPressed: () { + // 현재 슬라이더의 난이도 이름(String)을 가져옴 + final String currentDifficultyName = levelLabels[_difficultyLevel.round() - 1]; + Navigator.push( context, - MaterialPageRoute(builder: (context) => const RankingScreen()), + MaterialPageRoute( + builder: (context) => RankingScreen( + initialDifficultyName: currentDifficultyName, + ), + ), ); }, child: const Text('랭킹 보기'), diff --git a/lib/screens/ranking_screen.dart b/lib/screens/ranking_screen.dart index a7216a6..21a0141 100644 --- a/lib/screens/ranking_screen.dart +++ b/lib/screens/ranking_screen.dart @@ -3,7 +3,13 @@ import 'package:sudoku_app/models/game_rank_dto.dart'; import 'package:sudoku_app/services/puzzle_service.dart'; class RankingScreen extends StatefulWidget { - const RankingScreen({super.key}); + // 🔽 [추가] 홈 화면에서 전달받을 초기 난이도 이름 + final String? initialDifficultyName; + + const RankingScreen({ + super.key, + this.initialDifficultyName, // 👈 생성자에 추가 + }); @override State createState() => _RankingScreenState(); @@ -11,67 +17,129 @@ class RankingScreen extends StatefulWidget { class _RankingScreenState extends State { final PuzzleService _puzzleService = PuzzleService(); - // FutureBuilder를 사용하여 비동기 데이터를 쉽게 처리 late Future> _rankingFuture; + // 8단계 난이도에 맞는 Context ID 맵 + final Map difficultyContexts = { + "입문 (4x4)": "SUDOKU_4x4_L1", + "초급 (4x4)": "SUDOKU_4x4_L2", + "쉬움 (9x9)": "SUDOKU_9x9_L3", + "중급 (9x9)": "SUDOKU_9x9_L4", + "어려움 (9x9)": "SUDOKU_9x9_L5", + "전문가 (16x16)": "SUDOKU_16x16_L6", + "마스터 (16x16)": "SUDOKU_16x16_L7", + "지옥 (16x16)": "SUDOKU_16x16_L8", + }; + late String _selectedDifficulty; + @override void initState() { super.initState(); - // 화면이 로드될 때 스도쿠의 전체 랭킹을 가져옴 (contextId = null) - _rankingFuture = _puzzleService.fetchRanks('SUDOKU', null); + // 🔽 [수정] + // 1. HomeScreen에서 전달받은 값이 있는지 확인 + String defaultDifficulty = widget.initialDifficultyName ?? "중급 (9x9)"; + + // 2. (안전장치) 전달받은 값이 맵에 없으면(예: 향후 변경) 기본값 사용 + if (!difficultyContexts.containsKey(defaultDifficulty)) { + defaultDifficulty = "중급 (9x9)"; + } + + // 3. 랭킹 조회 + _fetchRanksForDifficulty(defaultDifficulty); } - // 점수(초)를 'mm:ss' 형식으로 변환 - String _formatScore(int seconds) { + void _fetchRanksForDifficulty(String difficultyName) { + setState(() { + _selectedDifficulty = difficultyName; + _rankingFuture = _puzzleService.fetchRanks('SUDOKU', difficultyContexts[_selectedDifficulty]); + }); + } + + // 시간(초)을 'mm:ss' 형식으로 변환 + String _formatTime(int seconds) { final min = (seconds ~/ 60).toString().padLeft(2, '0'); final sec = (seconds % 60).toString().padLeft(2, '0'); return '$min:$sec'; } + // (5 - score)로 저장된 값을 -> "SCORE: 5"로 변환 + String _formatScore(int? storedScore) { + int score = 5 - (storedScore ?? 5); + return 'SCORE: $score'; + } + @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: const Text('스도쿠 전체 랭킹')), - body: FutureBuilder>( - future: _rankingFuture, - builder: (context, snapshot) { - // 로딩 중일 때 - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); - } - // 에러 발생 시 - if (snapshot.hasError) { - return Center(child: Text('랭킹 로딩 실패: ${snapshot.error}')); - } - // 데이터가 없거나 비어있을 때 - if (!snapshot.hasData || snapshot.data!.isEmpty) { - return const Center(child: Text('등록된 랭킹이 없습니다.')); - } + appBar: AppBar(title: const Text('스도쿠 랭킹')), + body: Column( + children: [ + // 1. 난이도 선택 Dropdown + Padding( + padding: const EdgeInsets.all(16.0), + child: DropdownButton( + value: _selectedDifficulty, // 👈 initState에서 설정된 값으로 시작 + isExpanded: true, + items: difficultyContexts.keys.map((String difficultyName) { + return DropdownMenuItem( + value: difficultyName, + child: Text(difficultyName), + ); + }).toList(), + onChanged: (String? newValue) { + if (newValue != null) { + _fetchRanksForDifficulty(newValue); + } + }, + ), + ), + // 2. 랭킹 리스트 + Expanded( + child: FutureBuilder>( + future: _rankingFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + if (snapshot.hasError) { + return Center(child: Text('랭킹 로딩 실패: ${snapshot.error}')); + } + if (!snapshot.hasData || snapshot.data!.isEmpty) { + return const Center(child: Text('등록된 랭킹이 없습니다.')); + } - // 성공적으로 데이터를 가져왔을 때 - final ranks = snapshot.data!; - return ListView.builder( - itemCount: ranks.length, - itemBuilder: (context, index) { - final rank = ranks[index]; - return ListTile( - leading: Text( - '${index + 1}.', - style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), - ), - title: Text(rank.playerName, style: const TextStyle(fontSize: 18)), - trailing: Text( - _formatScore(rank.primaryScore), // 시간(초)을 mm:ss로 표시 - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - color: Colors.blue, - ), - ), - ); - }, - ); - }, + final ranks = snapshot.data!; + return ListView.builder( + itemCount: ranks.length, + itemBuilder: (context, index) { + final rank = ranks[index]; + return ListTile( + leading: Text( + '${index + 1}.', + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + ), + title: Text(rank.playerName, style: const TextStyle(fontSize: 18)), + trailing: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + _formatTime(rank.primaryScore), + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.blue), + ), + Text( + _formatScore(rank.secondaryScore), + style: const TextStyle(fontSize: 12, color: Colors.grey), + ), + ], + ), + ); + }, + ); + }, + ), + ), + ], ), ); } diff --git a/lib/services/identity_service.dart b/lib/services/identity_service.dart new file mode 100644 index 0000000..31284a3 --- /dev/null +++ b/lib/services/identity_service.dart @@ -0,0 +1,35 @@ +// lib/services/identity_service.dart + +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:uuid/uuid.dart'; + +// 앱-고유 ID와 사용자 이름을 관리하는 서비스 +class IdentityService { + static const String _userIdKey = 'app_user_id'; + static const String _userNameKey = 'app_user_name'; + + // 1. 앱-고유 ID 가져오기 (없으면 생성) + Future getOrCreateUserId() async { + final prefs = await SharedPreferences.getInstance(); + String? userId = prefs.getString(_userIdKey); + + if (userId == null) { + // ID가 없으면 V4 UUID 생성 + userId = const Uuid().v4(); + await prefs.setString(_userIdKey, userId); + } + return userId; + } + + // 2. 랭킹에 등록한 사용자 이름 가져오기 + Future getSavedUserName() async { + final prefs = await SharedPreferences.getInstance(); + return prefs.getString(_userNameKey); + } + + // 3. 랭킹 등록 성공 시, 사용자 이름 저장하기 + Future saveUserName(String name) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.setString(_userNameKey, name); + } +} \ No newline at end of file diff --git a/lib/services/puzzle_service.dart b/lib/services/puzzle_service.dart index 91e3210..ab50a02 100644 --- a/lib/services/puzzle_service.dart +++ b/lib/services/puzzle_service.dart @@ -1,19 +1,18 @@ import 'dart:convert'; -import 'dart:developer'; +import 'dart:developer'; // 👈 [추가] log 함수를 위한 임포트 import 'package:http/http.dart' as http; import 'package:sudoku_app/models/sudoku_game_dto.dart'; import 'package:sudoku_app/models/unified_rank_dto.dart'; import 'package:sudoku_app/models/game_rank_dto.dart'; class PuzzleService { - final String _baseUrl = "https://lunaticbum.kr"; // 👈 HTTPS 확인 + final String _baseUrl = "https://lunaticbum.kr"; - // 🔽 [수정] 'blockSize' 파라미터 추가 - Future startGame(String level, String blockSize) async { + // ... (startGame 함수는 동일) ... + Future startGame(String difficulty) async { final response = await http.get( - Uri.parse('$_baseUrl/puzzle/sudoku/start?level=$level&blockSizeStr=$blockSize'), + Uri.parse('$_baseUrl/puzzle/sudoku/start?difficulty=$difficulty'), ); - if (response.statusCode == 200) { final data = jsonDecode(utf8.decode(response.bodyBytes)); return SudokuGameDto.fromJson(data); @@ -22,18 +21,16 @@ class PuzzleService { } } - // 🔽 [수정] puzzleId 대신 question, answer, blockSize를 전송 - Future validateSolution(String question, String answer, int blockSize) async { + // ... (validateSolution 함수는 동일) ... + Future validateSolution(int puzzleId, String answer) async { final response = await http.post( Uri.parse('$_baseUrl/puzzle/sudoku/validate'), headers: {'Content-Type': 'application/json'}, body: jsonEncode({ - 'question': question, // 👈 [수정] + 'puzzleId': puzzleId, 'answer': answer, - 'blockSize': blockSize, // 👈 [수정] }), ); - if (response.statusCode == 200) { return jsonDecode(response.body)['correct'] ?? false; } else { @@ -43,43 +40,51 @@ class PuzzleService { } } - // POST /api/ranks/submit Future submitRank(UnifiedRankDto rankDto) async { + + final requestBody = jsonEncode(rankDto.toJson()); + + // 🔽 [로그 추가] 1. 서버로 전송하는 JSON 데이터 출력 + log(">>> 랭킹 등록 요청: $requestBody"); + final response = await http.post( Uri.parse('$_baseUrl/api/ranks/submit'), headers: {'Content-Type': 'application/json'}, - body: jsonEncode(rankDto.toJson()), + body: requestBody, ); if (response.statusCode != 200) { + // 🔽 [로그 추가] 2. 서버가 200(OK)이 아닌 응답을 줬을 때 + log("<<< 랭킹 등록 실패: ${response.statusCode}"); try { final errorBody = utf8.decode(response.bodyBytes); + log("<<< 서버 에러 메시지: $errorBody"); // 👈 (예: "이미 사용 중인 이름입니다.") throw Exception(errorBody); } catch (e) { throw Exception('랭킹 등록 실패: ${response.reasonPhrase}'); } } + + // 🔽 [로그 추가] 3. 성공 시 + log("<<< 랭킹 등록 성공: 200 OK"); } + // ... (fetchRanks 함수는 동일) ... Future> fetchRanks(String gameType, String? contextId) async { final queryParams = { 'gameType': gameType, if (contextId != null) 'contextId': contextId, }; - // 쿼리 파라미터를 포함하여 URI 생성 final uri = Uri.parse('$_baseUrl/api/ranks/list').replace(queryParameters: queryParams); final response = await http.get(uri); if (response.statusCode == 200) { - // 서버에서 [ ... ] 형태의 JSON 배열을 받음 final List data = jsonDecode(utf8.decode(response.bodyBytes)); - // 각 JSON 객체를 GameRankDto로 변환 return data.map((json) => GameRankDto.fromJson(json)).toList(); } else { throw Exception('랭킹 로딩 실패'); } } - } \ No newline at end of file diff --git a/lib/widgets/sudoku_board.dart b/lib/widgets/sudoku_board.dart index 9f7bc18..4ceac48 100644 --- a/lib/widgets/sudoku_board.dart +++ b/lib/widgets/sudoku_board.dart @@ -1,20 +1,20 @@ import 'package:flutter/material.dart'; -import 'package:sudoku_app/models/sudoku_theme.dart'; // 👈 [추가] +import 'package:sudoku_app/models/sudoku_theme.dart'; // 👈 테마 모델 임포트 class SudokuBoard extends StatelessWidget { final int blockSize; - final SudokuTheme theme; // 👈 [추가] - final List cells; // 👈 [수정] List -> List - final List originalCells; // 👈 [수정] List -> List + final SudokuTheme theme; // 👈 이번 게임의 테마 + final List cells; // 👈 List (0, 1, 10...) + final List originalCells; // 👈 List (0, 1, 10...) final int? selectedIndex; - final int? selectedNumberPad; + final int? selectedNumberPad; // 10진수 숫자 (1, 10...) final Set incorrectCells; final Function(int) onCellTapped; const SudokuBoard({ super.key, required this.blockSize, - required this.theme, // 👈 [추가] + required this.theme, required this.cells, required this.originalCells, required this.selectedIndex, @@ -26,6 +26,7 @@ class SudokuBoard extends StatelessWidget { @override Widget build(BuildContext context) { final int gridSize = blockSize * blockSize; + // 그리드 크기에 따라 폰트 크기 동적 조절 final double fontSize = (gridSize > 9) ? (gridSize > 16 ? 12 : 16) : 24; return AspectRatio( @@ -40,16 +41,18 @@ class SudokuBoard extends StatelessWidget { int row = index ~/ gridSize; int col = index % gridSize; - int cellValue = cells[index]; // 👈 [수정] 0, 1, 10... - bool isEditable = (originalCells[index] == 0); // 👈 [수정] "0" -> 0 + int cellValue = cells[index]; // 0, 1, 10... + bool isEditable = (originalCells[index] == 0); bool isSelected = (index == selectedIndex); - bool isHighlighted = (cellValue != 0 && // 👈 [수정] + // int == int 비교 + bool isHighlighted = (cellValue != 0 && selectedNumberPad != null && - cellValue == selectedNumberPad); // 👈 [수정] int == int 비교 + cellValue == selectedNumberPad); bool isIncorrect = incorrectCells.contains(index); + // blockSize에 따른 동적 보더 BorderSide thickBorder = const BorderSide(color: Colors.black, width: 2.0); BorderSide thinBorder = const BorderSide(color: Colors.grey, width: 0.5); @@ -75,7 +78,7 @@ class SudokuBoard extends StatelessWidget { ), ), child: Text( - // 🔽 [수정] 0이면 비우고, 아니면 테마 기호("1", "A", "🍎") 표시 + // 0이면 비우고, 아니면 테마 기호("1", "A", "🍎") 표시 cellValue == 0 ? '' : theme.getSymbol(cellValue), style: TextStyle( fontSize: fontSize, diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +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 index c2efd0b..5caa9d1 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1 +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 index bf2a519..9bf5e53 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,8 +5,10 @@ import FlutterMacOS import Foundation +import shared_preferences_foundation import webview_flutter_wkwebview func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) WebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "WebViewFlutterPlugin")) } 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/pubspec.lock b/pubspec.lock index 5ee117f..52e422b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -41,6 +41,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" fake_async: dependency: transitive description: @@ -49,6 +57,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -67,6 +99,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" google_mobile_ads: dependency: "direct main" description: @@ -155,6 +192,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + 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" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -163,6 +232,62 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + url: "https://pub.dev" + source: hosted + version: "2.5.3" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "34266009473bf71d748912da4bf62d439185226c03e01e2d9687bc65bbfcb713" + url: "https://pub.dev" + source: hosted + version: "2.4.15" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "1c33a907142607c40a7542768ec9badfd16293bac51da3a4482623d15845f88b" + url: "https://pub.dev" + source: hosted + version: "2.5.5" + 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 @@ -224,6 +349,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + uuid: + dependency: "direct main" + description: + name: uuid + sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 + url: "https://pub.dev" + source: hosted + version: "4.5.2" vector_math: dependency: transitive description: @@ -280,6 +413,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.23.2" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" sdks: dart: ">=3.9.2 <4.0.0" flutter: ">=3.35.0" diff --git a/pubspec.yaml b/pubspec.yaml index 7397a2e..a57503f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,6 +11,9 @@ dependencies: sdk: flutter http: ^1.2.1 # 이 줄 추가 (버전은 최신 버전 확인) google_mobile_ads: ^5.1.0 + # 🔽 [추가] 2줄 + shared_preferences: ^2.2.3 + uuid: ^4.4.0 dev_dependencies: