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

Expand StreamMessageWidget #1642

Closed
1 task done
Elevencode opened this issue Jun 29, 2023 · 7 comments · Fixed by #1643
Closed
1 task done

Expand StreamMessageWidget #1642

Elevencode opened this issue Jun 29, 2023 · 7 comments · Fixed by #1643
Labels
enhancement New feature or request

Comments

@Elevencode
Copy link

Elevencode commented Jun 29, 2023

Please select which package this feature is related to

stream_chat_flutter

Which platforms would this feature impact?

Web

Is your feature request related to a problem?

I use the standard StreamMessageWidget. Please tell me, is there any way to stretch it to the full width of StreamMessageListView? I've researched these widgets, but haven't seen a solution other than to make a fork and change the constraints.

Describe the solution that you'd like

No response

Describe alternatives that you have considered

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Elevencode Elevencode added the enhancement New feature or request label Jun 29, 2023
@xsahil03x
Copy link
Contributor

Hey @Elevencode, you can modify the MessageWidget and pass widthFactor as 1.0.

Thanks.

@Elevencode
Copy link
Author

@xsahil03x I tried that, but it didn't help

@xsahil03x
Copy link
Contributor

@Elevencode, working fine for me.

defaultWidget.copyWith(
    widthFactor: 1,
)
Screenshot 2023-06-29 at 4 01 27 PM

@Elevencode
Copy link
Author

Elevencode commented Jun 29, 2023

@xsahil03x even on the web?

image

@Elevencode
Copy link
Author

@xsahil03x
how I use it:

Widget build(BuildContext context) => Navigator(
        onGenerateRoute: (settings) => MaterialPageRoute(
          builder: (context) => Scaffold(
            appBar: StreamChannelHeader(
              onBackPressed: widget.onBackPressed != null
                  ? () {
                      widget.onBackPressed!(context);
                    }
                  : null,
              showBackButton: widget.showBackButton,
            ),
            body: Column(
              children: <Widget>[
                Expanded(
                  child: StreamMessageListView(
                    onMessageSwiped: (CurrentPlatform.isAndroid || CurrentPlatform.isIos) ? reply : null,
                    messageBuilder: (context, details, messages, defaultWidget) {
                      return defaultWidget.copyWith(
                        widthFactor: 1,
                        onReplyTap: reply,
                        textBuilder: (context, message) {
                          return details.message.user?.id != client.state.currentUser?.id
                              ? CustomMessageText(message: message)
                              : SelectionArea(child: Text(message.text ?? ''));
                        },
                      );
                    },
                  ),
                ),
                StreamMessageInput(
                  onQuotedMessageCleared: messageInputController.clearQuotedMessage,
                  focusNode: focusNode,
                  messageInputController: messageInputController,
                ),
              ],
            ),
          ),
        ),
      );

@xsahil03x
Copy link
Contributor

@Elevencode, should be fixed by above PR.

@Elevencode
Copy link
Author

@xsahil03x thank you very much!

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

Successfully merging a pull request may close this issue.

2 participants