TF-381 Apply new UI EmailView for browser
This commit is contained in:
@@ -2,11 +2,9 @@ import 'package:core/core.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/caching/caching_manager.dart';
|
||||
import 'package:tmail_ui_user/features/caching/state_cache_client.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/repository/credential_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/credential_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/delete_credential_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/data/datasource/mailbox_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/data/datasource/state_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/data/datasource_impl/mailbox_cache_datasource_impl.dart';
|
||||
@@ -44,7 +42,6 @@ class MailboxBindings extends BaseBindings {
|
||||
void bindingsController() {
|
||||
Get.put(MailboxController(
|
||||
Get.find<GetAllMailboxInteractor>(),
|
||||
Get.find<DeleteCredentialInteractor>(),
|
||||
Get.find<RefreshAllMailboxInteractor>(),
|
||||
Get.find<CreateNewMailboxInteractor>(),
|
||||
Get.find<SearchMailboxInteractor>(),
|
||||
@@ -56,7 +53,6 @@ class MailboxBindings extends BaseBindings {
|
||||
Get.find<AppToast>(),
|
||||
Get.find<ImagePaths>(),
|
||||
Get.find<ResponsiveUtils>(),
|
||||
Get.find<CachingManager>(),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -75,7 +71,6 @@ class MailboxBindings extends BaseBindings {
|
||||
|
||||
@override
|
||||
void bindingsInteractor() {
|
||||
Get.lazyPut(() => DeleteCredentialInteractor(Get.find<CredentialRepository>()));
|
||||
Get.lazyPut(() => GetAllMailboxInteractor(Get.find<MailboxRepository>()));
|
||||
Get.lazyPut(() => RefreshAllMailboxInteractor(Get.find<MailboxRepository>()));
|
||||
Get.lazyPut(() => CreateNewMailboxInteractor(Get.find<MailboxRepository>()));
|
||||
|
||||
@@ -12,12 +12,10 @@ import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:rxdart/transformers.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_mailbox_controller.dart';
|
||||
import 'package:tmail_ui_user/features/caching/caching_manager.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/state/save_email_as_drafts_state.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/state/send_email_state.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/state/update_email_drafts_state.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/state/mark_as_email_read_state.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/delete_credential_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/model/create_new_mailbox_request.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/model/rename_mailbox_request.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/state/create_new_mailbox_state.dart';
|
||||
@@ -59,7 +57,6 @@ class MailboxController extends BaseMailboxController {
|
||||
|
||||
final mailboxDashBoardController = Get.find<MailboxDashBoardController>();
|
||||
final GetAllMailboxInteractor _getAllMailboxInteractor;
|
||||
final DeleteCredentialInteractor _deleteCredentialInteractor;
|
||||
final RefreshAllMailboxInteractor _refreshAllMailboxInteractor;
|
||||
final CreateNewMailboxInteractor _createNewMailboxInteractor;
|
||||
final SearchMailboxInteractor _searchMailboxInteractor;
|
||||
@@ -70,7 +67,6 @@ class MailboxController extends BaseMailboxController {
|
||||
final AppToast _appToast;
|
||||
final ImagePaths _imagePaths;
|
||||
final ResponsiveUtils responsiveUtils;
|
||||
final CachingManager _cachingManager;
|
||||
|
||||
final listMailboxSearched = <PresentationMailbox>[].obs;
|
||||
final searchState = SearchState.initial().obs;
|
||||
@@ -87,7 +83,6 @@ class MailboxController extends BaseMailboxController {
|
||||
|
||||
MailboxController(
|
||||
this._getAllMailboxInteractor,
|
||||
this._deleteCredentialInteractor,
|
||||
this._refreshAllMailboxInteractor,
|
||||
this._createNewMailboxInteractor,
|
||||
this._searchMailboxInteractor,
|
||||
@@ -99,7 +94,6 @@ class MailboxController extends BaseMailboxController {
|
||||
this._appToast,
|
||||
this._imagePaths,
|
||||
this.responsiveUtils,
|
||||
this._cachingManager,
|
||||
) : super(treeBuilder);
|
||||
|
||||
@override
|
||||
@@ -283,14 +277,6 @@ class MailboxController extends BaseMailboxController {
|
||||
_openMailboxEventController.add(OpenMailboxViewEvent(context, presentationMailboxSelected));
|
||||
}
|
||||
|
||||
void _deleteCredential() async {
|
||||
await _deleteCredentialInteractor.execute();
|
||||
}
|
||||
|
||||
void _clearAllCache() async {
|
||||
await _cachingManager.clearAll();
|
||||
}
|
||||
|
||||
void goToCreateNewMailboxView() async {
|
||||
final accountId = mailboxDashBoardController.accountId.value;
|
||||
if (accountId != null) {
|
||||
@@ -612,12 +598,6 @@ class MailboxController extends BaseMailboxController {
|
||||
mailboxDashBoardController.closeDrawer();
|
||||
}
|
||||
|
||||
void logoutAction() {
|
||||
_deleteCredential();
|
||||
_clearAllCache();
|
||||
pushAndPopAll(AppRoutes.LOGIN);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_openMailboxEventController.close();
|
||||
|
||||
@@ -198,7 +198,7 @@ class MailboxView extends GetWidget<MailboxController> {
|
||||
_imagePaths,
|
||||
context,
|
||||
controller.mailboxDashBoardController.userProfile.value)
|
||||
..addOnLogoutAction(() => controller.logoutAction()))
|
||||
..addOnLogoutAction(() => controller.mailboxDashBoardController.logoutAction()))
|
||||
.build()));
|
||||
}
|
||||
|
||||
|
||||
@@ -71,15 +71,14 @@ class MailBoxFolderTileBuilder {
|
||||
trailing: _mailboxNode.hasChildren()
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(right: 0, left: 16),
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
color: AppColor.primaryColor,
|
||||
child: buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
_mailboxNode.expandMode == ExpandMode.EXPAND ? _imagePaths.icExpandFolder : _imagePaths.icFolderArrow,
|
||||
color: AppColor.colorArrowUserMailbox,
|
||||
fit: BoxFit.fill),
|
||||
onPressed: () => _onExpandFolderActionClick?.call(_mailboxNode)
|
||||
))
|
||||
splashRadius: 15,
|
||||
tooltip: _mailboxNode.expandMode == ExpandMode.EXPAND ? AppLocalizations.of(_context).collapse : AppLocalizations.of(_context).expand,
|
||||
onTap: () => _onExpandFolderActionClick?.call(_mailboxNode)))
|
||||
: null
|
||||
),
|
||||
Padding(
|
||||
|
||||
Reference in New Issue
Block a user