From 7125a4745ac55c924ae48bc4fed2d2a6255f46a7 Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Sat, 17 Jan 2026 00:31:41 +0900 Subject: [PATCH] =?UTF-8?q?feat(settings):=20=EC=95=B1=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20=EC=9E=90=EB=8F=99=20=ED=91=9C=EC=8B=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - package_info_plus 패키지 추가 - settings_screen에서 pubspec.yaml 버전을 자동으로 표시 --- lib/screens/settings_screen.dart | 41 +++++++++++-------- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 16 ++++++++ pubspec.yaml | 1 + 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 27a68d2..c720f7d 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart' show kIsWeb, kDebugMode; import 'package:provider/provider.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import '../providers/notification_provider.dart'; import 'dart:io'; import '../services/notification_service.dart'; @@ -884,22 +885,28 @@ class SettingsScreen extends StatelessWidget { .withValues(alpha: 0.5), ), ), - child: ListTile( - contentPadding: const EdgeInsets.all(8), - title: Text( - AppLocalizations.of(context).appInfo, - style: TextStyle( - color: Theme.of(context).colorScheme.onSurface), - ), - subtitle: Text( - '${AppLocalizations.of(context).version} 1.0.0', - style: TextStyle( - color: - Theme.of(context).colorScheme.onSurfaceVariant), - ), - leading: Icon(Icons.info, - color: Theme.of(context).colorScheme.onSurfaceVariant), - onTap: null, + child: FutureBuilder( + future: PackageInfo.fromPlatform(), + builder: (context, snapshot) { + final version = snapshot.data?.version ?? '-'; + return ListTile( + contentPadding: const EdgeInsets.all(8), + title: Text( + AppLocalizations.of(context).appInfo, + style: TextStyle( + color: Theme.of(context).colorScheme.onSurface), + ), + subtitle: Text( + '${AppLocalizations.of(context).version} $version', + style: TextStyle( + color: Theme.of(context) + .colorScheme + .onSurfaceVariant), + ), + leading: Icon(Icons.info, + color: + Theme.of(context).colorScheme.onSurfaceVariant), + onTap: null, // onTap: () async { // // 항상 앱 내 About 다이얼로그를 우선 표시 (현재 미사용) // showAboutDialog( @@ -954,6 +961,8 @@ class SettingsScreen extends StatelessWidget { // ], // ); // }, + ); + }, ), ), // FloatingNavigationBar를 위한 충분한 하단 여백 diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index edcf12a..81eeab8 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -8,6 +8,7 @@ import Foundation import flutter_local_notifications import flutter_secure_storage_darwin import local_auth_darwin +import package_info_plus import path_provider_foundation import share_plus import shared_preferences_foundation @@ -19,6 +20,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin")) LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 19007db..8b84d2e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -733,6 +733,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" + package_info_plus: + dependency: "direct main" + description: + name: package_info_plus + sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968" + url: "https://pub.dev" + source: hosted + version: "8.3.1" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086" + url: "https://pub.dev" + source: hosted + version: "3.2.1" path: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 67ce427..3fd7315 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,6 +42,7 @@ dependencies: crypto: ^3.0.6 image: ^4.5.4 google_mobile_ads: ^6.0.0 + package_info_plus: ^8.3.0 dev_dependencies: flutter_test: