From e9fa9fe3a8307cde3f9a86607820f71ca8ea7d75 Mon Sep 17 00:00:00 2001 From: hieubt Date: Fri, 3 Nov 2023 16:05:39 +0700 Subject: [PATCH] TF-2196 Add 'From'to recipient widget (cherry picked from commit b2e443ab6df966526bb6fd3cdc24915b3b5c48cb) --- .../widgets/recipient_composer_widget.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/features/composer/presentation/widgets/recipient_composer_widget.dart b/lib/features/composer/presentation/widgets/recipient_composer_widget.dart index 473e20f98..ad77746a2 100644 --- a/lib/features/composer/presentation/widgets/recipient_composer_widget.dart +++ b/lib/features/composer/presentation/widgets/recipient_composer_widget.dart @@ -40,6 +40,7 @@ class RecipientComposerWidget extends StatefulWidget { final PrefixEmailAddress prefix; final List listEmailAddress; final ExpandMode expandMode; + final PrefixRecipientState fromState; final PrefixRecipientState ccState; final PrefixRecipientState bccState; final bool? isInitial; @@ -66,6 +67,7 @@ class RecipientComposerWidget extends StatefulWidget { required this.listEmailAddress, this.ccState = PrefixRecipientState.disabled, this.bccState = PrefixRecipientState.disabled, + this.fromState = PrefixRecipientState.disabled, this.isInitial, this.controller, this.focusNode, @@ -301,6 +303,15 @@ class _RecipientComposerWidgetState extends State { ) ), const SizedBox(width: RecipientComposerWidgetStyle.space), + if (widget.prefix == PrefixEmailAddress.to && widget.fromState == PrefixRecipientState.disabled) + TMailButtonWidget.fromText( + text: AppLocalizations.of(context).from_email_address_prefix, + textStyle: RecipientComposerWidgetStyle.prefixButtonTextStyle, + backgroundColor: Colors.transparent, + padding: RecipientComposerWidgetStyle.prefixButtonPadding, + margin: RecipientComposerWidgetStyle.recipientMargin, + onTapActionCallback: () => widget.onAddEmailAddressTypeAction?.call(PrefixEmailAddress.from), + ), if (widget.prefix == PrefixEmailAddress.to && widget.ccState == PrefixRecipientState.disabled) TMailButtonWidget.fromText( text: AppLocalizations.of(context).cc_email_address_prefix,