TF-1866 Implement delete sending email in Sending Queue
(cherry picked from commit 0b45b10231fd4ec4fd7936c71de6cdcda0e92d02)
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:model/mailbox/select_mode.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/model/sending_email.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
|
||||
@@ -15,12 +16,14 @@ class AppBarSendingQueueWidget extends StatelessWidget {
|
||||
final VoidCallback? onBackAction;
|
||||
final VoidCallback? onOpenMailboxMenu;
|
||||
final SelectMode selectMode;
|
||||
final List<SendingEmail> listSendingEmails;
|
||||
|
||||
const AppBarSendingQueueWidget({
|
||||
super.key,
|
||||
required this.listSendingEmails,
|
||||
this.onBackAction,
|
||||
this.onOpenMailboxMenu,
|
||||
this.selectMode = SelectMode.INACTIVE,
|
||||
this.selectMode = SelectMode.INACTIVE
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -44,14 +47,40 @@ class AppBarSendingQueueWidget extends StatelessWidget {
|
||||
onTap: onOpenMailboxMenu
|
||||
)
|
||||
else
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
AppUtils.isDirectionRTL(context) ? imagePaths.icCollapseFolder : imagePaths.icBack,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
child: InkWell(
|
||||
onTap: onBackAction,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
AppUtils.isDirectionRTL(context) ? imagePaths.icCollapseFolder : imagePaths.icBack,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
listSendingEmails.length.toString(),
|
||||
maxLines: 1,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
style: const TextStyle(
|
||||
fontSize: 17,
|
||||
color: AppColor.colorTextButton
|
||||
)
|
||||
)
|
||||
]
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).back,
|
||||
onTap: onBackAction
|
||||
),
|
||||
Expanded(child: Text(
|
||||
AppLocalizations.of(context).sendingQueue,
|
||||
|
||||
@@ -6,17 +6,26 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:model/extensions/presentation_email_extension.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:model/mailbox/select_mode.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/model/sending_email.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
typedef OnLongPressSendingEmailItemAction = void Function(SendingEmail);
|
||||
typedef OnSelectSendingEmailItemAction = void Function(SendingEmail);
|
||||
|
||||
class SendingEmailTileWidget extends StatelessWidget {
|
||||
|
||||
final SendingEmail sendingEmail;
|
||||
final SelectMode selectMode;
|
||||
final OnLongPressSendingEmailItemAction? onLongPressAction;
|
||||
final OnSelectSendingEmailItemAction? onSelectAction;
|
||||
|
||||
const SendingEmailTileWidget({
|
||||
super.key,
|
||||
required this.sendingEmail
|
||||
required this.sendingEmail,
|
||||
required this.selectMode,
|
||||
this.onLongPressAction,
|
||||
this.onSelectAction
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -27,6 +36,7 @@ class SendingEmailTileWidget extends StatelessWidget {
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => {},
|
||||
onLongPress: () => onLongPressAction?.call(sendingEmail),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -34,14 +44,36 @@ class SendingEmailTileWidget extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
sendingEmail.presentationEmail.numberOfAllEmailAddress() == 1
|
||||
? imagePath.icAvatarPersonal
|
||||
: imagePath.icAvatarGroup,
|
||||
fit: BoxFit.fill,
|
||||
width: 60,
|
||||
height: 60,
|
||||
),
|
||||
if (selectMode == SelectMode.ACTIVE)
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(Radius.circular(30))
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: SvgPicture.asset(
|
||||
sendingEmail.isSelected
|
||||
? imagePath.icSelected
|
||||
: imagePath.icUnSelected,
|
||||
fit: BoxFit.fill,
|
||||
width: 24,
|
||||
height: 24
|
||||
),
|
||||
),
|
||||
onTap: () => onSelectAction?.call(sendingEmail),
|
||||
)
|
||||
else
|
||||
SvgPicture.asset(
|
||||
sendingEmail.presentationEmail.numberOfAllEmailAddress() == 1
|
||||
? imagePath.icAvatarPersonal
|
||||
: imagePath.icAvatarGroup,
|
||||
fit: BoxFit.fill,
|
||||
width: 60,
|
||||
height: 60,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
Reference in New Issue
Block a user