TF-3189 new reply to field in the mail composer

This commit is contained in:
Florent Azavant
2024-10-30 16:02:00 +01:00
committed by Dat H. Pham
parent 78be3e4d79
commit 74fc8d5d72
20 changed files with 354 additions and 31 deletions
@@ -47,6 +47,7 @@ class RecipientComposerWidget extends StatefulWidget {
final PrefixRecipientState fromState;
final PrefixRecipientState ccState;
final PrefixRecipientState bccState;
final PrefixRecipientState replyToState;
final bool? isInitial;
final FocusNode? focusNode;
final FocusNode? focusNodeKeyboard;
@@ -77,6 +78,7 @@ class RecipientComposerWidget extends StatefulWidget {
@visibleForTesting this.isTestingForWeb = false,
this.ccState = PrefixRecipientState.disabled,
this.bccState = PrefixRecipientState.disabled,
this.replyToState = PrefixRecipientState.disabled,
this.fromState = PrefixRecipientState.disabled,
this.isInitial,
this.controller,
@@ -368,6 +370,16 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
margin: RecipientComposerWidgetStyle.recipientMargin,
onTapActionCallback: () => widget.onAddEmailAddressTypeAction?.call(PrefixEmailAddress.bcc),
),
if (widget.replyToState == PrefixRecipientState.disabled)
TMailButtonWidget.fromText(
key: Key('prefix_${widget.prefix.name}_recipient_reply_to_button'),
text: AppLocalizations.of(context).reply_to_email_address_prefix,
textStyle: RecipientComposerWidgetStyle.prefixButtonTextStyle,
backgroundColor: Colors.transparent,
padding: RecipientComposerWidgetStyle.prefixButtonPadding,
margin: RecipientComposerWidgetStyle.recipientMargin,
onTapActionCallback: () => widget.onAddEmailAddressTypeAction?.call(PrefixEmailAddress.replyTo),
),
]
else if (PlatformInfo.isMobile)
TMailButtonWidget.fromIcon(
@@ -410,7 +422,8 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
bool get _isAllRecipientInputEnabled => widget.fromState == PrefixRecipientState.enabled
&& widget.ccState == PrefixRecipientState.enabled
&& widget.bccState == PrefixRecipientState.enabled;
&& widget.bccState == PrefixRecipientState.enabled
&& widget.replyToState == PrefixRecipientState.enabled;
List<EmailAddress> get _collapsedListEmailAddress => _isCollapse
? _currentListEmailAddress.sublist(0, 1)