diff --git a/assets/images/ic_logo_twake_welcome.svg b/assets/images/ic_logo_twake_welcome.svg new file mode 100644 index 000000000..533db7298 --- /dev/null +++ b/assets/images/ic_logo_twake_welcome.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/lib/presentation/resources/image_paths.dart b/core/lib/presentation/resources/image_paths.dart index ce2516630..52b6013b1 100644 --- a/core/lib/presentation/resources/image_paths.dart +++ b/core/lib/presentation/resources/image_paths.dart @@ -220,6 +220,7 @@ class ImagePaths { String get icGoodSignature => _getImagePath('ic_good_signature.svg'); String get icBadSignature => _getImagePath('ic_bad_signature.svg'); String get icDeleteSelection => _getImagePath('ic_delete_selection.svg'); + String get icLogoTwakeWelcome => _getImagePath('ic_logo_twake_welcome.svg'); String _getImagePath(String imageName) { return AssetsPaths.images + imageName; diff --git a/lib/features/base/base_controller.dart b/lib/features/base/base_controller.dart index 4ec33848a..778d175be 100644 --- a/lib/features/base/base_controller.dart +++ b/lib/features/base/base_controller.dart @@ -407,16 +407,20 @@ abstract class BaseController extends GetxController FirebaseCapability.fcmIdentifier.isSupported(session, accountId) && AppConfig.fcmAvailable; void goToLogin() { - if (Get.currentRoute != AppRoutes.login) { + if (PlatformInfo.isMobile) { + navigateToTwakeWelcomePage(); + } else if (Get.currentRoute != AppRoutes.login) { pushAndPopAll( AppRoutes.login, - arguments: LoginArguments( - PlatformInfo.isMobile ? LoginFormType.dnsLookupForm : LoginFormType.none - ) + arguments: LoginArguments(LoginFormType.none) ); } } + void navigateToTwakeWelcomePage() { + popAndPush(AppRoutes.twakeWelcome); + } + void logout(Session? session, AccountId? accountId) async { if (session == null || accountId == null) { await clearDataAndGoToLoginPage(); diff --git a/lib/features/starting_page/presentation/twake_welcome/twake_welcome_bindings.dart b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_bindings.dart new file mode 100644 index 000000000..91f03c4c3 --- /dev/null +++ b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_bindings.dart @@ -0,0 +1,9 @@ +import 'package:get/get.dart'; +import 'package:tmail_ui_user/features/starting_page/presentation/twake_welcome/twake_welcome_controller.dart'; + +class TwakeWelcomeBindings extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => TwakeWelcomeController()); + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..f41ff18da --- /dev/null +++ b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_controller.dart @@ -0,0 +1,3 @@ +import 'package:tmail_ui_user/features/base/base_controller.dart'; + +class TwakeWelcomeController extends BaseController {} \ 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 new file mode 100644 index 000000000..76391dce9 --- /dev/null +++ b/lib/features/starting_page/presentation/twake_welcome/twake_welcome_view.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +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/main/localizations/app_localizations.dart'; + +class TwakeWelcomeView extends GetWidget { + + const TwakeWelcomeView({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown + ]); + + return TwakeWelcomeScreen( + logo: SvgPicture.asset(controller.imagePaths.icLogoTwakeWelcome), + signInTitle: AppLocalizations.of(context).signIn.capitalizeFirst ?? '', + createTwakeIdTitle: AppLocalizations.of(context).createTwakeId, + useCompanyServerTitle: AppLocalizations.of(context).useCompanyServer, + description: AppLocalizations.of(context).descriptionWelcomeTo, + ); + } +} \ No newline at end of file diff --git a/lib/l10n/intl_messages.arb b/lib/l10n/intl_messages.arb index 8ebe29b1b..aae5a70fa 100644 --- a/lib/l10n/intl_messages.arb +++ b/lib/l10n/intl_messages.arb @@ -4041,5 +4041,23 @@ "type": "text", "placeholders_order": [], "placeholders": {} + }, + "descriptionWelcomeTo": "End-to-end encryption, collaborative\n features for secure and efficient\n teamwork", + "@descriptionWelcomeTo": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, + "createTwakeId": "Create Twake ID", + "@createTwakeId": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, + "useCompanyServer": "Use company server", + "@useCompanyServer": { + "type": "text", + "placeholders_order": [], + "placeholders": {} } } \ No newline at end of file diff --git a/lib/main/localizations/app_localizations.dart b/lib/main/localizations/app_localizations.dart index 2b19ccd19..c9d72b6c4 100644 --- a/lib/main/localizations/app_localizations.dart +++ b/lib/main/localizations/app_localizations.dart @@ -4238,4 +4238,25 @@ class AppLocalizations { name: 'thisFieldCannotContainOnlySpaces', ); } + + String get descriptionWelcomeTo { + return Intl.message( + 'End-to-end encryption, collaborative\n features for secure and efficient\n teamwork', + name: 'descriptionWelcomeTo', + ); + } + + String get createTwakeId { + return Intl.message( + 'Create Twake ID', + name: 'createTwakeId', + ); + } + + String get useCompanyServer { + return Intl.message( + 'Use company server', + name: 'useCompanyServer', + ); + } } diff --git a/lib/main/pages/app_pages.dart b/lib/main/pages/app_pages.dart index 83e23838f..61cb38e51 100644 --- a/lib/main/pages/app_pages.dart +++ b/lib/main/pages/app_pages.dart @@ -28,6 +28,8 @@ import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/mailbox_da import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_bindings.dart'; import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_view.dart' deferred as manage_account_dashboard; import 'package:tmail_ui_user/features/search/mailbox/presentation/search_mailbox_bindings.dart'; +import 'package:tmail_ui_user/features/starting_page/presentation/twake_welcome/twake_welcome_bindings.dart'; +import 'package:tmail_ui_user/features/starting_page/presentation/twake_welcome/twake_welcome_view.dart'; import 'package:tmail_ui_user/features/unknown_route_page/unknown_route_page_view.dart'; import 'package:tmail_ui_user/main/pages/deferred_widget.dart'; import 'package:tmail_ui_user/main/routes/app_routes.dart'; @@ -83,6 +85,10 @@ class AppPages { unknownRoutePage, if (PlatformInfo.isMobile) ...[ + GetPage( + name: AppRoutes.twakeWelcome, + page: () => const TwakeWelcomeView(), + binding: TwakeWelcomeBindings()), GetPage( name: AppRoutes.composer, page: () => DeferredWidget( diff --git a/lib/main/routes/app_routes.dart b/lib/main/routes/app_routes.dart index 0b682d202..9ae2e98ee 100644 --- a/lib/main/routes/app_routes.dart +++ b/lib/main/routes/app_routes.dart @@ -1,5 +1,6 @@ abstract class AppRoutes { static const home = '/'; + static const twakeWelcome = '/twake_welcome'; static const login = '/login'; static const dashboard = '/dashboard'; static const dashboardWithParameter = '/dashboard/:id';