Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative input options (instead of text input) for a chat game #597

Closed
thomers opened this issue May 16, 2024 · 2 comments
Closed

Alternative input options (instead of text input) for a chat game #597

thomers opened this issue May 16, 2024 · 2 comments
Labels
feature New feature or request

Comments

@thomers
Copy link

thomers commented May 16, 2024

Hello! I'm searching for a Chat UI package that I can extend to allow for the following:

I'm creating a chat game that looks like a messenger app, with group chats and 1-on-1 chats etc. - the difference is that the chat messages that the player "receives" from the chat partners are generated one by one (with delays in between) by the story engine.

At certain points in the story, the user is asked for text input (like his name), and the player can enter any text as his answer (which is shown as a message coming from the user in the chat message list) - his answer is stored as a variable in the story engine and then the story continues.

At other points, the player is asked to select one of n predefined answer options, like in a "choose your own adventure"-style book. This means that he cannot enter text freely, but can only tap one of n (usually 2-4) answer buttons - which creates a message coming from the user as well with that answer option text, continuing the story.

Except at those interaction points where the story does not continue, the user cannot interact or enter input - he just sees the messages coming in one by one.

Basically, I'm looking for options in flutter_chat_ui to:

  • Enable/disable the input bar
  • When the input bar is tapped, optionally show the list of predefined answer buttons instead of using the text input field as normal.

How would I approach this?

Thanks,
Thomas

@thomers thomers added the feature New feature or request label May 16, 2024
@demchenkoalex
Copy link
Member

hey! so you supply messages array, so you have full control when to add/remove messages, with delay or not, no problems with that. Additionally (if you need), messages have metadata fields that is a simple Map, where you can store metadata like isUserReply. For the selection from predefined options, I saw people doing here both options under a message and on top of the text input bar, so it should be doable. For message people used bubbleBuilder and for text input either customBottomWidget to definite your own input from scratch, or listBottomWidget that will be at the end of the list, if that works for you. Additionally, there is inputOptions class that can accept enabled prop to control the input.

The only thing I am not sure is doable, is showing replies when you tap on an input, but having it still disabled. You can either change the logic to keep input disabled and show replies based on some outside event (so user don't need to tap on input to see them) or using customBottomWidget define your own input with this custom logic.

@demchenkoalex
Copy link
Member

closing this for now, lmk if further assistance is needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants