TF-1815 Move email improvement
(cherry picked from commit d7884423c0e14697ec2af29e55d39602aa7869f8)
This commit is contained in:
+10
-5
@@ -76,7 +76,7 @@ class DestinationPickerSearchMailboxItemBuilder extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _onTapMailboxAction() {
|
void _onTapMailboxAction() {
|
||||||
if (onClickOpenMailboxAction != null) {
|
if (!_isSelectActionNoValid && onClickOpenMailboxAction != null) {
|
||||||
onClickOpenMailboxAction?.call(_presentationMailbox);
|
onClickOpenMailboxAction?.call(_presentationMailbox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -134,16 +134,14 @@ class DestinationPickerSearchMailboxItemBuilder extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSelectedIcon(BuildContext context) {
|
Widget _buildSelectedIcon(BuildContext context) {
|
||||||
if (_presentationMailbox.id == mailboxIdAlreadySelected &&
|
if (_isSelectActionNoValid) {
|
||||||
(mailboxActions == MailboxActions.select ||
|
|
||||||
mailboxActions == MailboxActions.create)) {
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
right: AppUtils.isDirectionRTL(context) ? 0 : 8,
|
right: AppUtils.isDirectionRTL(context) ? 0 : 8,
|
||||||
left: AppUtils.isDirectionRTL(context) ? 8 : 0,
|
left: AppUtils.isDirectionRTL(context) ? 8 : 0,
|
||||||
),
|
),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
_imagePaths.icFilterSelected,
|
_imagePaths.icSelectedSB,
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
fit: BoxFit.fill
|
fit: BoxFit.fill
|
||||||
@@ -153,4 +151,11 @@ class DestinationPickerSearchMailboxItemBuilder extends StatelessWidget {
|
|||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get _isSelectActionNoValid => _presentationMailbox.id == mailboxIdAlreadySelected &&
|
||||||
|
(
|
||||||
|
mailboxActions == MailboxActions.select ||
|
||||||
|
mailboxActions == MailboxActions.create ||
|
||||||
|
mailboxActions == MailboxActions.moveEmail
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -619,7 +619,12 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
|||||||
final session = mailboxDashBoardController.sessionCurrent;
|
final session = mailboxDashBoardController.sessionCurrent;
|
||||||
|
|
||||||
if (currentMailbox != null && accountId != null) {
|
if (currentMailbox != null && accountId != null) {
|
||||||
final arguments = DestinationPickerArguments(accountId, MailboxActions.moveEmail, session);
|
final arguments = DestinationPickerArguments(
|
||||||
|
accountId,
|
||||||
|
MailboxActions.moveEmail,
|
||||||
|
session,
|
||||||
|
mailboxIdSelected: currentMailbox.mailboxId
|
||||||
|
);
|
||||||
if (BuildUtils.isWeb) {
|
if (BuildUtils.isWeb) {
|
||||||
showDialogDestinationPicker(
|
showDialogDestinationPicker(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@@ -160,7 +160,9 @@ class MailBoxFolderTileBuilder {
|
|||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () => _onOpenMailboxFolderClick?.call(_mailboxNode),
|
onTap: () => !_isSelectActionNoValid
|
||||||
|
? _onOpenMailboxFolderClick?.call(_mailboxNode)
|
||||||
|
: null,
|
||||||
customBorder: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8))),
|
customBorder: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8))),
|
||||||
hoverColor: AppColor.colorMailboxHovered,
|
hoverColor: AppColor.colorMailboxHovered,
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -172,7 +174,8 @@ class MailBoxFolderTileBuilder {
|
|||||||
_buildLeadingMailboxItem(context),
|
_buildLeadingMailboxItem(context),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(child: _buildTitleFolderItem(context, showTrailingItem: false)),
|
Expanded(child: _buildTitleFolderItem(context, showTrailingItem: false)),
|
||||||
_buildSelectedIcon()
|
_buildSelectedIcon(),
|
||||||
|
const SizedBox(width: 8),
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -400,17 +403,22 @@ class MailBoxFolderTileBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSelectedIcon() {
|
Widget _buildSelectedIcon() {
|
||||||
if (_mailboxNode.item.id == mailboxIdAlreadySelected &&
|
if (_isSelectActionNoValid) {
|
||||||
mailboxDisplayed == MailboxDisplayed.destinationPicker &&
|
|
||||||
(mailboxActions == MailboxActions.select ||
|
|
||||||
mailboxActions == MailboxActions.create)) {
|
|
||||||
return SvgPicture.asset(
|
return SvgPicture.asset(
|
||||||
_imagePaths.icFilterSelected,
|
_imagePaths.icSelectedSB,
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
fit: BoxFit.fill);
|
fit: BoxFit.fill);
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get _isSelectActionNoValid => _mailboxNode.item.id == mailboxIdAlreadySelected &&
|
||||||
|
mailboxDisplayed == MailboxDisplayed.destinationPicker &&
|
||||||
|
(
|
||||||
|
mailboxActions == MailboxActions.select ||
|
||||||
|
mailboxActions == MailboxActions.create ||
|
||||||
|
mailboxActions == MailboxActions.moveEmail
|
||||||
|
);
|
||||||
}
|
}
|
||||||
+2
-1
@@ -750,7 +750,8 @@ class MailboxDashBoardController extends ReloadableController {
|
|||||||
final arguments = DestinationPickerArguments(
|
final arguments = DestinationPickerArguments(
|
||||||
accountId.value!,
|
accountId.value!,
|
||||||
MailboxActions.moveEmail,
|
MailboxActions.moveEmail,
|
||||||
sessionCurrent);
|
sessionCurrent,
|
||||||
|
mailboxIdSelected: currentMailbox.mailboxId);
|
||||||
|
|
||||||
if (BuildUtils.isWeb) {
|
if (BuildUtils.isWeb) {
|
||||||
showDialogDestinationPicker(
|
showDialogDestinationPicker(
|
||||||
|
|||||||
@@ -125,7 +125,11 @@ mixin EmailActionController on ViewAsDialogActionMixin {
|
|||||||
final session = mailboxDashBoardController.sessionCurrent;
|
final session = mailboxDashBoardController.sessionCurrent;
|
||||||
|
|
||||||
if (mailboxContain != null && accountId != null) {
|
if (mailboxContain != null && accountId != null) {
|
||||||
final arguments = DestinationPickerArguments(accountId, MailboxActions.moveEmail, session);
|
final arguments = DestinationPickerArguments(
|
||||||
|
accountId,
|
||||||
|
MailboxActions.moveEmail,
|
||||||
|
session,
|
||||||
|
mailboxIdSelected: mailboxContain.mailboxId);
|
||||||
|
|
||||||
if (BuildUtils.isWeb) {
|
if (BuildUtils.isWeb) {
|
||||||
showDialogDestinationPicker(
|
showDialogDestinationPicker(
|
||||||
|
|||||||
Reference in New Issue
Block a user