feat(settings): 앱 버전 자동 표시 기능 추가
- package_info_plus 패키지 추가 - settings_screen에서 pubspec.yaml 버전을 자동으로 표시
This commit is contained in:
@@ -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,7 +885,11 @@ class SettingsScreen extends StatelessWidget {
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
child: ListTile(
|
||||
child: FutureBuilder<PackageInfo>(
|
||||
future: PackageInfo.fromPlatform(),
|
||||
builder: (context, snapshot) {
|
||||
final version = snapshot.data?.version ?? '-';
|
||||
return ListTile(
|
||||
contentPadding: const EdgeInsets.all(8),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).appInfo,
|
||||
@@ -892,13 +897,15 @@ class SettingsScreen extends StatelessWidget {
|
||||
color: Theme.of(context).colorScheme.onSurface),
|
||||
),
|
||||
subtitle: Text(
|
||||
'${AppLocalizations.of(context).version} 1.0.0',
|
||||
'${AppLocalizations.of(context).version} $version',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurfaceVariant),
|
||||
),
|
||||
leading: Icon(Icons.info,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
color:
|
||||
Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
onTap: null,
|
||||
// onTap: () async {
|
||||
// // 항상 앱 내 About 다이얼로그를 우선 표시 (현재 미사용)
|
||||
@@ -954,6 +961,8 @@ class SettingsScreen extends StatelessWidget {
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// FloatingNavigationBar를 위한 충분한 하단 여백
|
||||
|
||||
@@ -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"))
|
||||
|
||||
16
pubspec.lock
16
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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user