From bc05be53adf171ae786ca58ea6342c5c7b57724f Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 16 Sep 2024 09:33:20 +0700 Subject: [PATCH 1/5] Fix alignment receive time in email view --- .../widgets/recipient_composer_widget.dart | 336 +++++++++--------- ...formation_sender_and_receiver_builder.dart | 66 ++-- 2 files changed, 202 insertions(+), 200 deletions(-) diff --git a/lib/features/composer/presentation/widgets/recipient_composer_widget.dart b/lib/features/composer/presentation/widgets/recipient_composer_widget.dart index 283946f7af..ff119e4889 100644 --- a/lib/features/composer/presentation/widgets/recipient_composer_widget.dart +++ b/lib/features/composer/presentation/widgets/recipient_composer_widget.dart @@ -147,175 +147,173 @@ class _RecipientComposerWidgetState extends State { const SizedBox(width: RecipientComposerWidgetStyle.space), Expanded( child: FocusScope( - child: Focus( - onFocusChange: (focus) => widget.onFocusEmailAddressChangeAction?.call(widget.prefix, focus), - onKeyEvent: PlatformInfo.isWeb ? _recipientInputOnKeyListener : null, - child: StatefulBuilder( - builder: (context, stateSetter) { - if (PlatformInfo.isWeb || widget.isTestingForWeb) { - return DragTarget( - builder: (context, candidateData, rejectedData) { - return TagEditor( - key: widget.keyTagEditor, - length: _collapsedListEmailAddress.length, - controller: widget.controller, - focusNode: widget.focusNode, - enableBorder: _isDragging, - focusNodeKeyboard: widget.focusNodeKeyboard, - borderRadius: RecipientComposerWidgetStyle.enableBorderRadius, - enableBorderColor: RecipientComposerWidgetStyle.enableBorderColor, - keyboardType: TextInputType.emailAddress, - textInputAction: TextInputAction.done, - debounceDuration: RecipientComposerWidgetStyle.suggestionDebounceDuration, - tagSpacing: RecipientComposerWidgetStyle.tagSpacing, - autofocus: widget.prefix != PrefixEmailAddress.to && _currentListEmailAddress.isEmpty, - minTextFieldWidth: RecipientComposerWidgetStyle.minTextFieldWidth, - resetTextOnSubmitted: true, - autoScrollToInput: false, - autoHideTextInputField: true, - cursorColor: RecipientComposerWidgetStyle.cursorColor, - suggestionsBoxElevation: RecipientComposerWidgetStyle.suggestionsBoxElevation, - suggestionsBoxBackgroundColor: RecipientComposerWidgetStyle.suggestionsBoxBackgroundColor, - suggestionsBoxRadius: RecipientComposerWidgetStyle.suggestionsBoxRadius, - suggestionsBoxMaxHeight: RecipientComposerWidgetStyle.suggestionsBoxMaxHeight, - suggestionBoxWidth: _getSuggestionBoxWidth(widget.maxWidth), - textStyle: RecipientComposerWidgetStyle.inputTextStyle, - onFocusTagAction: (focused) => _handleFocusTagAction.call(focused, stateSetter), - onDeleteTagAction: () => _handleDeleteLatestTagAction.call(stateSetter), - onSelectOptionAction: (item) => _handleSelectOptionAction.call(item, stateSetter), - onSubmitted: (value) => _handleSubmitTagAction.call(value, stateSetter), - onTapOutside: (_) {}, - onFocusTextInput: () { - if (_isCollapse) { - widget.onShowFullListEmailAddressAction?.call(widget.prefix); - } - }, - inputDecoration: const InputDecoration(border: InputBorder.none), - tagBuilder: (context, index) { - final currentEmailAddress = _currentListEmailAddress[index]; - final isLatestEmail = currentEmailAddress == _currentListEmailAddress.last; - - return RecipientTagItemWidget( - index: index, - imagePaths: widget.imagePaths, - prefix: widget.prefix, - currentEmailAddress: currentEmailAddress, - currentListEmailAddress: _currentListEmailAddress, - collapsedListEmailAddress: _collapsedListEmailAddress, - isLatestEmail: isLatestEmail, - isCollapsed: _isCollapse, - isLatestTagFocused: _lastTagFocused, - maxWidth: widget.maxWidth, - onDeleteTagAction: (emailAddress) => _handleDeleteTagAction.call(emailAddress, stateSetter), - onShowFullAction: widget.onShowFullListEmailAddressAction, - ); - }, - onTagChanged: (value) => _handleOnTagChangeAction.call(value, stateSetter), - findSuggestions: _findSuggestions, - useDefaultHighlight: false, - suggestionBuilder: (context, tagEditorState, suggestionEmailAddress, index, length, highlight, suggestionValid) { - return RecipientSuggestionItemWidget( - imagePaths: widget.imagePaths, - suggestionState: suggestionEmailAddress.state, - emailAddress: suggestionEmailAddress.emailAddress, - suggestionValid: suggestionValid, - highlight: highlight, - onSelectedAction: (emailAddress) { - stateSetter(() => _currentListEmailAddress.add(emailAddress)); - _updateListEmailAddressAction(); - tagEditorState.resetTextField(); - tagEditorState.closeSuggestionBox(); - }, - ); - }, - ); - }, - onAcceptWithDetails: (draggableEmailAddress) => _handleAcceptDraggableEmailAddressAction(draggableEmailAddress.data, stateSetter), - onLeave: (draggableEmailAddress) { - if (_isDragging) { - stateSetter(() => _isDragging = false); - } - }, - onMove: (details) { - if (!_isDragging) { - stateSetter(() => _isDragging = true); - } - }, - ); - } else { - return TagEditor( - key: widget.keyTagEditor, - length: _collapsedListEmailAddress.length, - controller: widget.controller, - focusNode: widget.focusNode, - focusNodeKeyboard: widget.focusNodeKeyboard, - keyboardType: TextInputType.emailAddress, - textInputAction: TextInputAction.done, - debounceDuration: RecipientComposerWidgetStyle.suggestionDebounceDuration, - tagSpacing: RecipientComposerWidgetStyle.tagSpacing, - minTextFieldWidth: RecipientComposerWidgetStyle.minTextFieldWidth, - resetTextOnSubmitted: true, - autoScrollToInput: false, - autoHideTextInputField: true, - cursorColor: RecipientComposerWidgetStyle.cursorColor, - suggestionsBoxElevation: RecipientComposerWidgetStyle.suggestionsBoxElevation, - suggestionsBoxBackgroundColor: RecipientComposerWidgetStyle.suggestionsBoxBackgroundColor, - suggestionsBoxRadius: RecipientComposerWidgetStyle.suggestionsBoxRadius, - suggestionsBoxMaxHeight: RecipientComposerWidgetStyle.suggestionsBoxMaxHeight, - suggestionBoxWidth: _getSuggestionBoxWidth(widget.maxWidth), - textStyle: RecipientComposerWidgetStyle.inputTextStyle, - onFocusTagAction: (focused) => _handleFocusTagAction.call(focused, stateSetter), - onDeleteTagAction: () => _handleDeleteLatestTagAction.call(stateSetter), - onSelectOptionAction: (item) => _handleSelectOptionAction.call(item, stateSetter), - onSubmitted: (value) => _handleSubmitTagAction.call(value, stateSetter), - onTapOutside: (_) {}, - onFocusTextInput: () { - if (_isCollapse) { - widget.onShowFullListEmailAddressAction?.call(widget.prefix); - } - }, - inputDecoration: const InputDecoration(border: InputBorder.none), - tagBuilder: (context, index) { - final currentEmailAddress = _currentListEmailAddress[index]; - final isLatestEmail = currentEmailAddress == _currentListEmailAddress.last; - - return RecipientTagItemWidget( - index: index, - imagePaths: widget.imagePaths, - prefix: widget.prefix, - currentEmailAddress: currentEmailAddress, - currentListEmailAddress: _currentListEmailAddress, - collapsedListEmailAddress: _collapsedListEmailAddress, - isLatestEmail: isLatestEmail, - isCollapsed: _isCollapse, - isLatestTagFocused: _lastTagFocused, - maxWidth: widget.maxWidth, - onDeleteTagAction: (emailAddress) => _handleDeleteTagAction.call(emailAddress, stateSetter), - onShowFullAction: widget.onShowFullListEmailAddressAction, - ); - }, - onTagChanged: (value) => _handleOnTagChangeAction.call(value, stateSetter), - findSuggestions: _findSuggestions, - useDefaultHighlight: false, - suggestionBuilder: (context, tagEditorState, suggestionEmailAddress, index, length, highlight, suggestionValid) { - return RecipientSuggestionItemWidget( - imagePaths: widget.imagePaths, - suggestionState: suggestionEmailAddress.state, - emailAddress: suggestionEmailAddress.emailAddress, - suggestionValid: suggestionValid, - highlight: highlight, - onSelectedAction: (emailAddress) { - stateSetter(() => _currentListEmailAddress.add(emailAddress)); - _updateListEmailAddressAction(); - tagEditorState.resetTextField(); - tagEditorState.closeSuggestionBox(); - }, - ); - }, - ); - } - }, - ) + onFocusChange: (focus) => widget.onFocusEmailAddressChangeAction?.call(widget.prefix, focus), + onKeyEvent: PlatformInfo.isWeb ? _recipientInputOnKeyListener : null, + child: StatefulBuilder( + builder: (context, stateSetter) { + if (PlatformInfo.isWeb || widget.isTestingForWeb) { + return DragTarget( + builder: (context, candidateData, rejectedData) { + return TagEditor( + key: widget.keyTagEditor, + length: _collapsedListEmailAddress.length, + controller: widget.controller, + focusNode: widget.focusNode, + enableBorder: _isDragging, + focusNodeKeyboard: widget.focusNodeKeyboard, + borderRadius: RecipientComposerWidgetStyle.enableBorderRadius, + enableBorderColor: RecipientComposerWidgetStyle.enableBorderColor, + keyboardType: TextInputType.emailAddress, + textInputAction: TextInputAction.done, + debounceDuration: RecipientComposerWidgetStyle.suggestionDebounceDuration, + tagSpacing: RecipientComposerWidgetStyle.tagSpacing, + autofocus: widget.prefix != PrefixEmailAddress.to && _currentListEmailAddress.isEmpty, + minTextFieldWidth: RecipientComposerWidgetStyle.minTextFieldWidth, + resetTextOnSubmitted: true, + autoScrollToInput: false, + autoHideTextInputField: true, + cursorColor: RecipientComposerWidgetStyle.cursorColor, + suggestionsBoxElevation: RecipientComposerWidgetStyle.suggestionsBoxElevation, + suggestionsBoxBackgroundColor: RecipientComposerWidgetStyle.suggestionsBoxBackgroundColor, + suggestionsBoxRadius: RecipientComposerWidgetStyle.suggestionsBoxRadius, + suggestionsBoxMaxHeight: RecipientComposerWidgetStyle.suggestionsBoxMaxHeight, + suggestionBoxWidth: _getSuggestionBoxWidth(widget.maxWidth), + textStyle: RecipientComposerWidgetStyle.inputTextStyle, + onFocusTagAction: (focused) => _handleFocusTagAction.call(focused, stateSetter), + onDeleteTagAction: () => _handleDeleteLatestTagAction.call(stateSetter), + onSelectOptionAction: (item) => _handleSelectOptionAction.call(item, stateSetter), + onSubmitted: (value) => _handleSubmitTagAction.call(value, stateSetter), + onTapOutside: (_) {}, + onFocusTextInput: () { + if (_isCollapse) { + widget.onShowFullListEmailAddressAction?.call(widget.prefix); + } + }, + inputDecoration: const InputDecoration(border: InputBorder.none), + tagBuilder: (context, index) { + final currentEmailAddress = _currentListEmailAddress[index]; + final isLatestEmail = currentEmailAddress == _currentListEmailAddress.last; + + return RecipientTagItemWidget( + index: index, + imagePaths: widget.imagePaths, + prefix: widget.prefix, + currentEmailAddress: currentEmailAddress, + currentListEmailAddress: _currentListEmailAddress, + collapsedListEmailAddress: _collapsedListEmailAddress, + isLatestEmail: isLatestEmail, + isCollapsed: _isCollapse, + isLatestTagFocused: _lastTagFocused, + maxWidth: widget.maxWidth, + onDeleteTagAction: (emailAddress) => _handleDeleteTagAction.call(emailAddress, stateSetter), + onShowFullAction: widget.onShowFullListEmailAddressAction, + ); + }, + onTagChanged: (value) => _handleOnTagChangeAction.call(value, stateSetter), + findSuggestions: _findSuggestions, + useDefaultHighlight: false, + suggestionBuilder: (context, tagEditorState, suggestionEmailAddress, index, length, highlight, suggestionValid) { + return RecipientSuggestionItemWidget( + imagePaths: widget.imagePaths, + suggestionState: suggestionEmailAddress.state, + emailAddress: suggestionEmailAddress.emailAddress, + suggestionValid: suggestionValid, + highlight: highlight, + onSelectedAction: (emailAddress) { + stateSetter(() => _currentListEmailAddress.add(emailAddress)); + _updateListEmailAddressAction(); + tagEditorState.resetTextField(); + tagEditorState.closeSuggestionBox(); + }, + ); + }, + ); + }, + onAcceptWithDetails: (draggableEmailAddress) => _handleAcceptDraggableEmailAddressAction(draggableEmailAddress.data, stateSetter), + onLeave: (draggableEmailAddress) { + if (_isDragging) { + stateSetter(() => _isDragging = false); + } + }, + onMove: (details) { + if (!_isDragging) { + stateSetter(() => _isDragging = true); + } + }, + ); + } else { + return TagEditor( + key: widget.keyTagEditor, + length: _collapsedListEmailAddress.length, + controller: widget.controller, + focusNode: widget.focusNode, + focusNodeKeyboard: widget.focusNodeKeyboard, + keyboardType: TextInputType.emailAddress, + textInputAction: TextInputAction.done, + debounceDuration: RecipientComposerWidgetStyle.suggestionDebounceDuration, + tagSpacing: RecipientComposerWidgetStyle.tagSpacing, + minTextFieldWidth: RecipientComposerWidgetStyle.minTextFieldWidth, + resetTextOnSubmitted: true, + autoScrollToInput: false, + autoHideTextInputField: true, + cursorColor: RecipientComposerWidgetStyle.cursorColor, + suggestionsBoxElevation: RecipientComposerWidgetStyle.suggestionsBoxElevation, + suggestionsBoxBackgroundColor: RecipientComposerWidgetStyle.suggestionsBoxBackgroundColor, + suggestionsBoxRadius: RecipientComposerWidgetStyle.suggestionsBoxRadius, + suggestionsBoxMaxHeight: RecipientComposerWidgetStyle.suggestionsBoxMaxHeight, + suggestionBoxWidth: _getSuggestionBoxWidth(widget.maxWidth), + textStyle: RecipientComposerWidgetStyle.inputTextStyle, + onFocusTagAction: (focused) => _handleFocusTagAction.call(focused, stateSetter), + onDeleteTagAction: () => _handleDeleteLatestTagAction.call(stateSetter), + onSelectOptionAction: (item) => _handleSelectOptionAction.call(item, stateSetter), + onSubmitted: (value) => _handleSubmitTagAction.call(value, stateSetter), + onTapOutside: (_) {}, + onFocusTextInput: () { + if (_isCollapse) { + widget.onShowFullListEmailAddressAction?.call(widget.prefix); + } + }, + inputDecoration: const InputDecoration(border: InputBorder.none), + tagBuilder: (context, index) { + final currentEmailAddress = _currentListEmailAddress[index]; + final isLatestEmail = currentEmailAddress == _currentListEmailAddress.last; + + return RecipientTagItemWidget( + index: index, + imagePaths: widget.imagePaths, + prefix: widget.prefix, + currentEmailAddress: currentEmailAddress, + currentListEmailAddress: _currentListEmailAddress, + collapsedListEmailAddress: _collapsedListEmailAddress, + isLatestEmail: isLatestEmail, + isCollapsed: _isCollapse, + isLatestTagFocused: _lastTagFocused, + maxWidth: widget.maxWidth, + onDeleteTagAction: (emailAddress) => _handleDeleteTagAction.call(emailAddress, stateSetter), + onShowFullAction: widget.onShowFullListEmailAddressAction, + ); + }, + onTagChanged: (value) => _handleOnTagChangeAction.call(value, stateSetter), + findSuggestions: _findSuggestions, + useDefaultHighlight: false, + suggestionBuilder: (context, tagEditorState, suggestionEmailAddress, index, length, highlight, suggestionValid) { + return RecipientSuggestionItemWidget( + imagePaths: widget.imagePaths, + suggestionState: suggestionEmailAddress.state, + emailAddress: suggestionEmailAddress.emailAddress, + suggestionValid: suggestionValid, + highlight: highlight, + onSelectedAction: (emailAddress) { + stateSetter(() => _currentListEmailAddress.add(emailAddress)); + _updateListEmailAddressAction(); + tagEditorState.resetTextField(); + tagEditorState.closeSuggestionBox(); + }, + ); + }, + ); + } + }, ) ) ), diff --git a/lib/features/email/presentation/widgets/information_sender_and_receiver_builder.dart b/lib/features/email/presentation/widgets/information_sender_and_receiver_builder.dart index bbff520abb..65961b3eeb 100644 --- a/lib/features/email/presentation/widgets/information_sender_and_receiver_builder.dart +++ b/lib/features/email/presentation/widgets/information_sender_and_receiver_builder.dart @@ -58,38 +58,42 @@ class InformationSenderAndReceiverBuilder extends StatelessWidget { children: [ if (emailSelected.from?.isNotEmpty == true) Row(children: [ - Flexible(child: Transform( - transform: Matrix4.translationValues(-5.0, 0.0, 0.0), - child: EmailSenderBuilder( - emailAddress: emailSelected.from!.first, - openEmailAddressDetailAction: openEmailAddressDetailAction, - ) - )), - if (sMimeStatus != null && sMimeStatus != SMimeSignatureStatus.notSigned) - Tooltip( - key: const Key('smime_signature_status_icon'), - message: sMimeStatus!.getTooltipMessage(context), - child: MouseRegion( - cursor: SystemMouseCursors.click, - child: SvgPicture.asset( - sMimeStatus!.getIcon(imagePaths), - fit: BoxFit.fill, + Expanded(child: Row( + children: [ + Flexible(child: Transform( + transform: Matrix4.translationValues(-5.0, 0.0, 0.0), + child: EmailSenderBuilder( + emailAddress: emailSelected.from!.first, + openEmailAddressDetailAction: openEmailAddressDetailAction, + ) + )), + if (sMimeStatus != null && sMimeStatus != SMimeSignatureStatus.notSigned) + Tooltip( + key: const Key('smime_signature_status_icon'), + message: sMimeStatus!.getTooltipMessage(context), + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: SvgPicture.asset( + sMimeStatus!.getIcon(imagePaths), + fit: BoxFit.fill, + ), + ), + ), + if (!emailSelected.isSubscribed && emailUnsubscribe != null && !responsiveUtils.isPortraitMobile(context)) + TMailButtonWidget.fromText( + text: AppLocalizations.of(context).unsubscribe, + textStyle: const TextStyle( + fontWeight: FontWeight.normal, + fontSize: 14, + color: AppColor.colorTextBody, + decoration: TextDecoration.underline, + ), + padding: const EdgeInsetsDirectional.symmetric(vertical: 5, horizontal: 8), + backgroundColor: Colors.transparent, + onTapActionCallback: () => onEmailActionClick?.call(emailSelected, EmailActionType.unsubscribe), ), - ), - ), - if (!emailSelected.isSubscribed && emailUnsubscribe != null && !responsiveUtils.isPortraitMobile(context)) - TMailButtonWidget.fromText( - text: AppLocalizations.of(context).unsubscribe, - textStyle: const TextStyle( - fontWeight: FontWeight.normal, - fontSize: 14, - color: AppColor.colorTextBody, - decoration: TextDecoration.underline, - ), - padding: const EdgeInsetsDirectional.symmetric(vertical: 5, horizontal: 8), - backgroundColor: Colors.transparent, - onTapActionCallback: () => onEmailActionClick?.call(emailSelected, EmailActionType.unsubscribe), - ), + ] + )), ReceivedTimeBuilder(emailSelected: emailSelected), ]), if (emailSelected.numberOfAllEmailAddress() > 0) From b14b3cbc8cb964e2cc4bbdbb822ee877a9767f5e Mon Sep 17 00:00:00 2001 From: dab246 Date: Thu, 27 Jun 2024 10:54:54 +0700 Subject: [PATCH 2/5] Remove space when subject is empty or null --- .../email/presentation/widgets/email_subject_widget.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/features/email/presentation/widgets/email_subject_widget.dart b/lib/features/email/presentation/widgets/email_subject_widget.dart index 6132c433c6..df45742f01 100644 --- a/lib/features/email/presentation/widgets/email_subject_widget.dart +++ b/lib/features/email/presentation/widgets/email_subject_widget.dart @@ -10,6 +10,10 @@ class EmailSubjectWidget extends StatelessWidget { @override Widget build(BuildContext context) { + if (presentationEmail.getEmailTitle().isEmpty) { + return const SizedBox.shrink(); + } + return Padding( padding: EmailSubjectStyles.padding, child: Text( From 2a47a1e55ce023f5c409d915dce6e840499a5503 Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 16 Sep 2024 09:35:35 +0700 Subject: [PATCH 3/5] Replace `dart:ui` to `dart:ui_web` when `platformViewRegistry` in `dart:ui` is deprecated --- core/lib/presentation/utils/shims/dart_ui_real.dart | 2 +- lib/features/base/isolate/isolate_manager.dart | 2 +- .../presentation/rule_filter_creator_controller_test.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/lib/presentation/utils/shims/dart_ui_real.dart b/core/lib/presentation/utils/shims/dart_ui_real.dart index 90ecd7d002..2cd8a4defa 100644 --- a/core/lib/presentation/utils/shims/dart_ui_real.dart +++ b/core/lib/presentation/utils/shims/dart_ui_real.dart @@ -2,4 +2,4 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -export 'dart:ui'; +export 'dart:ui_web'; diff --git a/lib/features/base/isolate/isolate_manager.dart b/lib/features/base/isolate/isolate_manager.dart index f85c79dc63..50a3765832 100644 --- a/lib/features/base/isolate/isolate_manager.dart +++ b/lib/features/base/isolate/isolate_manager.dart @@ -1,8 +1,8 @@ import 'dart:async'; import 'dart:isolate'; +import 'dart:ui'; -import 'package:core/presentation/utils/shims/dart_ui_real.dart'; import 'package:core/utils/app_logger.dart'; abstract class IsolateManager { diff --git a/test/features/rule_filter_creator/presentation/rule_filter_creator_controller_test.dart b/test/features/rule_filter_creator/presentation/rule_filter_creator_controller_test.dart index 5a73beaed8..9f91147e15 100644 --- a/test/features/rule_filter_creator/presentation/rule_filter_creator_controller_test.dart +++ b/test/features/rule_filter_creator/presentation/rule_filter_creator_controller_test.dart @@ -2,10 +2,10 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart'; import 'package:core/presentation/resources/image_paths.dart'; import 'package:core/presentation/utils/app_toast.dart'; import 'package:core/presentation/utils/responsive_utils.dart'; -import 'package:core/presentation/utils/shims/dart_ui_real.dart'; import 'package:core/utils/application_manager.dart'; import 'package:dartz/dartz.dart' hide State; import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart' hide State; import 'package:flutter_test/flutter_test.dart'; import 'package:get/get.dart'; import 'package:jmap_dart_client/jmap/account_id.dart'; From c2ce3acf7fc21e7c99260c1e6ad99efcb7952318 Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 23 Sep 2024 16:16:54 +0700 Subject: [PATCH 4/5] Remove blink blink of `next - previous` button in Email View --- .../presentation/widgets/email_view_app_bar_widget.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/features/email/presentation/widgets/email_view_app_bar_widget.dart b/lib/features/email/presentation/widgets/email_view_app_bar_widget.dart index 5317f78a21..bcfb5f1383 100644 --- a/lib/features/email/presentation/widgets/email_view_app_bar_widget.dart +++ b/lib/features/email/presentation/widgets/email_view_app_bar_widget.dart @@ -74,8 +74,6 @@ class EmailViewAppBarWidget extends StatelessWidget { const Spacer(), Row( children: [ - if(optionsWidget != null) - ...optionsWidget!, const SizedBox(width: EmailViewAppBarWidgetStyles.space), TMailButtonWidget.fromIcon( icon: _imagePaths.icMoveEmail, @@ -156,6 +154,9 @@ class EmailViewAppBarWidget extends StatelessWidget { ? (position) => onMoreActionClick?.call(presentationEmail, position) : null ), + if(optionsWidget != null) + ...optionsWidget!, + const SizedBox(width: EmailViewAppBarWidgetStyles.space), ] ), ]) From 53fb08b52653ee50893e324e2501de5dd44e9f30 Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 23 Sep 2024 16:36:46 +0700 Subject: [PATCH 5/5] Fix hyperlink iOS still show full link --- .../dom/sanitize_hyper_link_tag_in_html_transformers.dart | 4 +++- .../utils/html_transformer/transform_configuration.dart | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/lib/presentation/utils/html_transformer/dom/sanitize_hyper_link_tag_in_html_transformers.dart b/core/lib/presentation/utils/html_transformer/dom/sanitize_hyper_link_tag_in_html_transformers.dart index b710645bc9..ac66d9a792 100644 --- a/core/lib/presentation/utils/html_transformer/dom/sanitize_hyper_link_tag_in_html_transformers.dart +++ b/core/lib/presentation/utils/html_transformer/dom/sanitize_hyper_link_tag_in_html_transformers.dart @@ -18,7 +18,9 @@ class SanitizeHyperLinkTagInHtmlTransformer extends DomTransformer { }) async { final elements = document.querySelectorAll('a'); await Future.wait(elements.map((element) async { - _addToolTipWhenHoverLink(element); + if (useTooltip) { + _addToolTipWhenHoverLink(element); + } _addBlankForTargetProperty(element); _addNoReferrerForRelProperty(element); })); diff --git a/core/lib/presentation/utils/html_transformer/transform_configuration.dart b/core/lib/presentation/utils/html_transformer/transform_configuration.dart index eea5f86cf1..4b277d40c1 100644 --- a/core/lib/presentation/utils/html_transformer/transform_configuration.dart +++ b/core/lib/presentation/utils/html_transformer/transform_configuration.dart @@ -108,7 +108,7 @@ class TransformConfiguration { const RemoveScriptTransformer(), const BlockQuotedTransformer(), const BlockCodeTransformer(), - SanitizeHyperLinkTagInHtmlTransformer(), + SanitizeHyperLinkTagInHtmlTransformer(useTooltip: PlatformInfo.isWeb), const ImageTransformer(), const AddLazyLoadingForBackgroundImageTransformer(), const RemoveCollapsedSignatureButtonTransformer(),