Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update privacy welcome screen #1798

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading