TF-4229 Add widget for label search field
This commit is contained in:
@@ -13,6 +13,7 @@ enum FilterField {
|
||||
mailBox,
|
||||
date,
|
||||
sortBy,
|
||||
labels,
|
||||
hasAttachment,
|
||||
deletionDate,
|
||||
receptionDate,
|
||||
@@ -49,6 +50,8 @@ enum FilterField {
|
||||
return appLocalizations.headerRecipients;
|
||||
case FilterField.sender:
|
||||
return appLocalizations.sender;
|
||||
case FilterField.labels:
|
||||
return appLocalizations.labels;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@@ -77,6 +80,8 @@ enum FilterField {
|
||||
case FilterField.recipients:
|
||||
case FilterField.sender:
|
||||
return appLocalizations.addAnEmailAddress;
|
||||
case FilterField.labels:
|
||||
return appLocalizations.allLabels;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -897,7 +897,7 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
||||
pressEmailAction(actionType, presentationEmail);
|
||||
break;
|
||||
case EmailActionType.labelAs:
|
||||
if (!isLabelFeatureEnabled) return;
|
||||
if (!isLabelAvailable) return;
|
||||
openAddLabelToEmailDialogModal(presentationEmail);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -41,6 +41,7 @@ import 'package:tmail_ui_user/features/email/presentation/widgets/information_se
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/mail_unsubscribed_banner.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/view_entire_message_with_message_clipped_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/handle_open_context_menu_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/verify_display_overlay_view_on_iframe_extension.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/extensions/vacation_response_extension.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/vacation/widgets/vacation_notification_message_widget.dart';
|
||||
@@ -103,7 +104,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
handleEmailAction: controller.handleEmailAction,
|
||||
additionalActions: [],
|
||||
emailIsRead: presentationEmail.hasRead,
|
||||
isLabelFeatureEnabled: controller.isLabelFeatureEnabled,
|
||||
isLabelFeatureEnabled: controller.isLabelAvailable,
|
||||
labels: controller.mailboxDashBoardController.labelController.labels,
|
||||
openBottomSheetContextMenu: controller.mailboxDashBoardController.openBottomSheetContextMenu,
|
||||
openPopupMenu: controller.mailboxDashBoardController.openPopupMenuActionGroup,
|
||||
@@ -258,18 +259,15 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
children: [
|
||||
if (!isInsideThreadDetailView || isFirstEmailInThreadDetail)
|
||||
Obx(() {
|
||||
final isLabelCapabilitySupported = controller
|
||||
.mailboxDashBoardController.isLabelCapabilitySupported;
|
||||
final isLabelAvailable = controller
|
||||
.mailboxDashBoardController.isLabelAvailable;
|
||||
|
||||
final labelController =
|
||||
controller.mailboxDashBoardController.labelController;
|
||||
|
||||
final isLabelSettingEnabled =
|
||||
labelController.isLabelSettingEnabled.isTrue;
|
||||
|
||||
List<Label>? emailLabels;
|
||||
|
||||
if (isLabelCapabilitySupported && isLabelSettingEnabled) {
|
||||
if (isLabelAvailable) {
|
||||
emailLabels = presentationEmail.getLabelList(
|
||||
labelController.labels,
|
||||
);
|
||||
@@ -316,7 +314,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
EmailActionType.deletePermanently,
|
||||
],
|
||||
emailIsRead: presentationEmail.hasRead,
|
||||
isLabelFeatureEnabled: controller.isLabelFeatureEnabled,
|
||||
isLabelFeatureEnabled: controller.isLabelAvailable,
|
||||
labels: controller.mailboxDashBoardController.labelController.labels,
|
||||
openBottomSheetContextMenu: controller.mailboxDashBoardController.openBottomSheetContextMenu,
|
||||
openPopupMenu: controller.mailboxDashBoardController.openPopupMenuActionGroup,
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'package:tmail_ui_user/features/email/presentation/extensions/presentatio
|
||||
import 'package:tmail_ui_user/features/home/data/exceptions/session_exceptions.dart';
|
||||
import 'package:tmail_ui_user/features/labels/domain/exceptions/label_exceptions.dart';
|
||||
import 'package:tmail_ui_user/features/labels/presentation/widgets/add_label_to_email_modal.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/check_label_available_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/update_current_emails_flags_extension.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/extensions/map_keywords_extension.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/extensions/presentation_email_map_extension.dart';
|
||||
@@ -22,8 +22,8 @@ import 'package:tmail_ui_user/features/thread_detail/domain/extensions/list_emai
|
||||
import 'package:tmail_ui_user/main/routes/dialog_router.dart';
|
||||
|
||||
extension HandleLabelForEmailExtension on SingleEmailController {
|
||||
bool get isLabelFeatureEnabled {
|
||||
return mailboxDashBoardController.isLabelFeatureEnabled;
|
||||
bool get isLabelAvailable {
|
||||
return mailboxDashBoardController.isLabelAvailable;
|
||||
}
|
||||
|
||||
void toggleLabelToEmail(EmailId emailId, Label label, bool isSelected) {
|
||||
@@ -213,7 +213,7 @@ extension HandleLabelForEmailExtension on SingleEmailController {
|
||||
}
|
||||
|
||||
Future<void> openAddLabelToEmailDialogModal(PresentationEmail email) async {
|
||||
if (!isLabelFeatureEnabled) return;
|
||||
if (!isLabelAvailable) return;
|
||||
final labels = mailboxDashBoardController.labelController.labels;
|
||||
final emailLabels = email.getLabelList(labels);
|
||||
final emailId = email.id;
|
||||
|
||||
@@ -26,6 +26,7 @@ import 'package:tmail_ui_user/features/mailbox/presentation/widgets/mailbox_cate
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/mailbox_item_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/mailbox_loading_bar_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/sending_queue_mailbox_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/dashboard_routes.dart';
|
||||
|
||||
abstract class BaseMailboxView extends GetWidget<MailboxController>
|
||||
@@ -386,17 +387,13 @@ abstract class BaseMailboxView extends GetWidget<MailboxController>
|
||||
|
||||
Widget buildLabelsList(BuildContext context, bool isDesktop) {
|
||||
return Obx(() {
|
||||
final isLabelCapabilitySupported = controller
|
||||
final isLabelAvailable = controller
|
||||
.mailboxDashBoardController
|
||||
.isLabelCapabilitySupported;
|
||||
.isLabelAvailable;
|
||||
|
||||
final labelController =
|
||||
controller.mailboxDashBoardController.labelController;
|
||||
|
||||
final isLabelSettingEnabled = labelController
|
||||
.isLabelSettingEnabled
|
||||
.isTrue;
|
||||
|
||||
final selectedMailbox = controller.mailboxDashBoardController
|
||||
.selectedMailbox.value;
|
||||
Id? labelIdSelected;
|
||||
@@ -404,7 +401,7 @@ abstract class BaseMailboxView extends GetWidget<MailboxController>
|
||||
labelIdSelected = selectedMailbox.id.id;
|
||||
}
|
||||
|
||||
if (isLabelCapabilitySupported && isLabelSettingEnabled) {
|
||||
if (isLabelAvailable) {
|
||||
final labelListExpandMode = labelController.labelListExpandMode.value;
|
||||
final labels = labelController.labels;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:get/get.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/utc_date.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
import 'package:labels/labels.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:super_tag_editor/tag_editor.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
@@ -40,6 +41,7 @@ class AdvancedFilterController extends BaseController {
|
||||
final endDate = Rxn<DateTime>();
|
||||
final sortOrderType = SearchEmailFilter.defaultSortOrder.obs;
|
||||
final selectedFolderName = Rxn<String>();
|
||||
final selectedLabel = Rxn<Label>();
|
||||
|
||||
final GlobalKey<TagsEditorState> keyFromEmailTagEditor = GlobalKey<TagsEditorState>();
|
||||
final GlobalKey<TagsEditorState> keyToEmailTagEditor = GlobalKey<TagsEditorState>();
|
||||
|
||||
+1
-7
@@ -135,6 +135,7 @@ import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/handle_save_email_as_draft_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/handle_store_email_sort_order_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/initialize_app_language.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/notify_thread_detail_setting_updated.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/open_and_close_composer_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/reopen_composer_cache_extension.dart';
|
||||
@@ -913,13 +914,6 @@ class MailboxDashBoardController extends ReloadableController
|
||||
}
|
||||
}
|
||||
|
||||
bool get isLabelCapabilitySupported {
|
||||
if (accountId.value == null || sessionCurrent == null) return false;
|
||||
|
||||
return labelController
|
||||
.isLabelCapabilitySupported(sessionCurrent!, accountId.value!);
|
||||
}
|
||||
|
||||
void _handleMailtoURL(MailtoArguments arguments) {
|
||||
log('MailboxDashBoardController::_handleMailtoURL:');
|
||||
routerParameters.value = arguments.toMapRouter();
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import 'package:labels/labels.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/advanced_filter_controller.dart';
|
||||
|
||||
extension UpdateLabelInAdvancedSearchExtension on AdvancedFilterController {
|
||||
void setSelectedLabel(Label? newLabel) {
|
||||
if (selectedLabel.value?.id == newLabel?.id) {
|
||||
selectedLabel.value = null;
|
||||
} else {
|
||||
selectedLabel.value = newLabel;
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart';
|
||||
|
||||
extension CheckLabelAvailableExtension on MailboxDashBoardController {
|
||||
bool get isLabelFeatureEnabled {
|
||||
return isLabelCapabilitySupported &&
|
||||
labelController.isLabelSettingEnabled.isTrue;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart';
|
||||
|
||||
extension HandleLogicLabelExtension on MailboxDashBoardController {
|
||||
bool get isLabelCapabilitySupported {
|
||||
final accountId = this.accountId.value;
|
||||
final session = sessionCurrent;
|
||||
|
||||
if (accountId == null || session == null) return false;
|
||||
|
||||
return labelController.isLabelCapabilitySupported(session, accountId);
|
||||
}
|
||||
|
||||
bool get isLabelAvailable {
|
||||
return labelController.isLabelSettingEnabled.isTrue &&
|
||||
isLabelCapabilitySupported;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/utils/theme_utils.dart';
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LabelDropDownStyle {
|
||||
static const int dropdownElevation = 0;
|
||||
|
||||
static const double height = 48;
|
||||
static const double dropdownMaxHeight = 210;
|
||||
static const double scrollbarThickness = 6;
|
||||
static const double checkedIconSize = 20;
|
||||
|
||||
static final Color unCheckedIconColor =
|
||||
AppColor.gray424244.withValues(alpha: 0.72);
|
||||
static const Color checkedIconColor = AppColor.primaryMain;
|
||||
|
||||
static const Offset dropdownOffset = Offset(0.0, -3.0);
|
||||
|
||||
static BoxDecoration dropdownDecoration = BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
color: Colors.white,
|
||||
border: Border.all(color: AppColor.m3Tertiary60),
|
||||
boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 24)],
|
||||
);
|
||||
|
||||
static const EdgeInsetsGeometry buttonPadding = EdgeInsetsDirectional.only(
|
||||
start: 12,
|
||||
end: 8,
|
||||
);
|
||||
static const EdgeInsetsGeometry dropdownPadding = EdgeInsets.all(12);
|
||||
static const MenuItemStyleData menuItemStyleData = MenuItemStyleData(
|
||||
height: height,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
);
|
||||
|
||||
static const Radius dropdownScrollbarRadius = Radius.circular(40);
|
||||
|
||||
static TextStyle menuItemStyle = ThemeUtils.textStyleBodyBody3(
|
||||
color: Colors.black,
|
||||
);
|
||||
}
|
||||
+10
-4
@@ -8,17 +8,19 @@ class AdvancedSearchFieldWidget extends StatelessWidget {
|
||||
final FilterField filterField;
|
||||
final Widget child;
|
||||
final bool useHeight;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
|
||||
const AdvancedSearchFieldWidget({
|
||||
super.key,
|
||||
required this.filterField,
|
||||
required this.child,
|
||||
this.useHeight = true,
|
||||
this.padding,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bodyWidget = Row(
|
||||
Widget bodyWidget = Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: AdvancedSearchInputFormStyle.labelMaxWidth,
|
||||
@@ -32,12 +34,16 @@ class AdvancedSearchFieldWidget extends StatelessWidget {
|
||||
);
|
||||
|
||||
if (useHeight) {
|
||||
return SizedBox(
|
||||
bodyWidget = SizedBox(
|
||||
height: AdvancedSearchInputFormStyle.inputFieldHeight,
|
||||
child: bodyWidget,
|
||||
);
|
||||
} else {
|
||||
return bodyWidget;
|
||||
}
|
||||
|
||||
if (padding != null) {
|
||||
bodyWidget = Padding(padding: padding!, child: bodyWidget);
|
||||
}
|
||||
|
||||
return bodyWidget;
|
||||
}
|
||||
}
|
||||
|
||||
+27
@@ -6,9 +6,12 @@ import 'package:tmail_ui_user/features/base/widget/default_field/default_date_dr
|
||||
import 'package:tmail_ui_user/features/base/widget/default_field/default_input_field_with_tab_key_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/advanced_filter_controller.dart';
|
||||
import 'package:tmail_ui_user/features/base/model/filter_filter.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/advanced_search/update_label_in_advanced_search_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/email_receive_time_type.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/widgets/advanced_search/advanced_search_field_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/widgets/advanced_search/advanced_search_filter_form_bottom_view.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/widgets/advanced_search/label_drop_down_button.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/widgets/advanced_search/sort_by_drop_down_button.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
@@ -119,6 +122,30 @@ class AdvancedSearchInputForm extends GetWidget<AdvancedFilterController> {
|
||||
)),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Obx(() {
|
||||
final isLabelAvailable =
|
||||
controller.mailboxDashBoardController.isLabelAvailable;
|
||||
|
||||
final labels =
|
||||
controller.mailboxDashBoardController.labelController.labels;
|
||||
|
||||
final labelSelected = controller.selectedLabel.value;
|
||||
|
||||
if (isLabelAvailable) {
|
||||
return AdvancedSearchFieldWidget(
|
||||
filterField: FilterField.labels,
|
||||
padding: const EdgeInsets.only(bottom: 12),
|
||||
child: LabelDropDownButton(
|
||||
imagePaths: controller.imagePaths,
|
||||
labels: labels,
|
||||
labelSelected: labelSelected,
|
||||
onSelectLabelsActions: controller.setSelectedLabel,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
AdvancedSearchFieldWidget(
|
||||
filterField: FilterField.date,
|
||||
child: Obx(() => DefaultDateDropDownFieldWidget(
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:labels/labels.dart';
|
||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/styles/advanced_search_input_form_style.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/styles/label_drop_down_style.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
typedef OnSelectLabelsActions = void Function(Label? label);
|
||||
|
||||
class LabelDropDownButton extends StatelessWidget {
|
||||
final ImagePaths imagePaths;
|
||||
final List<Label> labels;
|
||||
final Label? labelSelected;
|
||||
final OnSelectLabelsActions onSelectLabelsActions;
|
||||
|
||||
const LabelDropDownButton({
|
||||
Key? key,
|
||||
required this.imagePaths,
|
||||
required this.labels,
|
||||
required this.labelSelected,
|
||||
required this.onSelectLabelsActions,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DropdownButtonHideUnderline(
|
||||
child: PointerInterceptor(
|
||||
child: DropdownButton2<Label>(
|
||||
isExpanded: true,
|
||||
items: labels.map((label) {
|
||||
final isSelected = labelSelected?.id == label.id;
|
||||
return DropdownMenuItem<Label>(
|
||||
value: label,
|
||||
child: PointerInterceptor(
|
||||
child: Row(
|
||||
spacing: 16,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
isSelected
|
||||
? imagePaths.icCheckboxSelected
|
||||
: imagePaths.icCheckboxUnselected,
|
||||
width: LabelDropDownStyle.checkedIconSize,
|
||||
height: LabelDropDownStyle.checkedIconSize,
|
||||
colorFilter: isSelected
|
||||
? LabelDropDownStyle.checkedIconColor.asFilter()
|
||||
: LabelDropDownStyle.unCheckedIconColor.asFilter(),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
label.safeDisplayName,
|
||||
style: LabelDropDownStyle.menuItemStyle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
value: labelSelected,
|
||||
customButton: _buildButton(AppLocalizations.of(context)),
|
||||
onChanged: onSelectLabelsActions,
|
||||
dropdownStyleData: DropdownStyleData(
|
||||
maxHeight: LabelDropDownStyle.dropdownMaxHeight,
|
||||
decoration: LabelDropDownStyle.dropdownDecoration,
|
||||
elevation: LabelDropDownStyle.dropdownElevation,
|
||||
offset: LabelDropDownStyle.dropdownOffset,
|
||||
padding: LabelDropDownStyle.dropdownPadding,
|
||||
scrollbarTheme: ScrollbarThemeData(
|
||||
radius: LabelDropDownStyle.dropdownScrollbarRadius,
|
||||
thickness: WidgetStateProperty.all<double>(
|
||||
LabelDropDownStyle.scrollbarThickness,
|
||||
),
|
||||
thumbVisibility: WidgetStateProperty.all<bool>(true),
|
||||
),
|
||||
),
|
||||
menuItemStyleData: LabelDropDownStyle.menuItemStyleData,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildButton(AppLocalizations appLocalizations) {
|
||||
final displayedName =
|
||||
labelSelected?.safeDisplayName ?? appLocalizations.allLabels;
|
||||
|
||||
return Container(
|
||||
height: AdvancedSearchInputFormStyle.inputFieldHeight,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(
|
||||
AdvancedSearchInputFormStyle.inputFieldBorderRadius,
|
||||
),
|
||||
),
|
||||
border: Border.all(
|
||||
color: AdvancedSearchInputFormStyle.inputFieldBorderColor,
|
||||
width: AdvancedSearchInputFormStyle.inputFieldBorderWidth,
|
||||
),
|
||||
color: AdvancedSearchInputFormStyle.inputFieldBackgroundColor,
|
||||
),
|
||||
padding: LabelDropDownStyle.buttonPadding,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
displayedName,
|
||||
style: AdvancedSearchInputFormStyle.inputTextStyle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
SvgPicture.asset(imagePaths.icDropDown)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -56,7 +57,8 @@ class PreferencesController extends BaseController {
|
||||
}
|
||||
|
||||
bool get isAIScribeCapabilityAvailable {
|
||||
return accountDashboardController.isAIScribeCapabilityAvailable;
|
||||
return accountDashboardController.isAIScribeCapabilityAvailable &&
|
||||
!PlatformInfo.isMobile;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -21,6 +21,7 @@ import 'package:tmail_ui_user/features/base/widget/scrollbar_list_view.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/presentation_email_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/model/recent_search.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/handle_ai_needs_action_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/email_receive_time_type.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/email_sort_order_type.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/quick_search_filter.dart';
|
||||
@@ -733,16 +734,13 @@ class SearchEmailView extends GetWidget<SearchEmailController>
|
||||
|
||||
final isAINeedsActionEnabled = dashboardController.isAINeedsActionEnabled;
|
||||
|
||||
final isLabelCapabilitySupported = dashboardController.isLabelCapabilitySupported;
|
||||
final isLabelAvailable = dashboardController.isLabelAvailable;
|
||||
|
||||
final labelController = dashboardController.labelController;
|
||||
|
||||
final isLabelSettingEnabled =
|
||||
labelController.isLabelSettingEnabled.isTrue;
|
||||
|
||||
List<Label>? emailLabels;
|
||||
|
||||
if (isLabelCapabilitySupported && isLabelSettingEnabled) {
|
||||
if (isLabelAvailable) {
|
||||
emailLabels = presentationEmail.getLabelList(
|
||||
labelController.labels,
|
||||
);
|
||||
|
||||
@@ -25,6 +25,7 @@ import 'package:tmail_ui_user/features/mailbox/presentation/model/presentation_l
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/model/spam_report_state.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/handle_ai_needs_action_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/handle_open_context_menu_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/open_and_close_composer_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/widgets/recover_deleted_message_loading_banner_widget.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/extensions/vacation_response_extension.dart';
|
||||
@@ -618,22 +619,19 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
|
||||
final isAINeedsActionEnabled = dashboardController.isAINeedsActionEnabled;
|
||||
|
||||
final isLabelCapabilitySupported =
|
||||
dashboardController.isLabelCapabilitySupported;
|
||||
final isLabelAvailable = controller
|
||||
.mailboxDashBoardController.isLabelAvailable;
|
||||
|
||||
final labelController =
|
||||
controller.mailboxDashBoardController.labelController;
|
||||
|
||||
final isLabelSettingEnabled =
|
||||
labelController.isLabelSettingEnabled.isTrue;
|
||||
List<Label>? emailLabels;
|
||||
|
||||
List<Label>? emailLabels;
|
||||
|
||||
if (isLabelCapabilitySupported && isLabelSettingEnabled) {
|
||||
emailLabels = presentationEmail.getLabelList(
|
||||
labelController.labels,
|
||||
);
|
||||
}
|
||||
if (isLabelAvailable) {
|
||||
emailLabels = presentationEmail.getLabelList(
|
||||
labelController.labels,
|
||||
);
|
||||
}
|
||||
|
||||
return Dismissible(
|
||||
key: ValueKey<EmailId?>(presentationEmail.id),
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import 'package:tmail_ui_user/features/email/presentation/extensions/email_loade
|
||||
import 'package:tmail_ui_user/features/home/data/exceptions/session_exceptions.dart';
|
||||
import 'package:tmail_ui_user/features/labels/domain/exceptions/label_exceptions.dart';
|
||||
import 'package:tmail_ui_user/features/labels/presentation/widgets/add_label_to_email_modal.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/check_label_available_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/update_current_emails_flags_extension.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/extensions/presentation_email_map_extension.dart';
|
||||
import 'package:tmail_ui_user/features/thread_detail/domain/extensions/list_email_in_thread_detail_info_extension.dart';
|
||||
@@ -18,7 +18,7 @@ import 'package:tmail_ui_user/main/routes/dialog_router.dart';
|
||||
|
||||
extension AddLabelToThreadExtension on ThreadDetailController {
|
||||
Future<void> openAddLabelToEmailDialogModal() async {
|
||||
if (!mailboxDashBoardController.isLabelFeatureEnabled) return;
|
||||
if (!mailboxDashBoardController.isLabelAvailable) return;
|
||||
|
||||
final labels = mailboxDashBoardController.labelController.labels;
|
||||
if (emailsInThreadDetailInfo.isEmpty || labels.isEmpty) {
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ import 'package:tmail_ui_user/features/labels/presentation/widgets/label_item_co
|
||||
import 'package:tmail_ui_user/features/labels/presentation/widgets/label_list_context_menu.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/model/mailbox_actions.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/handle_open_context_menu_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/check_label_available_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/state/mark_as_multiple_email_read_state.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/state/mark_as_star_multiple_email_state.dart';
|
||||
import 'package:tmail_ui_user/features/thread_detail/domain/extensions/list_email_in_thread_detail_info_extension.dart';
|
||||
@@ -125,7 +125,7 @@ extension OnThreadDetailActionClick on ThreadDetailController {
|
||||
_moveToMailbox(mailboxId, threadDetailActionType);
|
||||
break;
|
||||
case EmailActionType.labelAs:
|
||||
if (!mailboxDashBoardController.isLabelFeatureEnabled) return;
|
||||
if (!mailboxDashBoardController.isLabelAvailable) return;
|
||||
openAddLabelToEmailDialogModal();
|
||||
break;
|
||||
default:
|
||||
@@ -137,7 +137,7 @@ extension OnThreadDetailActionClick on ThreadDetailController {
|
||||
if (currentContext == null) return;
|
||||
|
||||
final moreActions = [
|
||||
if (mailboxDashBoardController.isLabelFeatureEnabled)
|
||||
if (mailboxDashBoardController.isLabelAvailable)
|
||||
EmailActionType.labelAs,
|
||||
threadDetailIsRead
|
||||
? EmailActionType.markAsUnread
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:tmail_ui_user/features/email/presentation/action/email_ui_action
|
||||
import 'package:tmail_ui_user/features/email/presentation/styles/email_view_app_bar_widget_styles.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_view_bottom_bar_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/extensions/presentation_mailbox_extension.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/labels/handle_logic_label_extension.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/extensions/vacation_response_extension.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/vacation/widgets/vacation_notification_message_widget.dart';
|
||||
import 'package:tmail_ui_user/features/thread_detail/domain/state/get_thread_by_id_state.dart';
|
||||
@@ -101,16 +102,13 @@ class ThreadDetailView extends GetWidget<ThreadDetailController> {
|
||||
}
|
||||
}),
|
||||
Obx(() {
|
||||
final isLabelCapabilitySupported = controller
|
||||
.mailboxDashBoardController.isLabelCapabilitySupported;
|
||||
final isLabelAvailable = controller
|
||||
.mailboxDashBoardController.isLabelAvailable;
|
||||
|
||||
final labelController =
|
||||
controller.mailboxDashBoardController.labelController;
|
||||
|
||||
final isLabelSettingEnabled =
|
||||
labelController.isLabelSettingEnabled.isTrue;
|
||||
|
||||
final threadChildren = isLabelCapabilitySupported && isLabelSettingEnabled
|
||||
final threadChildren = isLabelAvailable
|
||||
? controller.getThreadDetailEmailViews(labels: labelController.labels)
|
||||
: controller.getThreadDetailEmailViews();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"@@last_modified": "2025-12-22T16:54:22.593873",
|
||||
"@@last_modified": "2026-01-19T17:48:08.806042",
|
||||
"initializing_data": "Initializing data...",
|
||||
"@initializing_data": {
|
||||
"type": "text",
|
||||
@@ -4880,24 +4880,6 @@
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
},
|
||||
"aiScribe": "AI Scribe",
|
||||
"@aiScribe": {
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
},
|
||||
"aiScribeSettingExplanation": "Use AI to help write and improve your emails",
|
||||
"@aiScribeSettingExplanation": {
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
},
|
||||
"aiScribeToggleDescription": "Enable AI Scribe",
|
||||
"@aiScribeToggleDescription": {
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
},
|
||||
"showMoreAttachmentButton": "Show +{count} more",
|
||||
"@showMoreAttachmentButton": {
|
||||
"type": "text",
|
||||
@@ -5365,5 +5347,11 @@
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
},
|
||||
"allLabels": "All labels",
|
||||
"@allLabels": {
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
}
|
||||
}
|
||||
@@ -5673,4 +5673,11 @@ class AppLocalizations {
|
||||
name: 'youDoNotHaveAnyEmailTaggedWithThis',
|
||||
);
|
||||
}
|
||||
|
||||
String get allLabels {
|
||||
return Intl.message(
|
||||
'All labels',
|
||||
name: 'allLabels',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user