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

StreamChannel() Doesn't Show Loading Screen #678

Closed
1 task done
mingzew opened this issue Sep 11, 2021 · 16 comments
Closed
1 task done

StreamChannel() Doesn't Show Loading Screen #678

mingzew opened this issue Sep 11, 2021 · 16 comments
Assignees
Labels

Comments

@mingzew
Copy link

mingzew commented Sep 11, 2021

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

Android

What version are you using?

2.2.1

What happened?

Loading up widgets that contain StreamChannel() initially (after restart of app or Hot Restart) takes a long time (4-6 seconds) and it doesn't show a loading bar even with showLoading: true.

Steps to reproduce

1. Set up a ChannelListView with channelPreviewBuilder that have a ontap function that calls StreamChannel()
2. Fire up the app for the first time and tap on the widget that builds StreamChannel()

Supporting info to reproduce

No response

Relevant log output

No response

Flutter analyze output

No response

Flutter doctor output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mingzew mingzew added the bug Something isn't working label Sep 11, 2021
@jagged91
Copy link

jagged91 commented Sep 13, 2021

I noticed a related issue, that the message list view doesn't seem to use my loadingBuilder and instead shows a circular progress indicator with default colors, despite my theme colors already being defined.

loadingBuilder: (context) { return Center( child: SizedBox( width: 128, height: 128, child: Lottie.asset( "assets/loading_indicator.json"))); },

@imtoori
Copy link
Contributor

imtoori commented Sep 13, 2021

@mingzew can you add a snippet for reproducing the bug? thanks

@imtoori
Copy link
Contributor

imtoori commented Sep 13, 2021

@jgadsby are you talking about the widget that shows when there are no messages?

@jagged91
Copy link

@jgadsby are you talking about the widget that shows when there are no messages?

No, just the widget that shows when the channel is loading.

@imtoori
Copy link
Contributor

imtoori commented Sep 13, 2021

what do you mean? the loading indicator for pagination?

@jagged91
Copy link

what do you mean? the loading indicator for pagination?

What does loadingBuilder actually override in MessageListView?

@imtoori
Copy link
Contributor

imtoori commented Sep 14, 2021

it overrides the list loading indicator that shows up when we're fetching the messages
are you trying to override the loading indicator for pagination? we should add that option I think

@jagged91
Copy link

jagged91 commented Sep 15, 2021

it overrides the list loading indicator that shows up when we're fetching the messages
are you trying to override the loading indicator for pagination? we should add that option I think

Yeah, that's what's not working for me. I'm not trying to override the pagination loader. See this snippet which doesn't work (you can use anything in loadingBuilder):

loadingBuilder: (context) { return Center( child: SizedBox( width: 128, height: 128, child: Lottie.asset( "assets/loading_indicator.json"))); },

@imtoori
Copy link
Contributor

imtoori commented Sep 17, 2021

yeah it's not that it doesn't work, it overrides only the main loading indicator that you can see when the first query is in progress, not the one used while paginating
I added a task in our backlog for letting users customize even that one. we'll work on that

@mingzew
Copy link
Author

mingzew commented Sep 21, 2021

Hi i've attached a code example showing the issue. A few things

  1. I've used a custom channel_type with character count to 1000 and all commands turned off
  2. I created a bunch of channel with 2 users, with one of the user being "user1"
  3. To run the code - change apiKey, channelType, and userId (assign it "user1" or w/e user name you've created) in stream_api.dart
  4. once it ran, click any channel with some text msg in it and you can see console print out "chat initState is being called" and "chat finished build" really quickly, but it takes about 2-4 second to go to see the actual chat msg without loading screen

Let me know if you have any questions
my_app.zip

@imtoori
Copy link
Contributor

imtoori commented Sep 21, 2021

hey @mingzew this is probably a performance issue, we're looking into that
I'll let you know as soon as we have more information

@mingzew
Copy link
Author

mingzew commented Sep 22, 2021

Yeah the time it takes is not ideal, that seem like a performance related issue. The loading screen should show in the main time, no?

Perhaps there's a work around with futureBuilder?

@imtoori imtoori modified the milestone: Sprint 1 Mar 10, 2022
@imtoori
Copy link
Contributor

imtoori commented Mar 16, 2022

Hey @mingzew
it's been a while since this issue received some comments
Now we are on version 3.5.1 of the SDK and I think we made some solid progress
Can you check and tell me what you think?

@Abacaxi-Nelson
Copy link
Contributor

Hi @imtoori
Do you want me to create a new issue ?
I'm experiencing long loading time (without the loader indicator).
I dont know if its same issue or not (last sdk version) (Circle chats on left have same behaviour, but i preload it)

Untitled.mp4

@imtoori
Copy link
Contributor

imtoori commented Mar 23, 2022

@Abacaxi-Nelson yes please create a new issue
This seems like a different issue

@no-response
Copy link

no-response bot commented Mar 23, 2022

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.

@no-response no-response bot closed this as completed Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

4 participants