TF-4013 Fix the issue where recipients cannot be moved during drag & drop and ellipsize the text.
(cherry picked from commit 033ba2aaee3acae9c4adcfd791832e9adee0efdc)
This commit is contained in:
+4
@@ -32,15 +32,19 @@ extension RemoveDraggableEmailAddressBetweenRecipientFieldsExtension on Composer
|
||||
switch(draggableEmailAddress.filterField) {
|
||||
case FilterField.to:
|
||||
controller.listToEmailAddress.remove(draggableEmailAddress.emailAddress);
|
||||
controller.toRecipientState.refresh();
|
||||
break;
|
||||
case FilterField.cc:
|
||||
controller.listCcEmailAddress.remove(draggableEmailAddress.emailAddress);
|
||||
controller.ccRecipientState.refresh();
|
||||
break;
|
||||
case FilterField.bcc:
|
||||
controller.listBccEmailAddress.remove(draggableEmailAddress.emailAddress);
|
||||
controller.bccRecipientState.refresh();
|
||||
break;
|
||||
case FilterField.replyTo:
|
||||
controller.listReplyToEmailAddress.remove(draggableEmailAddress.emailAddress);
|
||||
controller.replyToRecipientState.refresh();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:extended_text/extended_text.dart';
|
||||
import 'package:core/presentation/views/text/middle_ellipsis_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -70,27 +69,11 @@ class AttachmentItemComposerWidget extends StatelessWidget with AppLoaderMixin {
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
const SizedBox(width: AttachmentItemComposerWidgetStyle.space),
|
||||
Expanded(
|
||||
child: PlatformInfo.isCanvasKit
|
||||
? ExtendedText(
|
||||
fileName,
|
||||
maxLines: 1,
|
||||
overflowWidget: TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
clearType: TextOverflowClearType.clipRect,
|
||||
child: Text(
|
||||
'...',
|
||||
style: AttachmentItemComposerWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
style: AttachmentItemComposerWidgetStyle.labelTextStyle,
|
||||
)
|
||||
: Text(
|
||||
fileName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AttachmentItemComposerWidgetStyle.labelTextStyle,
|
||||
)
|
||||
Flexible(
|
||||
child: MiddleEllipsisText(
|
||||
fileName,
|
||||
style: AttachmentItemComposerWidgetStyle.labelTextStyle,
|
||||
)
|
||||
),
|
||||
const SizedBox(width: AttachmentItemComposerWidgetStyle.space),
|
||||
Text(
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:core/presentation/extensions/string_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/theme_utils.dart';
|
||||
import 'package:core/presentation/views/avatar/gradient_circle_avatar_icon.dart';
|
||||
import 'package:extended_text/extended_text.dart';
|
||||
import 'package:core/presentation/views/text/middle_ellipsis_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
@@ -47,22 +47,8 @@ class DraggableRecipientTagWidget extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Flexible(
|
||||
child: ExtendedText(
|
||||
child: MiddleEllipsisText(
|
||||
emailAddress.asString(),
|
||||
maxLines: 1,
|
||||
overflowWidget: TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
clearType: TextOverflowClearType.clipRect,
|
||||
child: Text(
|
||||
'...',
|
||||
style: ThemeUtils.textStyleInter400.copyWith(
|
||||
color: Colors.white,
|
||||
fontSize: 17,
|
||||
height: 1.0,
|
||||
letterSpacing: -0.17,
|
||||
),
|
||||
),
|
||||
),
|
||||
style: ThemeUtils.textStyleInter400.copyWith(
|
||||
color: Colors.white,
|
||||
fontSize: 17,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/extensions/string_extension.dart';
|
||||
import 'package:core/presentation/views/avatar/gradient_circle_avatar_icon.dart';
|
||||
import 'package:extended_text/extended_text.dart';
|
||||
import 'package:core/presentation/views/text/middle_ellipsis_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:model/extensions/email_address_extension.dart';
|
||||
@@ -40,17 +40,8 @@ class RecipientCollapsedItemWidget extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Flexible(
|
||||
child: ExtendedText(
|
||||
child: MiddleEllipsisText(
|
||||
emailAddress.asString(),
|
||||
maxLines: 1,
|
||||
overflowWidget: TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
clearType: TextOverflowClearType.clipRect,
|
||||
child: Text(
|
||||
'...',
|
||||
style: RecipientTagItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
),
|
||||
style: RecipientTagItemWidgetStyle.labelTextStyle,
|
||||
)
|
||||
),
|
||||
|
||||
@@ -284,7 +284,11 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
|
||||
builder: (context, candidateData, rejectedData) {
|
||||
return tagEditor;
|
||||
},
|
||||
onAcceptWithDetails: (draggableEmailAddress) => _handleAcceptDraggableEmailAddressAction(draggableEmailAddress.data, stateSetter),
|
||||
onAcceptWithDetails: (draggableEmailAddress) =>
|
||||
_handleAcceptDraggableEmailAddressAction(
|
||||
draggableEmailAddress.data,
|
||||
stateSetter,
|
||||
),
|
||||
onLeave: (draggableEmailAddress) {
|
||||
if (_isDragging) {
|
||||
stateSetter(() => _isDragging = false);
|
||||
|
||||
@@ -3,8 +3,8 @@ import 'package:core/presentation/extensions/string_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/views/avatar/gradient_circle_avatar_icon.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:core/presentation/views/text/middle_ellipsis_text.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:extended_text/extended_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:model/email/prefix_email_address.dart';
|
||||
@@ -115,18 +115,9 @@ class RecipientTagItemWidget extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Flexible(
|
||||
child: ExtendedText(
|
||||
child: MiddleEllipsisText(
|
||||
key: Key('label_recipient_tag_item_${prefix.name}_$index'),
|
||||
currentEmailAddress.asString(),
|
||||
maxLines: 1,
|
||||
overflowWidget: TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
clearType: TextOverflowClearType.clipRect,
|
||||
child: Text(
|
||||
'...',
|
||||
style: RecipientTagItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
),
|
||||
style: RecipientTagItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -3,8 +3,8 @@ import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/theme_utils.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:core/presentation/views/container/tmail_container_widget.dart';
|
||||
import 'package:core/presentation/views/text/middle_ellipsis_text.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:extended_text/extended_text.dart';
|
||||
import 'package:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -62,19 +62,8 @@ class AttachmentItemWidget extends StatelessWidget {
|
||||
fit: BoxFit.fill,
|
||||
);
|
||||
|
||||
final attachmentTitleWithMiddleDots = ExtendedText(
|
||||
final attachmentTitleWithMiddleDots = MiddleEllipsisText(
|
||||
attachment.generateFileName(),
|
||||
maxLines: 1,
|
||||
overflowWidget: TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
clearType: TextOverflowClearType.clipRect,
|
||||
child: Text(
|
||||
"...",
|
||||
style: ThemeUtils.textStyleM3LabelLarge(
|
||||
color: AppColor.m3SurfaceBackground,
|
||||
),
|
||||
),
|
||||
),
|
||||
style: ThemeUtils.textStyleM3LabelLarge(
|
||||
color: AppColor.m3SurfaceBackground,
|
||||
),
|
||||
|
||||
+5
-23
@@ -1,8 +1,7 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/style_utils.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:extended_text/extended_text.dart';
|
||||
import 'package:core/presentation/views/text/middle_ellipsis_text.dart';
|
||||
import 'package:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -66,27 +65,10 @@ class AttachmentListItemWidget extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (PlatformInfo.isCanvasKit)
|
||||
ExtendedText(
|
||||
(attachment.name ?? ''),
|
||||
maxLines: 1,
|
||||
overflowWidget: TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
clearType: TextOverflowClearType.clipRect,
|
||||
child: Text(
|
||||
"...",
|
||||
style: AttachmentListItemWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
style: AttachmentListItemWidgetStyle.labelTextStyle,
|
||||
)
|
||||
else
|
||||
Text(
|
||||
(attachment.name ?? ''),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AttachmentListItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
MiddleEllipsisText(
|
||||
(attachment.name ?? ''),
|
||||
style: AttachmentListItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
const SizedBox(height: AttachmentListItemWidgetStyle.fileTitleBottomSpace),
|
||||
Text(
|
||||
filesize(attachment.size?.value),
|
||||
|
||||
+5
-24
@@ -1,6 +1,5 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:extended_text/extended_text.dart';
|
||||
import 'package:core/presentation/views/text/middle_ellipsis_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -44,28 +43,10 @@ class FeedbackDraggableAttachmentItemWidget extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: FeedbackDraggableAttachmentItemWidgetStyle.space),
|
||||
Flexible(
|
||||
child: PlatformInfo.isCanvasKit
|
||||
? DefaultTextStyle(
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.labelTextStyle,
|
||||
child: ExtendedText(
|
||||
attachment.name ?? '',
|
||||
maxLines: 1,
|
||||
overflowWidget: TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
clearType: TextOverflowClearType.clipRect,
|
||||
child: Text(
|
||||
'...',
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
attachment.name ?? '',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
child: MiddleEllipsisText(
|
||||
attachment.name ?? '',
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user