TF-1813 Display list sending email in SendingQueueView
(cherry picked from commit 16699d68fa52d5a8dd450c68c64220def1d6a142)
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/style_utils.dart';
|
||||
import 'package:core/presentation/views/button/icon_button_web.dart';
|
||||
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/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
|
||||
class AppBarSendingQueueWidget extends StatelessWidget {
|
||||
|
||||
final VoidCallback? onBackAction;
|
||||
final VoidCallback? onOpenMailboxMenu;
|
||||
final SelectMode selectMode;
|
||||
|
||||
const AppBarSendingQueueWidget({
|
||||
super.key,
|
||||
this.onBackAction,
|
||||
this.onOpenMailboxMenu,
|
||||
this.selectMode = SelectMode.INACTIVE,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
return Container(
|
||||
height: 52,
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
if (selectMode == SelectMode.INACTIVE)
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
imagePaths.icMenuMailbox,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).openMailboxMenu,
|
||||
onTap: onOpenMailboxMenu
|
||||
)
|
||||
else
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
AppUtils.isDirectionRTL(context) ? imagePaths.icCollapseFolder : imagePaths.icBack,
|
||||
colorFilter: AppColor.colorTextButton.asFilter(),
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
tooltip: AppLocalizations.of(context).back,
|
||||
onTap: onBackAction
|
||||
),
|
||||
Expanded(child: Text(
|
||||
AppLocalizations.of(context).sendingQueue,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
style: const TextStyle(
|
||||
fontSize: 21,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold
|
||||
)
|
||||
)),
|
||||
const SizedBox(width: 50)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
|
||||
class BannerMessageSendingQueueWidget extends StatelessWidget {
|
||||
|
||||
const BannerMessageSendingQueueWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final imagePath = getBinding<ImagePaths>();
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(top: 16, left: 16, right: 16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.colorBannerMessageSendingQueue,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8))
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
imagePath!.icMailboxSendingQueue,
|
||||
fit: BoxFit.fill,
|
||||
width: 20,
|
||||
height: 20,
|
||||
colorFilter: AppColor.colorTitleSendingItem.asFilter(),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: Text(
|
||||
AppLocalizations.of(context).bannerMessageSendingQueueView,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.normal
|
||||
)
|
||||
))
|
||||
]
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/extensions/string_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/style_utils.dart';
|
||||
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:tmail_ui_user/features/composer/domain/model/sending_email.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class SendingEmailTileWidget extends StatelessWidget {
|
||||
|
||||
final SendingEmail sendingEmail;
|
||||
|
||||
const SendingEmailTileWidget({
|
||||
super.key,
|
||||
required this.sendingEmail
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final imagePath = Get.find<ImagePaths>();
|
||||
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => {},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
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,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(children: [
|
||||
Expanded(child: Text(
|
||||
AppLocalizations.of(context).titleRecipientSendingEmail(sendingEmail.presentationEmail.recipientsName()).withUnicodeCharacter,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
color: AppColor.colorTitleSendingItem,
|
||||
fontWeight: FontWeight.w600
|
||||
)
|
||||
)),
|
||||
if (sendingEmail.email.attachments != null && sendingEmail.email.attachments!.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: SvgPicture.asset(
|
||||
imagePath.icAttachment,
|
||||
width: 20,
|
||||
height: 20,
|
||||
fit: BoxFit.fill
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: Text(
|
||||
sendingEmail.getCreateTimeAt(Localizations.localeOf(context).toLanguageTag()),
|
||||
maxLines: 1,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
color: AppColor.colorTitleSendingItem,
|
||||
fontWeight: FontWeight.normal
|
||||
)
|
||||
)
|
||||
)
|
||||
]),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
sendingEmail.presentationEmail.getEmailTitle().withUnicodeCharacter,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
color: AppColor.colorTitleSendingItem,
|
||||
fontWeight: FontWeight.normal
|
||||
)
|
||||
),
|
||||
]
|
||||
))
|
||||
]),
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 84, right: 8),
|
||||
child: Divider(
|
||||
color: AppColor.lineItemListColor,
|
||||
height: 1,
|
||||
thickness: 0.2
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user