mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: update privacy policy and add version code (#4343)
This commit is contained in:
parent
190fae196f
commit
36b88c602c
@ -1,3 +1,2 @@
|
||||
export 'about_setting_group.dart';
|
||||
export 'privacy_policy_page.dart';
|
||||
export 'user_agreement_page.dart';
|
||||
|
@ -1,10 +1,11 @@
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/startup/tasks/device_info_task.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../widgets/widgets.dart';
|
||||
import 'about.dart';
|
||||
|
||||
class AboutSettingGroup extends StatelessWidget {
|
||||
const AboutSettingGroup({
|
||||
@ -21,18 +22,21 @@ class AboutSettingGroup extends StatelessWidget {
|
||||
trailing: const Icon(
|
||||
Icons.chevron_right,
|
||||
),
|
||||
onTap: () {
|
||||
context.push(PrivacyPolicyPage.routeName);
|
||||
},
|
||||
onTap: () => safeLaunchUrl('https://appflowy.io/privacy/mobile'),
|
||||
),
|
||||
MobileSettingItem(
|
||||
name: LocaleKeys.settings_mobile_userAgreement.tr(),
|
||||
name: LocaleKeys.settings_mobile_termsAndConditions.tr(),
|
||||
trailing: const Icon(
|
||||
Icons.chevron_right,
|
||||
),
|
||||
onTap: () {
|
||||
context.push(UserAgreementPage.routeName);
|
||||
},
|
||||
onTap: () => safeLaunchUrl('https://appflowy.io/terms'),
|
||||
),
|
||||
MobileSettingItem(
|
||||
name: LocaleKeys.settings_mobile_version.tr(),
|
||||
trailing: FlowyText(
|
||||
'${DeviceOrApplicationInfoTask.applicationVersion} (${DeviceOrApplicationInfoTask.buildNumber})',
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
],
|
||||
showDivider: false,
|
||||
|
@ -1,22 +0,0 @@
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PrivacyPolicyPage extends StatelessWidget {
|
||||
const PrivacyPolicyPage({super.key});
|
||||
|
||||
static const routeName = '/PrivacyPolicyPage';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO(yijing): implement page
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(LocaleKeys.settings_mobile_privacyPolicy.tr()),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('🪜 Under construction'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -34,7 +34,7 @@ class KeyboardHeightObserver {
|
||||
|
||||
void notify(double height) {
|
||||
// the keyboard height will notify twice with the same value on Android 14
|
||||
if (DeviceInfoTask.androidSDKVersion == 34) {
|
||||
if (DeviceOrApplicationInfoTask.androidSDKVersion == 34) {
|
||||
if (height == 0 && currentKeyboardHeight == 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ class FlowyRunner {
|
||||
// there's a flag named _enable in memory_leak_detector.dart. If it's false, the task will be ignored.
|
||||
MemoryLeakDetectorTask(),
|
||||
const DebugTask(),
|
||||
const DeviceInfoTask(),
|
||||
const DeviceOrApplicationInfoTask(),
|
||||
// localization
|
||||
const InitLocalizationTask(),
|
||||
// init the app window
|
||||
|
@ -1,21 +1,31 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
import '../startup.dart';
|
||||
|
||||
class DeviceInfoTask extends LaunchTask {
|
||||
const DeviceInfoTask();
|
||||
class DeviceOrApplicationInfoTask extends LaunchTask {
|
||||
const DeviceOrApplicationInfoTask();
|
||||
|
||||
static int androidSDKVersion = -1;
|
||||
static String applicationVersion = '';
|
||||
static String buildNumber = '';
|
||||
|
||||
@override
|
||||
Future<void> initialize(LaunchContext context) async {
|
||||
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
||||
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
final androidInfo = await deviceInfoPlugin.androidInfo;
|
||||
androidSDKVersion = androidInfo.version.sdkInt;
|
||||
}
|
||||
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
applicationVersion = packageInfo.version;
|
||||
buildNumber = packageInfo.buildNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -47,7 +47,6 @@ GoRouter generateRouter(Widget child) {
|
||||
if (PlatformExtension.isMobile) ...[
|
||||
// settings
|
||||
_mobileHomeSettingPageRoute(),
|
||||
_mobileSettingPrivacyPolicyPageRoute(),
|
||||
_mobileSettingUserAgreementPageRoute(),
|
||||
_mobileCloudSettingAppFlowyCloudPageRoute(),
|
||||
|
||||
@ -196,16 +195,6 @@ GoRoute _mobileHomeSettingPageRoute() {
|
||||
);
|
||||
}
|
||||
|
||||
GoRoute _mobileSettingPrivacyPolicyPageRoute() {
|
||||
return GoRoute(
|
||||
parentNavigatorKey: AppGlobals.rootNavKey,
|
||||
path: PrivacyPolicyPage.routeName,
|
||||
pageBuilder: (context, state) {
|
||||
return const MaterialPage(child: PrivacyPolicyPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
GoRoute _mobileCloudSettingAppFlowyCloudPageRoute() {
|
||||
return GoRoute(
|
||||
parentNavigatorKey: AppGlobals.rootNavKey,
|
||||
|
@ -447,10 +447,12 @@
|
||||
"joinDiscord": "Join us in Discord",
|
||||
"privacyPolicy": "Privacy Policy",
|
||||
"userAgreement": "User Agreement",
|
||||
"termsAndConditions": "Terms and Conditions",
|
||||
"userprofileError": "Failed to load user profile",
|
||||
"userprofileErrorDescription": "Please try to log out and log back in to check if the issue still persists.",
|
||||
"selectLayout": "Select layout",
|
||||
"selectStartingDay": "Select starting day"
|
||||
"selectStartingDay": "Select starting day",
|
||||
"version": "Version"
|
||||
}
|
||||
},
|
||||
"grid": {
|
||||
|
Loading…
Reference in New Issue
Block a user