fix: missing To field when only other fields are filled
This commit is contained in:
@@ -325,8 +325,7 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
|
||||
),
|
||||
if (widget.prefix == widget.prefixRootState && _isWeb && !isMobileResponsive)
|
||||
..._buildListPrefixWidgets(),
|
||||
if (widget.prefix == widget.prefixRootState && (isMobileResponsive || widget.isTestingForWeb))
|
||||
_buildExpandButton(),
|
||||
if (_isShowExpandButton(isMobileResponsive)) _buildExpandButton(),
|
||||
if (widget.prefix != widget.prefixRootState && _isWeb && !isMobileResponsive)
|
||||
TMailButtonWidget.fromIcon(
|
||||
icon: widget.imagePaths.icClose,
|
||||
@@ -400,6 +399,24 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
|
||||
];
|
||||
}
|
||||
|
||||
bool _isShowExpandButton(bool isMobileResponsive) {
|
||||
final onlyCcEnabled = widget.toState == PrefixRecipientState.disabled &&
|
||||
widget.ccState == PrefixRecipientState.enabled;
|
||||
|
||||
final onlyBccEnabled = widget.toState == PrefixRecipientState.disabled &&
|
||||
widget.ccState == PrefixRecipientState.disabled &&
|
||||
widget.bccState == PrefixRecipientState.enabled;
|
||||
|
||||
final shouldCheckPrefix = switch (widget.prefix) {
|
||||
PrefixEmailAddress.to => widget.toState == PrefixRecipientState.enabled,
|
||||
PrefixEmailAddress.cc => onlyCcEnabled,
|
||||
PrefixEmailAddress.bcc => onlyBccEnabled,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
return shouldCheckPrefix && (isMobileResponsive || widget.isTestingForWeb);
|
||||
}
|
||||
|
||||
Widget _buildExpandButton() {
|
||||
return TMailButtonWidget.fromIcon(
|
||||
key: Key('prefix_${widget.prefix.name}_recipient_expand_button'),
|
||||
|
||||
Reference in New Issue
Block a user