From 541f5cbe7b26aa55d798e1fd3b6304fd7c9c6564 Mon Sep 17 00:00:00 2001 From: dab246 Date: Thu, 5 Sep 2024 15:33:48 +0700 Subject: [PATCH] TF-2387 Add `Privacy Policy` button to starting page in mobile --- assets/images/ic_logo_twake_welcome.svg | 73 ++++++++----------- .../login/presentation/login_view.dart | 1 - .../presentation/privacy_link_widget.dart | 5 +- .../twake_welcome_controller.dart | 6 ++ .../twake_welcome/twake_welcome_view.dart | 17 ++++- .../twake_welcome_view_style.dart | 4 + lib/main/utils/app_config.dart | 1 + 7 files changed, 61 insertions(+), 46 deletions(-) create mode 100644 lib/features/starting_page/presentation/twake_welcome/twake_welcome_view_style.dart diff --git a/assets/images/ic_logo_twake_welcome.svg b/assets/images/ic_logo_twake_welcome.svg index 533db7298..fbdef6589 100644 --- a/assets/images/ic_logo_twake_welcome.svg +++ b/assets/images/ic_logo_twake_welcome.svg @@ -1,57 +1,48 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - + - + - + - - - - - - + + + + diff --git a/lib/features/login/presentation/login_view.dart b/lib/features/login/presentation/login_view.dart index bb051da49..4b24ca495 100644 --- a/lib/features/login/presentation/login_view.dart +++ b/lib/features/login/presentation/login_view.dart @@ -9,7 +9,6 @@ import 'package:tmail_ui_user/features/base/widget/recent_item_tile_widget.dart' import 'package:tmail_ui_user/features/login/domain/model/recent_login_url.dart'; import 'package:tmail_ui_user/features/login/presentation/base_login_view.dart'; import 'package:tmail_ui_user/features/login/presentation/login_form_type.dart'; -import 'package:tmail_ui_user/features/login/presentation/privacy_link_widget.dart'; import 'package:tmail_ui_user/features/login/presentation/widgets/dns_lookup_input_form.dart'; import 'package:tmail_ui_user/features/login/presentation/widgets/horizontal_progress_loading_button.dart'; import 'package:tmail_ui_user/features/login/presentation/widgets/login_back_button.dart'; diff --git a/lib/features/login/presentation/privacy_link_widget.dart b/lib/features/login/presentation/privacy_link_widget.dart index 5fe0b3c97..9e6205140 100644 --- a/lib/features/login/presentation/privacy_link_widget.dart +++ b/lib/features/login/presentation/privacy_link_widget.dart @@ -2,14 +2,13 @@ import 'package:core/presentation/extensions/color_extension.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/widgets.dart'; import 'package:tmail_ui_user/main/localizations/app_localizations.dart'; +import 'package:tmail_ui_user/main/utils/app_config.dart'; import 'package:tmail_ui_user/main/utils/app_utils.dart'; class PrivacyLinkWidget extends StatelessWidget { - static const linagoraPrivacy = 'https://www.linagora.com/en/legal/privacy'; - final String privacyUrlString; - const PrivacyLinkWidget({Key? key, this.privacyUrlString = linagoraPrivacy}) : super(key: key); + const PrivacyLinkWidget({Key? key, this.privacyUrlString = AppConfig.linagoraPrivacyUrl}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/features/starting_page/presentation/twake_welcome/twake_welcome_controller.dart b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_controller.dart index 00899086d..c17a745fc 100644 --- a/lib/features/starting_page/presentation/twake_welcome/twake_welcome_controller.dart +++ b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_controller.dart @@ -3,6 +3,8 @@ import 'package:tmail_ui_user/features/login/presentation/login_form_type.dart'; import 'package:tmail_ui_user/features/login/presentation/model/login_arguments.dart'; import 'package:tmail_ui_user/main/routes/app_routes.dart'; import 'package:tmail_ui_user/main/routes/route_navigation.dart'; +import 'package:tmail_ui_user/main/utils/app_config.dart'; +import 'package:tmail_ui_user/main/utils/app_utils.dart'; class TwakeWelcomeController extends BaseController { @@ -11,4 +13,8 @@ class TwakeWelcomeController extends BaseController { AppRoutes.login, arguments: LoginArguments(LoginFormType.dnsLookupForm)); } + + void onClickPrivacyPolicy() { + AppUtils.launchLink(AppConfig.linagoraPrivacyUrl); + } } \ No newline at end of file diff --git a/lib/features/starting_page/presentation/twake_welcome/twake_welcome_view.dart b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_view.dart index ec9c6c0a0..1bddbed67 100644 --- a/lib/features/starting_page/presentation/twake_welcome/twake_welcome_view.dart +++ b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_view.dart @@ -4,6 +4,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:get/get.dart'; import 'package:linagora_design_flutter/linagora_design_flutter.dart'; import 'package:tmail_ui_user/features/starting_page/presentation/twake_welcome/twake_welcome_controller.dart'; +import 'package:tmail_ui_user/features/starting_page/presentation/twake_welcome/twake_welcome_view_style.dart'; import 'package:tmail_ui_user/main/localizations/app_localizations.dart'; class TwakeWelcomeView extends GetWidget { @@ -18,11 +19,25 @@ class TwakeWelcomeView extends GetWidget { ]); return TwakeWelcomeScreen( - logo: SvgPicture.asset(controller.imagePaths.icLogoTwakeWelcome), + logo: Padding( + padding: const EdgeInsetsDirectional.only(bottom: 16), + child: SvgPicture.asset( + controller.imagePaths.icLogoTwakeWelcome, + width: TwakeWelcomeViewStyle.logoWidth, + height: TwakeWelcomeViewStyle.logoHeight, + ), + ), + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + overlayColor: WidgetStateProperty.all(Colors.transparent), signInTitle: AppLocalizations.of(context).signIn.capitalizeFirst ?? '', createTwakeIdTitle: AppLocalizations.of(context).createTwakeId, useCompanyServerTitle: AppLocalizations.of(context).useCompanyServer, description: AppLocalizations.of(context).descriptionWelcomeTo, + privacyPolicy: AppLocalizations.of(context).privacyPolicy, + descriptionPrivacyPolicy: AppLocalizations.of(context).byContinuingYouAreAgreeingToOur, + onPrivacyPolicyOnTap: controller.onClickPrivacyPolicy, onUseCompanyServerOnTap: controller.handleUseCompanyServer, ); } diff --git a/lib/features/starting_page/presentation/twake_welcome/twake_welcome_view_style.dart b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_view_style.dart new file mode 100644 index 000000000..910987e6b --- /dev/null +++ b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_view_style.dart @@ -0,0 +1,4 @@ +class TwakeWelcomeViewStyle { + static const double logoWidth = 205; + static const double logoHeight = 147; +} diff --git a/lib/main/utils/app_config.dart b/lib/main/utils/app_config.dart index 2abac88f8..2de4112e6 100644 --- a/lib/main/utils/app_config.dart +++ b/lib/main/utils/app_config.dart @@ -15,6 +15,7 @@ class AppConfig { static const String iOSKeychainSharingGroupId = 'KUT463DS29.com.linagora.ios.teammail.shared'; static const String iOSKeychainSharingService = 'com.linagora.ios.teammail.sessions'; static const String saasPlatform = 'saas'; + static const String linagoraPrivacyUrl = 'https://www.linagora.com/en/legal/privacy'; static String get baseUrl => dotenv.get('SERVER_URL', fallback: ''); static String get domainRedirectUrl => dotenv.get('DOMAIN_REDIRECT_URL', fallback: '');