TF-4075 Apply new design for attachments view

This commit is contained in:
dab246
2025-10-07 12:49:35 +07:00
committed by Dat H. Pham
parent 7057648b28
commit 6c7331960f
9 changed files with 171 additions and 119 deletions
@@ -4,7 +4,6 @@ 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:filesize/filesize.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -69,26 +68,15 @@ class AttachmentItemWidget extends StatelessWidget {
),
);
final attachmentTitleWithEndDots = Text(
attachment.generateFileName(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: ThemeUtils.textStyleM3LabelLarge(
color: AppColor.m3SurfaceBackground,
),
);
final bodyItemWidget = Row(
children: [
isLoading ? loadingIndicator : attachmentIcon,
const SizedBox(width: 8),
Expanded(
child: PlatformInfo.isCanvasKit
? attachmentTitleWithMiddleDots
: attachmentTitleWithEndDots,
child: attachmentTitleWithMiddleDots,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsetsDirectional.only(start: 8, end: 3),
child: Text(
filesize(attachment.size?.value),
maxLines: 1,
@@ -97,10 +85,10 @@ class AttachmentItemWidget extends StatelessWidget {
),
),
TMailButtonWidget.fromIcon(
icon: imagePaths.icFileDownload,
icon: imagePaths.icDownloadAttachment,
backgroundColor: Colors.transparent,
padding: const EdgeInsets.all(5),
iconColor: AppColor.steelGrayA540,
iconColor: AppColor.primaryColor,
iconSize: 20,
onTapActionCallback:
isLoading ? null : () => _onTapDownloadAction(attachment),