-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
After deprecation period, remove this recipe #7154
Comments
Scrollable.of(context)
doesn't cause the widget to rebuild
Scrollable.of(context)
doesn't cause the widget to rebuild
Following what the documentation says, invoking |
@darshankawar Sorry to bother, but could you update the labels? |
@raulmabe 78152.mov
flutter doctor -v
Is this still not an expected behavior ? |
I don't really think this is the expected behaviour, as the doc says:
As far as I understand, each bubble should be rebuilt every time the user scrolls up or down to update its background gradient color. Notice that the bubbles are only rebuilt when the PD: I may be wrong and this can be the expected behaviour; so correct me if I'm wrong. |
Thanks for the details. Keeping this issue open for further investigation and updating labels. |
@kevmoo : As the original author of this page, could you shed light on this person's problem? I'm not sure where to begin to resolve this. |
If I remember right, the issue is calling
|
As per #10774, remove this recipe after a deprecation period. |
Page URL: https://docs.flutter.dev/cookbook/effects/gradient-bubbles
Page source: https://github.com/flutter/website/tree/master/src/docs/cookbook/effects/gradient-bubbles.md
Description of issue: I tried to implement this cookbook and I am getting an unexpected behaviour and I do not know if it is intended:
As the cookbook says
The CustomPainter requires the information necessary to determine where its bubble is within the ListView’s bounds, also known as the Viewport
so I understand that the viewport height increases when the ListView is infinite (i.e.ListView.builder
).Dart code
In my case, I have an infinite ListView, and when it renders for the first time it renders as expected, as the ListView is like 10 items length; but when scrolling down to see more texts, the ListView increases its height so the gradient chat bubbles does not update well and forms the unexpected behaviour.
Expected behaviour (First render and on hot-reload)
Unexpected behaviour (After scrolling down some items)
I do not really know if this is the expected behaviour but it seems wrong to me, I think may be it isn't updating itself on scroll as the doc says
Each bubble’s gradient changes as the user scrolls because the BubbleBackground widget invokes Scrollable.of(context). This method sets up an implicit dependency on the ancestor ScrollableState, which causes the BubbleBackground widget to rebuild every time the user scrolls up or down
Flutter doctor -v
The text was updated successfully, but these errors were encountered: