Allow setting the visibility of the SendButton #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
It adds the ability to change the visibility of the
SendButton
by introducing a new enum property calledsendButtonVisibilityMode
to theChat
widget.When
sendButtonVisibilityMode
parameter passed into theChat
widget, theInput
widget will check if the parameter is set toSendButtonVisibilityMode.always
. If it is, theSendButton
always be visible regardless of theTextField
state.If it is set to
SendButtonVisibilityMode.editing
, theSendButton
will be visible only if theTextField
is not empty.The
sendButtonVisibilityMode
parameter defaults toSendButtonVisibilityMode.editing
to maintain the existing behavior.Why is it needed?
It will increase the flexibility when displaying the
SendButton
.How to test it?
I've added some widget tests to not break the existing behavior and make sure everything works properly.
Related issues/PRs
Related #62