TF-2387 Add TwakeWelcome page the first time app launch
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
|
||||
class TwakeWelcomeController extends BaseController {}
|
||||
@@ -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<TwakeWelcomeController> {
|
||||
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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": {}
|
||||
}
|
||||
}
|
||||
@@ -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',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user