Skip to content

Commit

Permalink
Update privacy welcome screen
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev authored and hoangdat committed May 25, 2024
1 parent dd94a70 commit 5eecf32
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3059,5 +3059,7 @@
"placeholders": {
"user": {}
}
}
},
"privacyPolicy": "Privacy Policy",
"byContinuingYourAgreeingToOur": "By continuing, you're agreeing to our"
}
9 changes: 6 additions & 3 deletions lib/config/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 =
Expand Down Expand Up @@ -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'];
Expand Down
8 changes: 8 additions & 0 deletions lib/pages/twake_welcome/twake_welcome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -120,6 +121,13 @@ class TwakeWelcomeController extends State<TwakeWelcome> with ConnectPageMixin {
return false;
}

void onClickPrivacyPolicy() {
UrlLauncher(
context,
url: AppConfig.privacyUrl,
).openUrlInAppBrowser();
}

@override
Widget build(BuildContext context) {
return TwakeWelcomeView(
Expand Down
3 changes: 3 additions & 0 deletions lib/pages/twake_welcome/twake_welcome_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ packages:
description:
path: "."
ref: master
resolved-ref: "5560f148101123acf09b757b456d1d4c7e122948"
resolved-ref: b87f765e777d8d8a3995a8c912d4becd414ba223
url: "[email protected]:linagora/linagora-design-flutter.git"
source: git
version: "0.0.1"
Expand Down

0 comments on commit 5eecf32

Please sign in to comment.