You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on my experience porting app code after #9648, it seems to be very common to have a Container with just a color. Right now we do a lot of work to handle that case. It seems like we could special-case that particular case to be much more efficient.
I meant a Container with a decoration that's just a color. The Container itself typically has other properties like width/height. But yeah, Container could use a widget like "ColoredBox" or something to handle this case.
Nothing has changed in this area since I filed it. We don't have any benchmarks for specifically this case though I wouldn't be surprised if several of our benchmarks do exercise the relevant code.
I had started this at one point and got caught up in trying to make it do more than it probably should (e.g. gradients).
A quick run of complex layout scroll perf suggests that this makes the benchmark faster (that app uses some Container that have color specified).
I'll put something up simple for this. If we want to support gradients it shouldn't be hard, or it shouldn't be too hard for someone else to just make a widget based on my simple one to do that.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
HansMuller commentedon Apr 28, 2017
Or a
BackgroundColorwidget?Hixie commentedon Apr 28, 2017
I meant a Container with a decoration that's just a color. The Container itself typically has other properties like width/height. But yeah, Container could use a widget like "ColoredBox" or something to handle this case.
HansMuller commentedon Apr 28, 2017
Similarly, if I just want to add a background color, I could use
ColoredBox(color: color, child: ...), instead of Container.liyuqian commentedon Oct 7, 2019
Is this still an active issue? Do we have a benchmark or metric that tracks this? @Hixie @HansMuller
Hixie commentedon Oct 7, 2019
Nothing has changed in this area since I filed it. We don't have any benchmarks for specifically this case though I wouldn't be surprised if several of our benchmarks do exercise the relevant code.
dnfield commentedon Feb 18, 2020
I had started this at one point and got caught up in trying to make it do more than it probably should (e.g. gradients).
A quick run of complex layout scroll perf suggests that this makes the benchmark faster (that app uses some
Containerthat havecolorspecified).I'll put something up simple for this. If we want to support gradients it shouldn't be hard, or it shouldn't be too hard for someone else to just make a widget based on my simple one to do that.
github-actions commentedon Aug 22, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.