From 9d3923991acdafbc91402d28f58612af225547ec Mon Sep 17 00:00:00 2001 From: dab246 Date: Thu, 7 Aug 2025 16:31:03 +0700 Subject: [PATCH] TF-3952 Change `Select all` button style Signed-off-by: dab246 --- .../widgets/list_email_forward_widget.dart | 143 ++++++++---------- 1 file changed, 60 insertions(+), 83 deletions(-) diff --git a/lib/features/manage_account/presentation/forward/widgets/list_email_forward_widget.dart b/lib/features/manage_account/presentation/forward/widgets/list_email_forward_widget.dart index ce843ac89..87195b59b 100644 --- a/lib/features/manage_account/presentation/forward/widgets/list_email_forward_widget.dart +++ b/lib/features/manage_account/presentation/forward/widgets/list_email_forward_widget.dart @@ -1,8 +1,7 @@ import 'package:core/presentation/extensions/color_extension.dart'; import 'package:core/presentation/utils/theme_utils.dart'; -import 'package:core/presentation/views/button/icon_button_web.dart'; +import 'package:core/presentation/views/button/tmail_button_widget.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:get/get.dart'; import 'package:model/extensions/email_address_extension.dart'; import 'package:model/mailbox/select_mode.dart'; @@ -51,94 +50,72 @@ class ListEmailForwardsWidget extends GetWidget { } Widget _buildTitleHeader(BuildContext context) { - return Obx(() => Container( + return Container( width: double.infinity, - color: Colors.transparent, - height: 44, - padding: const EdgeInsets.only(right: 12), - child: Row(children: [ - if (controller.selectionMode.value == SelectMode.ACTIVE) - _buildCancelSectionButton(context), - if (!controller.isAllSelected) - _buildSelectAllButton(context), - const Spacer(), - const SizedBox(width: 12), - if (controller.listRecipientForwardSelected.isNotEmpty) - _buildDeleteAllButton(context) - ]), - )); - } - - Widget _buildSelectAllButton(BuildContext context) { - return Material( - color: Colors.transparent, - child: InkWell( - customBorder: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))), - onTap: controller.selectAllRecipientForward, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12), - child: Text( - AppLocalizations.of(context).select_all, - style: ThemeUtils.defaultTextStyleInterFont.copyWith( - fontSize: 15, - fontWeight: FontWeight.normal, - color: AppColor.colorTextButton - ) - ), + padding: const EdgeInsetsDirectional.only(end: 12, top: 32, bottom: 16), + child: Obx( + () => Row( + children: [ + if (controller.selectionMode.value == SelectMode.ACTIVE) + _buildCancelSectionButton(context), + if (!controller.isAllSelected) + _buildSelectAllButton(context), + const Spacer(), + if (controller.listRecipientForwardSelected.isNotEmpty) + _buildDeleteAllButton(context) + ], ), - ) - ); - } - - Widget _buildCancelSectionButton(BuildContext context) { - return Padding( - padding: const EdgeInsets.only(right: 8), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - buildIconWeb( - icon: SvgPicture.asset( - controller.imagePaths.icClose, - colorFilter: AppColor.colorTextButton.asFilter(), - fit: BoxFit.fill), - tooltip: AppLocalizations.of(context).cancel, - onTap: controller.cancelSelectionMode - ), - Text( - controller.isAllSelected - ? AppLocalizations.of(context).totalEmailSelected(controller.listRecipientForwardSelected.length) - : AppLocalizations.of(context).count_email_selected(controller.listRecipientForwardSelected.length), - style: ThemeUtils.defaultTextStyleInterFont.copyWith( - fontSize: 15, - fontWeight: FontWeight.normal, - color: AppColor.colorTextButton - ) - ) - ], ), ); } + Widget _buildSelectAllButton(BuildContext context) { + return TMailButtonWidget.fromText( + text: AppLocalizations.of(context).select_all, + textStyle: ThemeUtils.textStyleInter600().copyWith( + letterSpacing: 0.25, + fontSize: 14, + height: 20 / 14, + color: AppColor.gray424244, + ), + backgroundColor: Colors.transparent, + onTapActionCallback: controller.selectAllRecipientForward, + ); + } + + Widget _buildCancelSectionButton(BuildContext context) { + return TMailButtonWidget( + text: controller.isAllSelected + ? AppLocalizations.of(context).totalEmailSelected(controller.listRecipientForwardSelected.length) + : AppLocalizations.of(context).count_email_selected(controller.listRecipientForwardSelected.length), + textStyle: ThemeUtils.textStyleInter600().copyWith( + letterSpacing: 0.25, + fontSize: 14, + height: 20 / 14, + color: AppColor.gray424244, + ), + icon: controller.imagePaths.icClose, + iconSize: 20, + iconColor: AppColor.gray424244, + backgroundColor: Colors.transparent, + onTapActionCallback: controller.cancelSelectionMode, + ); + } + Widget _buildDeleteAllButton(BuildContext context) { - return Material( - color: Colors.transparent, - child: InkWell( - customBorder: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))), - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 6), - child: Text( - AppLocalizations.of(context).remove, - style: ThemeUtils.defaultTextStyleInterFont.copyWith( - fontSize: 15, - fontWeight: FontWeight.normal, - color: AppColor.colorDeletePermanentlyButton - ) - ), - ), - onTap: () => controller.deleteMultipleRecipients( - context, - controller.listRecipientForwardSelected.listEmailAddress) - ) + return TMailButtonWidget.fromText( + text: AppLocalizations.of(context).remove, + textStyle: ThemeUtils.textStyleInter600().copyWith( + letterSpacing: 0.25, + fontSize: 14, + height: 20 / 14, + color: AppColor.redFF3347, + ), + backgroundColor: Colors.transparent, + onTapActionCallback: () => controller.deleteMultipleRecipients( + context, + controller.listRecipientForwardSelected.listEmailAddress, + ), ); } } \ No newline at end of file