TF-1957 Fix name of attachments are reversed in RTL mode

(cherry picked from commit 8f8efa90f6f2488867b236261cc27145d7e9716f)
This commit is contained in:
dab246
2023-07-06 16:19:15 +07:00
committed by Dat Vu
parent 80de2599ae
commit 657afb67b9
12 changed files with 113 additions and 59 deletions
@@ -1,10 +1,14 @@
import 'package:core/core.dart';
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/resources/image_paths.dart';
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:core/presentation/utils/style_utils.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';
import 'package:get/get.dart';
import 'package:model/model.dart';
import 'package:model/email/attachment.dart';
import 'package:tmail_ui_user/features/email/presentation/extensions/attachment_extension.dart';
typedef OnDownloadAttachmentFileActionClick = void Function(Attachment attachment);
@@ -52,30 +56,44 @@ class AttachmentFileTileBuilder extends StatelessWidget{
fit: BoxFit.fill),
const SizedBox(width: 8),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_attachment.name ?? '',
maxLines: 1,
overflow: CommonTextStyle.defaultTextOverFlow,
softWrap: CommonTextStyle.defaultSoftWrap,
style: const TextStyle(
fontSize: 14,
color: AppColor.attachmentFileNameColor,
fontWeight: FontWeight.normal),
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ExtendedText(
(_attachment.name ?? ''),
maxLines: 1,
overflow: CommonTextStyle.defaultTextOverFlow,
softWrap: CommonTextStyle.defaultSoftWrap,
overflowWidget: TextOverflowWidget(
position: Directionality.maybeOf(context) == TextDirection.rtl
? TextOverflowPosition.start
: TextOverflowPosition.end,
child: const Text(
"...",
style: TextStyle(
fontSize: 12,
color: AppColor.attachmentFileNameColor,
fontWeight: FontWeight.normal
),
),
const SizedBox(height: 4),
Text(
filesize(_attachment.size?.value),
maxLines: 1,
overflow: CommonTextStyle.defaultTextOverFlow,
softWrap: CommonTextStyle.defaultSoftWrap,
style: const TextStyle(
fontSize: 12,
color: AppColor.attachmentFileSizeColor,
fontWeight: FontWeight.normal),
)
]
),
style: const TextStyle(
fontSize: 14,
color: AppColor.attachmentFileNameColor,
fontWeight: FontWeight.normal
),
),
const SizedBox(height: 4),
Text(
filesize(_attachment.size?.value),
maxLines: 1,
overflow: CommonTextStyle.defaultTextOverFlow,
softWrap: CommonTextStyle.defaultSoftWrap,
style: const TextStyle(
fontSize: 12,
color: AppColor.attachmentFileSizeColor,
fontWeight: FontWeight.normal),
)
]
))
]),
),