feat(settings): 앱 버전 자동 표시 기능 추가

- package_info_plus 패키지 추가
- settings_screen에서 pubspec.yaml 버전을 자동으로 표시
This commit is contained in:
JiWoong Sul
2026-01-17 00:31:41 +09:00
parent 8d6b24ed6f
commit 7125a4745a
4 changed files with 44 additions and 16 deletions

View File

@@ -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<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,
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를 위한 충분한 하단 여백