TF-46 Compose email from ThreadView
This commit is contained in:
@@ -13,6 +13,7 @@ import 'package:jmap_dart_client/jmap/mail/email/email_comparator_property.dart'
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_filter_condition.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/model/composer_arguments.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/mailbox_dashboard_controller.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/constants/thread_constants.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/state/get_all_email_state.dart';
|
||||
@@ -28,7 +29,7 @@ class ThreadController extends BaseController {
|
||||
|
||||
final _properties = Properties({
|
||||
'id', 'subject', 'from', 'to', 'cc', 'bcc', 'keywords', 'receivedAt',
|
||||
'sentAt', 'preview', 'hasAttachment'
|
||||
'sentAt', 'preview', 'hasAttachment', 'replyTo'
|
||||
});
|
||||
|
||||
final emailList = <PresentationEmail>[].obs;
|
||||
@@ -176,4 +177,14 @@ class ThreadController extends BaseController {
|
||||
void goToEmail(BuildContext context) {
|
||||
Get.toNamed(AppRoutes.EMAIL);
|
||||
}
|
||||
|
||||
void composeEmailAction() {
|
||||
if (mailboxDashBoardController.sessionCurrent != null && mailboxDashBoardController.userProfile.value != null) {
|
||||
Get.toNamed(
|
||||
AppRoutes.COMPOSER,
|
||||
arguments: ComposerArguments(
|
||||
session: mailboxDashBoardController.sessionCurrent!,
|
||||
userProfile: mailboxDashBoardController.userProfile.value!));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,12 @@ class ThreadView extends GetWidget<ThreadController> {
|
||||
)
|
||||
)
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
elevation: 0.0,
|
||||
child: new Icon(Icons.add),
|
||||
backgroundColor: AppColor.appColor,
|
||||
onPressed: () => controller.composeEmailAction()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,20 +102,32 @@ class AppBarThreadWidgetBuilder {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => {
|
||||
if (_onOpenListMailboxActionClick != null) {
|
||||
_onOpenListMailboxActionClick!()
|
||||
}},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 16),
|
||||
child: Text(
|
||||
'${_presentationMailbox?.name != null ? _presentationMailbox?.name?.name : ''}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 22, color: AppColor.titleAppBarMailboxListMail, fontWeight: FontWeight.w500),
|
||||
))),
|
||||
if(_presentationMailbox != null && _presentationMailbox!.getCountUnReadEmails().isNotEmpty)
|
||||
(_presentationMailbox != null && _presentationMailbox!.hasRole())
|
||||
? GestureDetector(
|
||||
onTap: () => {
|
||||
if (_onOpenListMailboxActionClick != null) {
|
||||
_onOpenListMailboxActionClick!()
|
||||
}},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 16),
|
||||
child: Text(
|
||||
'${_presentationMailbox?.name != null ? _presentationMailbox?.name?.name : ''}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 22, color: AppColor.titleAppBarMailboxListMail, fontWeight: FontWeight.w500))))
|
||||
: Expanded(child: GestureDetector(
|
||||
onTap: () => {
|
||||
if (_onOpenListMailboxActionClick != null) {
|
||||
_onOpenListMailboxActionClick!()
|
||||
}},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 16),
|
||||
child: Text(
|
||||
'${_presentationMailbox?.name != null ? _presentationMailbox?.name?.name : ''}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 22, color: AppColor.titleAppBarMailboxListMail, fontWeight: FontWeight.w500))))),
|
||||
if(_presentationMailbox != null && _presentationMailbox!.hasRole() && _presentationMailbox!.getCountUnReadEmails().isNotEmpty)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 9),
|
||||
padding: EdgeInsets.only(left: 8, right: 8, top: 2.5, bottom: 2.5),
|
||||
|
||||
@@ -82,7 +82,7 @@ class EmailTileBuilder {
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 4),
|
||||
child: Text(
|
||||
'${_presentationEmail.getTimeSentEmail('${Localizations.localeOf(_context).languageCode}_${Localizations.localeOf(_context).countryCode}')}',
|
||||
'${_presentationEmail.getTimeSentEmail(Localizations.localeOf(_context).toLanguageTag())}',
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user