Skip to content

Commit

Permalink
chore: 앱버전 정보 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
nain93 committed Aug 17, 2023
1 parent c1c3722 commit d4e6974
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 14 deletions.
2 changes: 1 addition & 1 deletion android/flutter.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flutter.versionName=0.0.1
flutter.versionCode=1
flutter.versionCode=2
flutter.minSdkVersion=21
flutter.targetSdkVersion=31
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ PODS:
- kakao_flutter_sdk_common (1.5.0):
- Flutter
- naveridlogin-sdk-ios (4.1.6)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand Down Expand Up @@ -84,6 +86,7 @@ DEPENDENCIES:
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- kakao_flutter_sdk_common (from `.symlinks/plugins/kakao_flutter_sdk_common/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`)
Expand Down Expand Up @@ -128,6 +131,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/integration_test/ios"
kakao_flutter_sdk_common:
:path: ".symlinks/plugins/kakao_flutter_sdk_common/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
Expand Down Expand Up @@ -166,6 +171,7 @@ SPEC CHECKSUMS:
integration_test: 13825b8a9334a850581300559b8839134b124670
kakao_flutter_sdk_common: ceb36a134b53ae973da184f67f39993142377af4
naveridlogin-sdk-ios: cdd34e3585a3d5aaf37c1d84c1f41faba4a25d1a
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
Expand Down
25 changes: 24 additions & 1 deletion lib/screens/setting/setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:moa_app/widgets/button.dart';
import 'package:moa_app/widgets/edit_text.dart';
import 'package:moa_app/widgets/loading_indicator.dart';
import 'package:moa_app/widgets/snackbar.dart';
import 'package:package_info_plus/package_info_plus.dart';

class Setting extends HookConsumerWidget {
const Setting({super.key});
Expand All @@ -25,6 +26,8 @@ class Setting extends HookConsumerWidget {
var editNicknameMode = useState(false);
var nickname = useState('');
var loading = useState(false);
var appVersion = useState<String?>(null);

void pickImage() {}

void goEditMyType() {
Expand Down Expand Up @@ -79,6 +82,16 @@ class Setting extends HookConsumerWidget {
loading.value = false;
}

void getAppVersion() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
appVersion.value = '${packageInfo.version}(${packageInfo.buildNumber})';
}

useEffect(() {
getAppVersion();
return null;
}, []);

return Scaffold(
body: SafeArea(
child: SizedBox(
Expand Down Expand Up @@ -216,7 +229,17 @@ class Setting extends HookConsumerWidget {
SettingListTile(
title: '탈퇴하기',
onPressed: goWithdraw,
)
),
SettingListTile(
title: '앱 버전',
onPressed: () {},
trailing: AnimatedSwitcher(
transitionBuilder: (child, animation) {
return FadeTransition(opacity: animation, child: child);
},
duration: const Duration(milliseconds: 300),
child: Text(appVersion.value ?? ''),
)),
],
),
),
Expand Down
19 changes: 11 additions & 8 deletions lib/screens/setting/widgets/setting_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ class SettingListTile extends StatelessWidget {
super.key,
required this.title,
required this.onPressed,
this.trailing,
});
final String title;
final Function() onPressed;
final Widget? trailing;

@override
Widget build(BuildContext context) {
Expand All @@ -19,14 +21,15 @@ class SettingListTile extends StatelessWidget {
title,
style: const H3TextStyle(),
),
trailing: Transform.rotate(
angle: 180 * 3.14 / 180,
child: Image(
image: Assets.arrowBack,
width: 20,
height: 20,
),
),
trailing: trailing ??
Transform.rotate(
angle: 180 * 3.14 / 180,
child: Image(
image: Assets.arrowBack,
width: 20,
height: 20,
),
),
onTap: onPressed,
);
}
Expand Down
3 changes: 0 additions & 3 deletions lib/utils/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ class Config {
String get webFcmKey => env('WEB_FCM_KEY');
// 웹 로그인 시, Redirect 할 URL
String get socialRedirectUrl => env('SOCIAL_REDIRECT_URL');

// Front URL
String get frontUrl => env('FRONT_URL');
// Backends URL
// Moa-Spring
String get baseUrl => env('BASE_URL');
Expand Down
16 changes: 16 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a"
url: "https://pub.dev"
source: hosted
version: "4.1.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
path:
dependency: "direct main"
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.0.1+1
version: 0.0.1+2

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down Expand Up @@ -76,6 +76,7 @@ dependencies:
share_plus: ^7.0.2
path_provider: ^2.0.15
url_launcher: ^6.1.12
package_info_plus: ^4.1.0

conditional_dependencies:
sqflite:
Expand Down

0 comments on commit d4e6974

Please sign in to comment.