TF-691 Persist mailbox selected when click outside destination picker to close
This commit is contained in:
@@ -76,28 +76,35 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
onTap: () => controller.closeDestinationPicker(),
|
onTap: () => controller.closeDestinationPicker(),
|
||||||
child: ResponsiveWidget(
|
child: ResponsiveWidget(
|
||||||
responsiveUtils: _responsiveUtils,
|
responsiveUtils: _responsiveUtils,
|
||||||
mobile: SizedBox(child: _buildBodyMailboxLocation(context, actions), width: double.infinity),
|
mobile: SizedBox(
|
||||||
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
|
width: double.infinity),
|
||||||
landscapeMobile: Row(children: [
|
landscapeMobile: Row(children: [
|
||||||
SizedBox(child: _buildBodyMailboxLocation(context, actions), width: ResponsiveUtils.defaultSizeDrawer),
|
SizedBox(
|
||||||
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
|
width: ResponsiveUtils.defaultSizeDrawer),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
tablet: Row(children: [
|
tablet: Row(children: [
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
width: _responsiveUtils.getSizeScreenWidth(context) - ResponsiveUtils.defaultSizeDrawer),
|
width: _responsiveUtils.getSizeScreenWidth(context) -
|
||||||
|
ResponsiveUtils.defaultSizeDrawer),
|
||||||
|
]),
|
||||||
|
landscapeTablet: Row(children: [
|
||||||
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
|
SizedBox(
|
||||||
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
|
width: _responsiveUtils.getSizeScreenWidth(context) -
|
||||||
|
ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
]),
|
]),
|
||||||
tabletLarge: Row(children: [
|
tabletLarge: Row(children: [
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
width: _responsiveUtils.getSizeScreenWidth(context) - ResponsiveUtils.defaultSizeDrawer),
|
width: _responsiveUtils.getSizeScreenWidth(context) -
|
||||||
]),
|
ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
desktop: Row(children: [
|
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
|
||||||
SizedBox(
|
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
|
||||||
width: _responsiveUtils.getSizeScreenWidth(context) - ResponsiveUtils.defaultSizeDrawer),
|
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -111,21 +118,31 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
onTap: () => controller.closeDestinationPicker(),
|
onTap: () => controller.closeDestinationPicker(),
|
||||||
child: ResponsiveWidget(
|
child: ResponsiveWidget(
|
||||||
responsiveUtils: _responsiveUtils,
|
responsiveUtils: _responsiveUtils,
|
||||||
mobile: SizedBox(child: _buildBodyMailboxLocation(context, actions), width: double.infinity),
|
mobile: SizedBox(
|
||||||
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
|
width: double.infinity),
|
||||||
landscapeMobile: Row(children: [
|
landscapeMobile: Row(children: [
|
||||||
SizedBox(child: _buildBodyMailboxLocation(context, actions), width: ResponsiveUtils.defaultSizeDrawer),
|
SizedBox(
|
||||||
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
|
width: ResponsiveUtils.defaultSizeDrawer),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
tablet: Row(children: [
|
tablet: Row(children: [
|
||||||
SizedBox(child: _buildBodyMailboxLocation(context, actions), width: ResponsiveUtils.defaultSizeDrawer),
|
SizedBox(
|
||||||
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
|
width: ResponsiveUtils.defaultSizeDrawer),
|
||||||
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
|
]),
|
||||||
|
landscapeTablet: Row(children: [
|
||||||
|
SizedBox(
|
||||||
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
|
width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
tabletLarge: Row(children: [
|
tabletLarge: Row(children: [
|
||||||
SizedBox(child: _buildBodyMailboxLocation(context, actions), width: ResponsiveUtils.defaultSizeDrawer),
|
SizedBox(
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
child: _buildBodyMailboxLocation(context, actions),
|
||||||
]),
|
width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
desktop: Row(children: [
|
|
||||||
SizedBox(child: _buildBodyMailboxLocation(context, actions), width: ResponsiveUtils.defaultSizeDrawer),
|
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
@@ -158,30 +175,41 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
onTap: () => {},
|
onTap: () => {},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topRight: Radius.circular(
|
topRight: Radius.circular(!BuildUtils.isWeb &&
|
||||||
!BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context)
|
_responsiveUtils.isPortraitMobile(context)
|
||||||
? 14 : 0),
|
? 14
|
||||||
topLeft: Radius.circular(
|
: 0),
|
||||||
!BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context)
|
topLeft: Radius.circular(!BuildUtils.isWeb &&
|
||||||
? 14 : 0)),
|
_responsiveUtils.isPortraitMobile(context)
|
||||||
|
? 14
|
||||||
|
: 0)),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
SafeArea(
|
SafeArea(
|
||||||
left: !BuildUtils.isWeb && _responsiveUtils.isLandscapeMobile(context),
|
left: !BuildUtils.isWeb &&
|
||||||
|
_responsiveUtils.isLandscapeMobile(context),
|
||||||
right: false,
|
right: false,
|
||||||
bottom: false,
|
bottom: false,
|
||||||
child: _buildAppBar(context)),
|
child: _buildAppBar(context)),
|
||||||
const Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2),
|
const Divider(
|
||||||
|
color: AppColor.colorDividerMailbox,
|
||||||
|
height: 0.5,
|
||||||
|
thickness: 0.2),
|
||||||
Obx(() => controller.isSearchActive()
|
Obx(() => controller.isSearchActive()
|
||||||
? SafeArea(bottom: false, top: false, right: false, child: _buildInputSearchFormWidget(context))
|
? SafeArea(
|
||||||
|
bottom: false,
|
||||||
|
top: false,
|
||||||
|
right: false,
|
||||||
|
child: _buildInputSearchFormWidget(context))
|
||||||
: const SizedBox.shrink()),
|
: const SizedBox.shrink()),
|
||||||
Expanded(child: Container(
|
Expanded(child: Container(
|
||||||
color: actions == MailboxActions.create ? AppColor.colorBgMailbox : Colors.white,
|
color: actions?.getBackgroundColor(),
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
bottom: false,
|
bottom: false,
|
||||||
left: !BuildUtils.isWeb && _responsiveUtils.isLandscapeMobile(context),
|
left: !BuildUtils.isWeb &&
|
||||||
|
_responsiveUtils.isLandscapeMobile(context),
|
||||||
right: false,
|
right: false,
|
||||||
child: _buildBodyDestinationPicker(context, actions))))
|
child: _buildBodyDestinationPicker(context, actions))))
|
||||||
])
|
])
|
||||||
@@ -192,16 +220,15 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildAppBar(BuildContext context) {
|
Widget _buildAppBar(BuildContext context) {
|
||||||
return Obx(() => (AppBarDestinationPickerBuilder(context, _imagePaths, controller.mailboxAction.value)
|
return Obx(() => AppBarDestinationPickerBuilder(
|
||||||
..addCloseActionClick(() => controller.closeDestinationPicker()))
|
controller.mailboxAction.value,
|
||||||
.build());
|
onCloseAction: () => controller.closeDestinationPicker()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSearchBarWidget(BuildContext context) {
|
Widget _buildSearchBarWidget(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: _responsiveUtils.isScreenWithShortestSide(context) &&
|
top: !BuildUtils.isWeb ? 12 : 0,
|
||||||
!BuildUtils.isWeb ? 12 : 0,
|
|
||||||
left: _responsiveUtils.isLandscapeMobile(context) &&
|
left: _responsiveUtils.isLandscapeMobile(context) &&
|
||||||
!BuildUtils.isWeb ? 0 : 16,
|
!BuildUtils.isWeb ? 0 : 16,
|
||||||
right: 16),
|
right: 16),
|
||||||
@@ -237,11 +264,31 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
if (actions?.hasSearchActive() == true)
|
if (actions?.hasSearchActive() == true)
|
||||||
_buildSearchBarWidget(context),
|
_buildSearchBarWidget(context),
|
||||||
_buildLoadingView(),
|
_buildLoadingView(),
|
||||||
if (actions == MailboxActions.create && !BuildUtils.isWeb && _responsiveUtils.isScreenWithShortestSide(context))
|
if (actions == MailboxActions.create && !BuildUtils.isWeb)
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
if (actions?.hasAllMailboxDefault() == true)
|
if (actions?.hasAllMailboxDefault() == true)
|
||||||
_buildUnifiedMailbox(context, actions),
|
...[
|
||||||
const SizedBox(height: 12),
|
_buildUnifiedMailbox(context, actions),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
if (actions != MailboxActions.create &&
|
||||||
|
(
|
||||||
|
_responsiveUtils.isLandscapeMobile(context) ||
|
||||||
|
_responsiveUtils.isPortraitMobile(context) ||
|
||||||
|
_responsiveUtils.isTablet(context) ||
|
||||||
|
_responsiveUtils.isLandscapeTablet(context) ||
|
||||||
|
_responsiveUtils.isTabletLarge(context)
|
||||||
|
)
|
||||||
|
&& !BuildUtils.isWeb
|
||||||
|
)
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: _responsiveUtils.isLandscapeMobile(context) ? 40 : 55,
|
||||||
|
right: 20),
|
||||||
|
child: const Divider(
|
||||||
|
color: AppColor.lineItemListColor,
|
||||||
|
height: 0.5,
|
||||||
|
thickness: 0.2)),
|
||||||
|
],
|
||||||
Obx(() => controller.defaultMailboxHasChild
|
Obx(() => controller.defaultMailboxHasChild
|
||||||
? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultRootNode, actions)
|
? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultRootNode, actions)
|
||||||
: const SizedBox.shrink()),
|
: const SizedBox.shrink()),
|
||||||
@@ -393,10 +440,21 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
margin: const EdgeInsets.only(
|
margin: EdgeInsets.only(
|
||||||
left: BuildUtils.isWeb ? 8 : 0,
|
left: BuildUtils.isWeb ||
|
||||||
|
_responsiveUtils.isTablet(context) ||
|
||||||
|
_responsiveUtils.isLandscapeTablet(context) ||
|
||||||
|
_responsiveUtils.isTabletLarge(context) ||
|
||||||
|
_responsiveUtils.isPortraitMobile(context)
|
||||||
|
? 8
|
||||||
|
: 0,
|
||||||
top: 8),
|
top: 8),
|
||||||
padding: const EdgeInsets.only(left: 16, top: 16),
|
padding: EdgeInsets.only(
|
||||||
|
left: !BuildUtils.isWeb &&
|
||||||
|
_responsiveUtils.isLandscapeMobile(context)
|
||||||
|
? 8
|
||||||
|
: 16,
|
||||||
|
top: 16),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
_imagePaths.icFolderMailbox,
|
_imagePaths.icFolderMailbox,
|
||||||
|
|||||||
+41
-39
@@ -2,31 +2,27 @@
|
|||||||
import 'package:core/core.dart';
|
import 'package:core/core.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox/presentation/model/mailbox_actions.dart';
|
import 'package:tmail_ui_user/features/mailbox/presentation/model/mailbox_actions.dart';
|
||||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
|
||||||
typedef OnCloseActionClick = void Function();
|
class AppBarDestinationPickerBuilder extends StatelessWidget {
|
||||||
|
|
||||||
class AppBarDestinationPickerBuilder {
|
|
||||||
OnCloseActionClick? _onCloseActionClick;
|
|
||||||
|
|
||||||
final BuildContext _context;
|
|
||||||
final ImagePaths _imagePaths;
|
|
||||||
final MailboxActions? _mailboxAction;
|
final MailboxActions? _mailboxAction;
|
||||||
|
final VoidCallback? onCloseAction;
|
||||||
|
|
||||||
AppBarDestinationPickerBuilder(
|
const AppBarDestinationPickerBuilder(
|
||||||
this._context,
|
this._mailboxAction,
|
||||||
this._imagePaths,
|
{
|
||||||
this._mailboxAction,
|
Key? key,
|
||||||
);
|
this.onCloseAction
|
||||||
|
}
|
||||||
|
) : super(key: key);
|
||||||
|
|
||||||
void addCloseActionClick(OnCloseActionClick onCloseActionClick) {
|
@override
|
||||||
_onCloseActionClick = onCloseActionClick;
|
Widget build(BuildContext context) {
|
||||||
}
|
final imagePaths = Get.find<ImagePaths>();
|
||||||
|
|
||||||
Widget build() {
|
|
||||||
return Container(
|
return Container(
|
||||||
key: const Key('app_bar_destination_picker'),
|
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
|
||||||
@@ -37,17 +33,28 @@ class AppBarDestinationPickerBuilder {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
_buildBackButton(),
|
_buildBackButton(context, imagePaths),
|
||||||
Expanded(child: _buildTitle()),
|
Expanded(child: Text(
|
||||||
_buildCancelButton(),
|
_mailboxAction?.getTitle(context) ?? '',
|
||||||
|
maxLines: 1,
|
||||||
|
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||||
|
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
color: AppColor.colorNameEmail,
|
||||||
|
fontWeight: FontWeight.w700))),
|
||||||
|
_buildCancelButton(context),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCancelButton() {
|
Widget _buildCancelButton(BuildContext context) {
|
||||||
if (_mailboxAction == MailboxActions.moveEmail || _mailboxAction == MailboxActions.move) {
|
if (_mailboxAction == MailboxActions.moveEmail ||
|
||||||
|
_mailboxAction == MailboxActions.move ||
|
||||||
|
_mailboxAction == MailboxActions.select) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(right: 12),
|
padding: const EdgeInsets.only(right: 12),
|
||||||
child: Material(
|
child: Material(
|
||||||
@@ -55,9 +62,11 @@ class AppBarDestinationPickerBuilder {
|
|||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(_context).cancel,
|
AppLocalizations.of(context).cancel,
|
||||||
style: const TextStyle(fontSize: 17, color: AppColor.colorTextButton)),
|
style: const TextStyle(
|
||||||
onPressed: () => _onCloseActionClick?.call()
|
fontSize: 17,
|
||||||
|
color: AppColor.colorTextButton)),
|
||||||
|
onPressed: () => onCloseAction?.call()
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
@@ -65,23 +74,16 @@ class AppBarDestinationPickerBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBackButton() {
|
Widget _buildBackButton(BuildContext context, ImagePaths imagePaths) {
|
||||||
if (_mailboxAction == MailboxActions.create) {
|
if (_mailboxAction == MailboxActions.create) {
|
||||||
return buildIconWeb(
|
return buildIconWeb(
|
||||||
icon: SvgPicture.asset(_imagePaths.icBack, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
icon: SvgPicture.asset(
|
||||||
onTap: () => _onCloseActionClick?.call());
|
imagePaths.icBack,
|
||||||
|
color: AppColor.colorTextButton,
|
||||||
|
fit: BoxFit.fill),
|
||||||
|
onTap: () => onCloseAction?.call());
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox(width: 100, height: 40);
|
return const SizedBox(width: 70, height: 40);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildTitle() {
|
|
||||||
return Text(
|
|
||||||
_mailboxAction?.getTitle(_context) ?? '',
|
|
||||||
maxLines: 1,
|
|
||||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
|
||||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: const TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -140,8 +140,14 @@ class MailboxCreatorController extends BaseController {
|
|||||||
arguments: DestinationPickerArguments(accountId!, MailboxActions.create)
|
arguments: DestinationPickerArguments(accountId!, MailboxActions.create)
|
||||||
);
|
);
|
||||||
|
|
||||||
selectedMailbox.value = destinationMailbox;
|
if (destinationMailbox is PresentationMailbox) {
|
||||||
_createListMailboxNameAsStringInMailboxLocation();
|
final mailboxDestination = destinationMailbox == PresentationMailbox.unifiedMailbox
|
||||||
|
? null
|
||||||
|
: destinationMailbox;
|
||||||
|
|
||||||
|
selectedMailbox.value = mailboxDestination;
|
||||||
|
_createListMailboxNameAsStringInMailboxLocation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,12 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
|||||||
SizedBox(child: _buildBody(context), width: ResponsiveUtils.defaultSizeDrawer),
|
SizedBox(child: _buildBody(context), width: ResponsiveUtils.defaultSizeDrawer),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
|
landscapeTablet: Row(children: [
|
||||||
|
SizedBox(child: _buildBody(context), width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
|
]),
|
||||||
tabletLarge: Row(children: [
|
tabletLarge: Row(children: [
|
||||||
SizedBox(child: _buildBody(context), width: ResponsiveUtils.defaultSizeDrawer),
|
SizedBox(child: _buildBody(context), width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
desktop: Row(children: [
|
desktop: Row(children: [
|
||||||
|
|||||||
+10
-7
@@ -111,23 +111,26 @@ class AdvancedFilterController extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> selectedMailBox() async {
|
void selectedMailBox() async {
|
||||||
final PresentationMailbox destinationMailbox = await push(
|
final destinationMailbox = await push(
|
||||||
AppRoutes.DESTINATION_PICKER,
|
AppRoutes.DESTINATION_PICKER,
|
||||||
arguments: DestinationPickerArguments(
|
arguments: DestinationPickerArguments(
|
||||||
_mailboxDashBoardController.accountId.value!,
|
_mailboxDashBoardController.accountId.value!,
|
||||||
MailboxActions.select));
|
MailboxActions.select));
|
||||||
searchController.updateFilterEmail(mailbox: destinationMailbox);
|
|
||||||
mailBoxFilterInputController.text =
|
if (destinationMailbox is PresentationMailbox) {
|
||||||
StringConvert.writeNullToEmpty(destinationMailbox.name?.name);
|
searchController.updateFilterEmail(mailbox: destinationMailbox);
|
||||||
|
mailBoxFilterInputController.text =
|
||||||
|
StringConvert.writeNullToEmpty(destinationMailbox.name?.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyAdvancedSearchFilter(BuildContext context) {
|
void applyAdvancedSearchFilter(BuildContext context) {
|
||||||
_updateFilterEmailFromAdvancedSearchView();
|
_updateFilterEmailFromAdvancedSearchView();
|
||||||
|
searchController.isAdvancedSearchHasApply.value = _checkAdvancedSearchHasApply();
|
||||||
|
searchController.isAdvancedSearchViewOpen.toggle();
|
||||||
_mailboxDashBoardController.searchEmail(
|
_mailboxDashBoardController.searchEmail(
|
||||||
context, StringConvert.writeNullToEmpty(searchEmailFilter.text?.value));
|
context, StringConvert.writeNullToEmpty(searchEmailFilter.text?.value));
|
||||||
searchController.isAdvancedSearchViewOpen.toggle();
|
|
||||||
searchController.isAdvancedSearchHasApply.value = _checkAdvancedSearchHasApply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _checkContactPermission() async {
|
void _checkContactPermission() async {
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ class SearchEmailFilter {
|
|||||||
Filter mappingToEmailFilterCondition({Filter? moreFilterCondition}) {
|
Filter mappingToEmailFilterCondition({Filter? moreFilterCondition}) {
|
||||||
final emailEmailFilterConditionShared = EmailFilterCondition(
|
final emailEmailFilterConditionShared = EmailFilterCondition(
|
||||||
text: text?.value,
|
text: text?.value,
|
||||||
inMailbox: mailbox?.id,
|
inMailbox: mailbox == PresentationMailbox.unifiedMailbox
|
||||||
|
? null
|
||||||
|
: mailbox?.id,
|
||||||
after: emailReceiveTimeType.toUTCDate(),
|
after: emailReceiveTimeType.toUTCDate(),
|
||||||
hasAttachment: hasAttachment == false ? null : hasAttachment,
|
hasAttachment: hasAttachment == false ? null : hasAttachment,
|
||||||
subject: subject,
|
subject: subject,
|
||||||
|
|||||||
+1
-3
@@ -71,9 +71,7 @@ class AdvancedSearchInputForm extends GetWidget<AdvancedFilterController>
|
|||||||
currentFocusNode: controller.focusManager.mailboxFieldFocusNode,
|
currentFocusNode: controller.focusManager.mailboxFieldFocusNode,
|
||||||
nextFocusNode: controller.focusManager.attachmentCheckboxFocusNode,
|
nextFocusNode: controller.focusManager.attachmentCheckboxFocusNode,
|
||||||
mouseCursor: SystemMouseCursors.click,
|
mouseCursor: SystemMouseCursors.click,
|
||||||
onTap: () async {
|
onTap: () => controller.selectedMailBox()),
|
||||||
await controller.selectedMailBox();
|
|
||||||
}),
|
|
||||||
_buildFilterField(
|
_buildFilterField(
|
||||||
textEditingController: controller.dateFilterInputController,
|
textEditingController: controller.dateFilterInputController,
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
Reference in New Issue
Block a user