File tree Expand file tree Collapse file tree 8 files changed +30
-48
lines changed
mobile/presentation/setting/about
plugins/document/presentation/editor_plugins/mobile_toolbar_v3 Expand file tree Collapse file tree 8 files changed +30
-48
lines changed Original file line number Diff line number Diff line change 11export 'about_setting_group.dart' ;
2- export 'privacy_policy_page.dart' ;
32export 'user_agreement_page.dart' ;
Original file line number Diff line number Diff line change 11import 'package:appflowy/generated/locale_keys.g.dart' ;
2+ import 'package:appflowy/startup/tasks/device_info_task.dart' ;
3+ import 'package:appflowy_editor/appflowy_editor.dart' ;
24import 'package:easy_localization/easy_localization.dart' ;
5+ import 'package:flowy_infra_ui/flowy_infra_ui.dart' ;
36import 'package:flutter/material.dart' ;
4- import 'package:go_router/go_router.dart' ;
57
68import '../widgets/widgets.dart' ;
7- import 'about.dart' ;
89
910class AboutSettingGroup extends StatelessWidget {
1011 const AboutSettingGroup ({
@@ -21,18 +22,21 @@ class AboutSettingGroup extends StatelessWidget {
2122 trailing: const Icon (
2223 Icons .chevron_right,
2324 ),
24- onTap: () {
25- context.push (PrivacyPolicyPage .routeName);
26- },
25+ onTap: () => safeLaunchUrl ('https://appflowy.io/privacy/mobile' ),
2726 ),
2827 MobileSettingItem (
29- name: LocaleKeys .settings_mobile_userAgreement .tr (),
28+ name: LocaleKeys .settings_mobile_termsAndConditions .tr (),
3029 trailing: const Icon (
3130 Icons .chevron_right,
3231 ),
33- onTap: () {
34- context.push (UserAgreementPage .routeName);
35- },
32+ onTap: () => safeLaunchUrl ('https://appflowy.io/terms' ),
33+ ),
34+ MobileSettingItem (
35+ name: LocaleKeys .settings_mobile_version.tr (),
36+ trailing: FlowyText (
37+ '${DeviceOrApplicationInfoTask .applicationVersion } (${DeviceOrApplicationInfoTask .buildNumber })' ,
38+ color: Theme .of (context).colorScheme.onSurface,
39+ ),
3640 ),
3741 ],
3842 showDivider: false ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class KeyboardHeightObserver {
3434
3535 void notify (double height) {
3636 // the keyboard height will notify twice with the same value on Android 14
37- if (DeviceInfoTask .androidSDKVersion == 34 ) {
37+ if (DeviceOrApplicationInfoTask .androidSDKVersion == 34 ) {
3838 if (height == 0 && currentKeyboardHeight == 0 ) {
3939 return ;
4040 }
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ class FlowyRunner {
109109 // there's a flag named _enable in memory_leak_detector.dart. If it's false, the task will be ignored.
110110 MemoryLeakDetectorTask (),
111111 const DebugTask (),
112- const DeviceInfoTask (),
112+ const DeviceOrApplicationInfoTask (),
113113 // localization
114114 const InitLocalizationTask (),
115115 // init the app window
Original file line number Diff line number Diff line change 11import 'dart:io' ;
22
33import 'package:device_info_plus/device_info_plus.dart' ;
4+ import 'package:package_info_plus/package_info_plus.dart' ;
45
56import '../startup.dart' ;
67
7- class DeviceInfoTask extends LaunchTask {
8- const DeviceInfoTask ();
8+ class DeviceOrApplicationInfoTask extends LaunchTask {
9+ const DeviceOrApplicationInfoTask ();
910
1011 static int androidSDKVersion = - 1 ;
12+ static String applicationVersion = '' ;
13+ static String buildNumber = '' ;
1114
1215 @override
1316 Future <void > initialize (LaunchContext context) async {
1417 final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin ();
18+ final PackageInfo packageInfo = await PackageInfo .fromPlatform ();
19+
1520 if (Platform .isAndroid) {
1621 final androidInfo = await deviceInfoPlugin.androidInfo;
1722 androidSDKVersion = androidInfo.version.sdkInt;
1823 }
24+
25+ if (Platform .isAndroid || Platform .isIOS) {
26+ applicationVersion = packageInfo.version;
27+ buildNumber = packageInfo.buildNumber;
28+ }
1929 }
2030
2131 @override
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ GoRouter generateRouter(Widget child) {
4747 if (PlatformExtension .isMobile) ...[
4848 // settings
4949 _mobileHomeSettingPageRoute (),
50- _mobileSettingPrivacyPolicyPageRoute (),
5150 _mobileSettingUserAgreementPageRoute (),
5251 _mobileCloudSettingAppFlowyCloudPageRoute (),
5352
@@ -196,16 +195,6 @@ GoRoute _mobileHomeSettingPageRoute() {
196195 );
197196}
198197
199- GoRoute _mobileSettingPrivacyPolicyPageRoute () {
200- return GoRoute (
201- parentNavigatorKey: AppGlobals .rootNavKey,
202- path: PrivacyPolicyPage .routeName,
203- pageBuilder: (context, state) {
204- return const MaterialPage (child: PrivacyPolicyPage ());
205- },
206- );
207- }
208-
209198GoRoute _mobileCloudSettingAppFlowyCloudPageRoute () {
210199 return GoRoute (
211200 parentNavigatorKey: AppGlobals .rootNavKey,
Original file line number Diff line number Diff line change 447447 "joinDiscord" : " Join us in Discord" ,
448448 "privacyPolicy" : " Privacy Policy" ,
449449 "userAgreement" : " User Agreement" ,
450+ "termsAndConditions" : " Terms and Conditions" ,
450451 "userprofileError" : " Failed to load user profile" ,
451452 "userprofileErrorDescription" : " Please try to log out and log back in to check if the issue still persists." ,
452453 "selectLayout" : " Select layout" ,
453- "selectStartingDay" : " Select starting day"
454+ "selectStartingDay" : " Select starting day" ,
455+ "version" : " Version"
454456 }
455457 },
456458 "grid" : {
You can’t perform that action at this time.
0 commit comments