From 57096389cb8865570bd010da603273d6cce2e2a7 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Fri, 24 May 2024 18:01:28 +0700 Subject: [PATCH] Update privacy welcome screen --- assets/l10n/intl_en.arb | 4 +++- lib/config/app_config.dart | 9 ++++++--- lib/pages/twake_welcome/twake_welcome.dart | 8 ++++++++ lib/pages/twake_welcome/twake_welcome_view.dart | 3 +++ pubspec.lock | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 9c8242dd2e..ef763c4c99 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -3059,5 +3059,7 @@ "placeholders": { "user": {} } - } + }, + "privacyPolicy": "Privacy Policy", + "byContinuingYourAgreeingToOur": "By continuing, you're agreeing to our" } diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart index a607c99278..09f84c35b5 100644 --- a/lib/config/app_config.dart +++ b/lib/config/app_config.dart @@ -44,6 +44,10 @@ abstract class AppConfig { static String? platform; + static String _appPolicy = 'https://twake.app/policy'; + + static String appTermsOfUse = 'https://twake.app/terms'; + static double toolbarHeight(BuildContext context) => responsive.isMobile(context) ? 48 : 56; static const Color chatColor = primaryColor; @@ -54,9 +58,8 @@ abstract class AppConfig { static const Color primaryColor = Color.fromARGB(255, 135, 103, 172); static const Color primaryColorLight = Color(0xFFCCBDEA); static const Color secondaryColor = Color(0xFF41a2bc); - static String _privacyUrl = 'https://twake.app/en/privacy/'; - static String get privacyUrl => _privacyUrl; + static String get privacyUrl => _appPolicy; static const String enablePushTutorial = 'https://gitlab.com/famedly/fluffychat/-/wikis/Push-Notifications-without-Google-Services'; static const String encryptionTutorial = @@ -210,7 +213,7 @@ abstract class AppConfig { _webBaseUrl = json['privacy_url']; } if (json['web_base_url'] is String) { - _privacyUrl = json['web_base_url']; + _appPolicy = json['web_base_url']; } if (json['render_html'] is bool) { renderHtml = json['render_html']; diff --git a/lib/pages/twake_welcome/twake_welcome.dart b/lib/pages/twake_welcome/twake_welcome.dart index bded98560d..baf1b19730 100644 --- a/lib/pages/twake_welcome/twake_welcome.dart +++ b/lib/pages/twake_welcome/twake_welcome.dart @@ -4,6 +4,7 @@ import 'package:fluffychat/presentation/mixins/connect_page_mixin.dart'; import 'package:fluffychat/pages/twake_welcome/twake_welcome_view.dart'; import 'package:fluffychat/utils/client_manager.dart'; import 'package:fluffychat/utils/twake_snackbar.dart'; +import 'package:fluffychat/utils/url_launcher.dart'; import 'package:fluffychat/widgets/matrix.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; @@ -120,6 +121,13 @@ class TwakeWelcomeController extends State with ConnectPageMixin { return false; } + void onClickPrivacyPolicy() { + UrlLauncher( + context, + url: AppConfig.privacyUrl, + ).openUrlInAppBrowser(); + } + @override Widget build(BuildContext context) { return TwakeWelcomeView( diff --git a/lib/pages/twake_welcome/twake_welcome_view.dart b/lib/pages/twake_welcome/twake_welcome_view.dart index 267179f8cb..955af5f782 100644 --- a/lib/pages/twake_welcome/twake_welcome_view.dart +++ b/lib/pages/twake_welcome/twake_welcome_view.dart @@ -39,6 +39,9 @@ class TwakeWelcomeView extends StatelessWidget { description: L10n.of(context)!.descriptionTwakeId, onUseCompanyServerOnTap: controller.goToHomeserverPicker, onSignInOnTap: AppConfig.isSaasPlatForm ? controller.onClickSignIn : null, + privacyPolicy: L10n.of(context)!.privacyPolicy, + descriptionPrivacyPolicy: L10n.of(context)!.byContinuingYourAgreeingToOur, + onPrivacyPolicyOnTap: controller.onClickPrivacyPolicy, onCreateTwakeIdOnTap: AppConfig.isSaasPlatForm ? controller.onClickCreateTwakeId : null, logo: SvgPicture.asset( diff --git a/pubspec.lock b/pubspec.lock index c133b461f8..9bb6d8ac0f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1534,7 +1534,7 @@ packages: description: path: "." ref: master - resolved-ref: "5560f148101123acf09b757b456d1d4c7e122948" + resolved-ref: b87f765e777d8d8a3995a8c912d4becd414ba223 url: "git@github.com:linagora/linagora-design-flutter.git" source: git version: "0.0.1"