TF-4013 Collapse all recipients fields when unfocus
(cherry picked from commit cd2c2db33a242d22a06265dca5fa4601753957ab)
This commit is contained in:
@@ -2,13 +2,16 @@ import 'package:core/presentation/views/responsive/responsive_widget.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:model/email/prefix_email_address.dart';
|
||||
import 'package:model/mailbox/expand_mode.dart';
|
||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/message_dialog_action_manager.dart';
|
||||
import 'package:tmail_ui_user/features/base/widget/dialog_picker/color_dialog_picker.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/extensions/composer_print_draft_extension.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/extensions/handle_edit_recipient_extension.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/extensions/handle_recipients_collapsed_extensions.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/extensions/mark_as_important_extension.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/extensions/remove_draggable_email_address_between_recipient_fields_extension.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/prefix_recipient_state.dart';
|
||||
@@ -18,6 +21,7 @@ import 'package:tmail_ui_user/features/composer/presentation/view/web/mobile_res
|
||||
import 'package:tmail_ui_user/features/composer/presentation/view/web/tablet_responsive_container_view.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/view/web/web_editor_view.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/insert_image_loading_bar_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/list_recipients_collapsed_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/mobile/from_composer_mobile_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/recipient_composer_widget.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/subject_composer_widget.dart';
|
||||
@@ -117,115 +121,71 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
onTap: () => controller.openSelectIdentityBottomSheet(context)
|
||||
),
|
||||
),
|
||||
RecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.to,
|
||||
listEmailAddress: controller.listToEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
fromState: controller.fromRecipientState.value,
|
||||
ccState: controller.ccRecipientState.value,
|
||||
bccState: controller.bccRecipientState.value,
|
||||
replyToState: controller.replyToRecipientState.value,
|
||||
expandMode: controller.toAddressExpandMode.value,
|
||||
controller: controller.toEmailAddressController,
|
||||
focusNode: controller.toAddressFocusNode,
|
||||
focusNodeKeyboard: controller.toAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyToEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
padding: ComposerStyle.mobileRecipientPadding,
|
||||
margin: ComposerStyle.mobileRecipientMargin,
|
||||
nextFocusNode: controller.getNextFocusOfToEmailAddress(),
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onAddEmailAddressTypeAction: controller.addEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
||||
RecipientsCollapsedComposerWidget(
|
||||
listEmailAddress: controller.allListEmailAddress,
|
||||
margin: ComposerStyle.mobileRecipientMargin,
|
||||
onShowAllRecipientsAction: controller.showFullRecipients,
|
||||
),
|
||||
if (controller.toRecipientState.value == PrefixRecipientState.enabled)
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.to,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
listEmailAddress: controller.listToEmailAddress,
|
||||
expandMode: controller.toAddressExpandMode.value,
|
||||
textController: controller.toEmailAddressController,
|
||||
focusNode: controller.toAddressFocusNode,
|
||||
focusNodeKeyboard: controller.toAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyToEmailTagEditor,
|
||||
nextFocusNode: controller.getNextFocusOfToEmailAddress(),
|
||||
isMobile: true,
|
||||
),
|
||||
if (controller.ccRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.cc,
|
||||
listEmailAddress: controller.listCcEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
listEmailAddress: controller.listCcEmailAddress,
|
||||
expandMode: controller.ccAddressExpandMode.value,
|
||||
controller: controller.ccEmailAddressController,
|
||||
textController: controller.ccEmailAddressController,
|
||||
focusNode: controller.ccAddressFocusNode,
|
||||
focusNodeKeyboard: controller.ccAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyCcEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.getNextFocusOfCcEmailAddress(),
|
||||
padding: ComposerStyle.mobileRecipientPadding,
|
||||
margin: ComposerStyle.mobileRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
isMobile: true,
|
||||
),
|
||||
if (controller.bccRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.bcc,
|
||||
listEmailAddress: controller.listBccEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
listEmailAddress: controller.listBccEmailAddress,
|
||||
expandMode: controller.bccAddressExpandMode.value,
|
||||
controller: controller.bccEmailAddressController,
|
||||
textController: controller.bccEmailAddressController,
|
||||
focusNode: controller.bccAddressFocusNode,
|
||||
focusNodeKeyboard: controller.bccAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyBccEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.getNextFocusOfCcEmailAddress(),
|
||||
padding: ComposerStyle.mobileRecipientPadding,
|
||||
margin: ComposerStyle.mobileRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
nextFocusNode: controller.getNextFocusOfBccEmailAddress(),
|
||||
isMobile: true,
|
||||
),
|
||||
if (controller.replyToRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.replyTo,
|
||||
listEmailAddress: controller.listReplyToEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
listEmailAddress: controller.listReplyToEmailAddress,
|
||||
expandMode: controller.replyToAddressExpandMode.value,
|
||||
controller: controller.replyToEmailAddressController,
|
||||
textController: controller.replyToEmailAddressController,
|
||||
focusNode: controller.replyToAddressFocusNode,
|
||||
focusNodeKeyboard: controller.replyToAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyReplyToEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.subjectEmailInputFocusNode,
|
||||
padding: ComposerStyle.mobileRecipientPadding,
|
||||
margin: ComposerStyle.mobileRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
isMobile: true,
|
||||
),
|
||||
],
|
||||
)),
|
||||
@@ -393,115 +353,67 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
margin: ComposerStyle.desktopRecipientMargin,
|
||||
onChangeIdentity: controller.onChangeIdentity,
|
||||
),
|
||||
RecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.to,
|
||||
listEmailAddress: controller.listToEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
fromState: controller.fromRecipientState.value,
|
||||
ccState: controller.ccRecipientState.value,
|
||||
bccState: controller.bccRecipientState.value,
|
||||
replyToState: controller.replyToRecipientState.value,
|
||||
expandMode: controller.toAddressExpandMode.value,
|
||||
controller: controller.toEmailAddressController,
|
||||
focusNode: controller.toAddressFocusNode,
|
||||
focusNodeKeyboard: controller.toAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyToEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
padding: ComposerStyle.desktopRecipientPadding,
|
||||
margin: ComposerStyle.desktopRecipientMargin,
|
||||
nextFocusNode: controller.getNextFocusOfToEmailAddress(),
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onAddEmailAddressTypeAction: controller.addEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
||||
RecipientsCollapsedComposerWidget(
|
||||
listEmailAddress: controller.allListEmailAddress,
|
||||
margin: ComposerStyle.desktopRecipientMargin,
|
||||
onShowAllRecipientsAction: controller.showFullRecipients,
|
||||
),
|
||||
if (controller.toRecipientState.value == PrefixRecipientState.enabled)
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.to,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
listEmailAddress: controller.listToEmailAddress,
|
||||
expandMode: controller.toAddressExpandMode.value,
|
||||
textController: controller.toEmailAddressController,
|
||||
focusNode: controller.toAddressFocusNode,
|
||||
focusNodeKeyboard: controller.toAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyToEmailTagEditor,
|
||||
nextFocusNode: controller.getNextFocusOfToEmailAddress(),
|
||||
),
|
||||
if (controller.ccRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.cc,
|
||||
listEmailAddress: controller.listCcEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
listEmailAddress: controller.listCcEmailAddress,
|
||||
expandMode: controller.ccAddressExpandMode.value,
|
||||
controller: controller.ccEmailAddressController,
|
||||
textController: controller.ccEmailAddressController,
|
||||
focusNode: controller.ccAddressFocusNode,
|
||||
focusNodeKeyboard: controller.ccAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyCcEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.getNextFocusOfCcEmailAddress(),
|
||||
padding: ComposerStyle.desktopRecipientPadding,
|
||||
margin: ComposerStyle.desktopRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
if (controller.bccRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.bcc,
|
||||
listEmailAddress: controller.listBccEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
listEmailAddress: controller.listBccEmailAddress,
|
||||
expandMode: controller.bccAddressExpandMode.value,
|
||||
controller: controller.bccEmailAddressController,
|
||||
textController: controller.bccEmailAddressController,
|
||||
focusNode: controller.bccAddressFocusNode,
|
||||
focusNodeKeyboard: controller.bccAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyBccEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.getNextFocusOfBccEmailAddress(),
|
||||
padding: ComposerStyle.desktopRecipientPadding,
|
||||
margin: ComposerStyle.desktopRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
if (controller.replyToRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.replyTo,
|
||||
listEmailAddress: controller.listReplyToEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
listEmailAddress: controller.listReplyToEmailAddress,
|
||||
expandMode: controller.replyToAddressExpandMode.value,
|
||||
controller: controller.replyToEmailAddressController,
|
||||
textController: controller.replyToEmailAddressController,
|
||||
focusNode: controller.replyToAddressFocusNode,
|
||||
focusNodeKeyboard: controller.replyToAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyReplyToEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.subjectEmailInputFocusNode,
|
||||
padding: ComposerStyle.desktopRecipientPadding,
|
||||
margin: ComposerStyle.desktopRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
],
|
||||
)),
|
||||
@@ -714,115 +626,67 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
margin: ComposerStyle.tabletRecipientMargin,
|
||||
onChangeIdentity: controller.onChangeIdentity,
|
||||
),
|
||||
RecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.to,
|
||||
listEmailAddress: controller.listToEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
fromState: controller.fromRecipientState.value,
|
||||
ccState: controller.ccRecipientState.value,
|
||||
bccState: controller.bccRecipientState.value,
|
||||
replyToState: controller.replyToRecipientState.value,
|
||||
expandMode: controller.toAddressExpandMode.value,
|
||||
controller: controller.toEmailAddressController,
|
||||
focusNode: controller.toAddressFocusNode,
|
||||
focusNodeKeyboard: controller.toAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyToEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
padding: ComposerStyle.tabletRecipientPadding,
|
||||
margin: ComposerStyle.tabletRecipientMargin,
|
||||
nextFocusNode: controller.getNextFocusOfToEmailAddress(),
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onAddEmailAddressTypeAction: controller.addEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
if (controller.recipientsCollapsedState.value == PrefixRecipientState.enabled)
|
||||
RecipientsCollapsedComposerWidget(
|
||||
listEmailAddress: controller.allListEmailAddress,
|
||||
margin: ComposerStyle.desktopRecipientMargin,
|
||||
onShowAllRecipientsAction: controller.showFullRecipients,
|
||||
),
|
||||
if (controller.toRecipientState.value == PrefixRecipientState.enabled)
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.to,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
listEmailAddress: controller.listToEmailAddress,
|
||||
expandMode: controller.toAddressExpandMode.value,
|
||||
textController: controller.toEmailAddressController,
|
||||
focusNode: controller.toAddressFocusNode,
|
||||
focusNodeKeyboard: controller.toAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyToEmailTagEditor,
|
||||
nextFocusNode: controller.getNextFocusOfToEmailAddress(),
|
||||
),
|
||||
if (controller.ccRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.cc,
|
||||
listEmailAddress: controller.listCcEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
listEmailAddress: controller.listCcEmailAddress,
|
||||
expandMode: controller.ccAddressExpandMode.value,
|
||||
controller: controller.ccEmailAddressController,
|
||||
textController: controller.ccEmailAddressController,
|
||||
focusNode: controller.ccAddressFocusNode,
|
||||
focusNodeKeyboard: controller.ccAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyCcEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.getNextFocusOfCcEmailAddress(),
|
||||
padding: ComposerStyle.tabletRecipientPadding,
|
||||
margin: ComposerStyle.tabletRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
if (controller.bccRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.bcc,
|
||||
listEmailAddress: controller.listBccEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
listEmailAddress: controller.listBccEmailAddress,
|
||||
expandMode: controller.bccAddressExpandMode.value,
|
||||
controller: controller.bccEmailAddressController,
|
||||
textController: controller.bccEmailAddressController,
|
||||
focusNode: controller.bccAddressFocusNode,
|
||||
focusNodeKeyboard: controller.bccAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyBccEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.getNextFocusOfBccEmailAddress(),
|
||||
padding: ComposerStyle.tabletRecipientPadding,
|
||||
margin: ComposerStyle.tabletRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
if (controller.replyToRecipientState.value == PrefixRecipientState.enabled)
|
||||
RecipientComposerWidget(
|
||||
_buildRecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: PrefixEmailAddress.replyTo,
|
||||
listEmailAddress: controller.listReplyToEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
controller: controller,
|
||||
maxWidth: constraints.maxWidth,
|
||||
listEmailAddress: controller.listReplyToEmailAddress,
|
||||
expandMode: controller.replyToAddressExpandMode.value,
|
||||
controller: controller.replyToEmailAddressController,
|
||||
textController: controller.replyToEmailAddressController,
|
||||
focusNode: controller.replyToAddressFocusNode,
|
||||
focusNodeKeyboard: controller.replyToAddressFocusNodeKeyboard,
|
||||
keyTagEditor: controller.keyReplyToEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: controller.subjectEmailInputFocusNode,
|
||||
padding: ComposerStyle.tabletRecipientPadding,
|
||||
margin: ComposerStyle.tabletRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction: controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
),
|
||||
],
|
||||
)),
|
||||
@@ -995,4 +859,58 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildRecipientComposerWidget({
|
||||
required String? composerId,
|
||||
required PrefixEmailAddress prefix,
|
||||
required ComposerController controller,
|
||||
required double maxWidth,
|
||||
required List<EmailAddress> listEmailAddress,
|
||||
required ExpandMode expandMode,
|
||||
required TextEditingController textController,
|
||||
required FocusNode? focusNode,
|
||||
required FocusNode? focusNodeKeyboard,
|
||||
required GlobalKey keyTagEditor,
|
||||
required FocusNode? nextFocusNode,
|
||||
bool isMobile = false,
|
||||
}) {
|
||||
return RecipientComposerWidget(
|
||||
composerId: composerId,
|
||||
prefix: prefix,
|
||||
prefixRootState: controller.prefixRootState,
|
||||
fromState: controller.fromRecipientState.value,
|
||||
toState: controller.toRecipientState.value,
|
||||
ccState: controller.ccRecipientState.value,
|
||||
bccState: controller.bccRecipientState.value,
|
||||
replyToState: controller.replyToRecipientState.value,
|
||||
listEmailAddress: listEmailAddress,
|
||||
imagePaths: controller.imagePaths,
|
||||
maxWidth: maxWidth,
|
||||
minInputLengthAutocomplete: controller.minInputLengthAutocomplete,
|
||||
expandMode: expandMode,
|
||||
controller: textController,
|
||||
focusNode: focusNode,
|
||||
focusNodeKeyboard: focusNodeKeyboard,
|
||||
keyTagEditor: keyTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,
|
||||
nextFocusNode: nextFocusNode,
|
||||
padding: isMobile
|
||||
? ComposerStyle.mobileRecipientPadding
|
||||
: ComposerStyle.desktopRecipientPadding,
|
||||
margin: isMobile
|
||||
? ComposerStyle.mobileRecipientMargin
|
||||
: ComposerStyle.desktopRecipientMargin,
|
||||
onFocusEmailAddressChangeAction: controller.onEmailAddressFocusChange,
|
||||
onShowFullListEmailAddressAction: controller.showFullEmailAddress,
|
||||
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
|
||||
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
|
||||
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
|
||||
onRemoveDraggableEmailAddressAction:
|
||||
controller.removeDraggableEmailAddress,
|
||||
onEditRecipientAction: controller.onEditRecipient,
|
||||
onClearFocusAction: controller.onClearFocusAction,
|
||||
onAddEmailAddressTypeAction: controller.addEmailAddressType,
|
||||
onDeleteEmailAddressTypeAction: controller.deleteEmailAddressType,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user