TF-2537 Fix app crash when user trying attach file to composer in web app
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -1,5 +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:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -58,18 +59,25 @@ class AttachmentItemComposerWidget extends StatelessWidget with AppLoaderMixin {
|
||||
),
|
||||
const SizedBox(width: AttachmentItemComposerWidgetStyle.space),
|
||||
Expanded(
|
||||
child: ExtendedText(
|
||||
fileState.fileName,
|
||||
maxLines: 1,
|
||||
overflowWidget: const TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
child: Text(
|
||||
'...',
|
||||
style: AttachmentItemComposerWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
style: AttachmentItemComposerWidgetStyle.labelTextStyle,
|
||||
),
|
||||
child: PlatformInfo.isCanvasKit
|
||||
? ExtendedText(
|
||||
fileState.fileName,
|
||||
maxLines: 1,
|
||||
overflowWidget: const TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
child: Text(
|
||||
'...',
|
||||
style: AttachmentItemComposerWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
style: AttachmentItemComposerWidgetStyle.labelTextStyle,
|
||||
)
|
||||
: Text(
|
||||
fileState.fileName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AttachmentItemComposerWidgetStyle.labelTextStyle,
|
||||
)
|
||||
),
|
||||
const SizedBox(width: AttachmentItemComposerWidgetStyle.space),
|
||||
Text(
|
||||
|
||||
@@ -57,7 +57,7 @@ class RecipientTagItemWidget extends StatelessWidget {
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
top: PlatformInfo.isWebMobile ? 0 : 8
|
||||
top: !PlatformInfo.isCanvasKit ? 0 : 8
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () => isCollapsed
|
||||
@@ -158,10 +158,10 @@ class RecipientTagItemWidget extends StatelessWidget {
|
||||
}
|
||||
|
||||
EdgeInsetsGeometry? get _counterMargin {
|
||||
if (PlatformInfo.isWebMobile) {
|
||||
return RecipientTagItemWidgetStyle.webMobileCounterMargin;
|
||||
} else if (PlatformInfo.isWeb) {
|
||||
return RecipientTagItemWidgetStyle.webCounterMargin;
|
||||
if (PlatformInfo.isWeb) {
|
||||
return PlatformInfo.isCanvasKit
|
||||
? RecipientTagItemWidgetStyle.webCounterMargin
|
||||
: RecipientTagItemWidgetStyle.webMobileCounterMargin;
|
||||
} else {
|
||||
return RecipientTagItemWidgetStyle.counterMargin;
|
||||
}
|
||||
|
||||
@@ -53,18 +53,25 @@ class AttachmentItemWidget extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: AttachmentItemWidgetStyle.space),
|
||||
Expanded(
|
||||
child: ExtendedText(
|
||||
(attachment.name ?? ''),
|
||||
maxLines: 1,
|
||||
overflowWidget: const TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
child: Text(
|
||||
"...",
|
||||
style: AttachmentItemWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
style: AttachmentItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
child: PlatformInfo.isCanvasKit
|
||||
? ExtendedText(
|
||||
(attachment.name ?? ''),
|
||||
maxLines: 1,
|
||||
overflowWidget: const TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
child: Text(
|
||||
"...",
|
||||
style: AttachmentItemWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
style: AttachmentItemWidgetStyle.labelTextStyle,
|
||||
)
|
||||
: Text(
|
||||
(attachment.name ?? ''),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AttachmentItemWidgetStyle.labelTextStyle,
|
||||
)
|
||||
),
|
||||
const SizedBox(width: AttachmentItemWidgetStyle.space),
|
||||
Text(
|
||||
|
||||
+19
-10
@@ -1,6 +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:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -46,18 +47,26 @@ class AttachmentListItemWidget extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ExtendedText(
|
||||
(attachment.name ?? ''),
|
||||
maxLines: 1,
|
||||
overflowWidget: const TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
child: Text(
|
||||
"...",
|
||||
style: AttachmentListItemWidgetStyle.dotsLabelTextStyle,
|
||||
if (PlatformInfo.isCanvasKit)
|
||||
ExtendedText(
|
||||
(attachment.name ?? ''),
|
||||
maxLines: 1,
|
||||
overflowWidget: const TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
child: Text(
|
||||
"...",
|
||||
style: AttachmentListItemWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
style: AttachmentListItemWidgetStyle.labelTextStyle,
|
||||
)
|
||||
else
|
||||
Text(
|
||||
(attachment.name ?? ''),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AttachmentListItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
style: AttachmentListItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
const SizedBox(height: AttachmentListItemWidgetStyle.fileTitleBottomSpace),
|
||||
Text(
|
||||
filesize(attachment.size?.value),
|
||||
|
||||
+20
-12
@@ -1,4 +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:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -43,20 +44,27 @@ class FeedbackDraggableAttachmentItemWidget extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: FeedbackDraggableAttachmentItemWidgetStyle.space),
|
||||
Flexible(
|
||||
child: DefaultTextStyle(
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.labelTextStyle,
|
||||
child: ExtendedText(
|
||||
attachment.name ?? '',
|
||||
maxLines: 1,
|
||||
overflowWidget: const TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
child: Text(
|
||||
'...',
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.dotsLabelTextStyle,
|
||||
child: PlatformInfo.isCanvasKit
|
||||
? DefaultTextStyle(
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.labelTextStyle,
|
||||
child: ExtendedText(
|
||||
attachment.name ?? '',
|
||||
maxLines: 1,
|
||||
overflowWidget: const TextOverflowWidget(
|
||||
position: TextOverflowPosition.middle,
|
||||
child: Text(
|
||||
'...',
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.dotsLabelTextStyle,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
attachment.name ?? '',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: FeedbackDraggableAttachmentItemWidgetStyle.labelTextStyle,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user