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
{{ message }}
Repository navigation
Document Container color constructor argument #15042
I'm not sure how widespread this particular little issue is but I found it for the Container Widget and Container Class pages.
In short, the Container has a color property that is part of the constructor and this is clearly listed at the top of the page for the Container constructor, here:
However, I mistakenly thought that the Container would not have a color property because color is not listed as one of the properties on the right hand side of the page for the Container class, here:
After having it pointed out to me that the Container does, in fact, have a color property, I went digging down into the Class page rather than relying on the summary or properties and methods on the right. There, in the text about the constructor, it does clearly state that there is a color property as part of the constructor.
This is not an urgent issue but it's not trivial either, since I'm attempting to put together presentation material on Flutter for Google Developer Groups and meetups and I've created materials based on those summaries in the class pages for each widget.
Interest in Flutter is growing exponentially, and those of us stepping out to speak to groups about Flutter can't afford to be putting out bad information. I'll be extra careful to triple check and not completely trust the summaries from now on but we really do need to ensure that every list of a Class' properties contains... well, all the properties.
Thanks and, as always, I appreciate all the fantastic, hard work that's been going on. Just because "you missed a spot", that doesn't mean that the thousands of spots you didn't miss aren't great. They are!
This one is tricky. The reason why color didn't show up as a property is that the color argument of the constructor didn't actually become a property, when a Container object gets instantiated. Instead, it gets passed to the constructor of a BoxDecoration object to style the Container. Please see these lines in the source code: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/container.dart#L259-L263
One potential solution is to show constructor arguments instead of properties on the sidebar. Cc: @jcollins-g who works on DartDoc.
See, that's what I thought. I thought that the decoration was what had the color but when you read that the container can take a color parameter in it's constructor it leads one to believe the Container has a color property somewhere.
Not an easy fix, I agree. I can see that I'll be bending a lot of ears to triple check my facts before I step in front of an audience.
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
[-]Simple, low priority docs issue[/-][+]Document Container color constructor argument[/+]InMatrix commentedon Mar 2, 2018
This one is tricky. The reason why
colordidn't show up as a property is that thecolorargument of the constructor didn't actually become a property, when a Container object gets instantiated. Instead, it gets passed to the constructor of a BoxDecoration object to style the Container. Please see these lines in the source code: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/container.dart#L259-L263One potential solution is to show constructor arguments instead of properties on the sidebar. Cc: @jcollins-g who works on DartDoc.
ScottS2017 commentedon Mar 2, 2018
See, that's what I thought. I thought that the decoration was what had the color but when you read that the container can take a color parameter in it's constructor it leads one to believe the Container has a color property somewhere.
Not an easy fix, I agree. I can see that I'll be bending a lot of ears to triple check my facts before I step in front of an audience.
pedromassangocode commentedon Jul 22, 2020
Closing this because the documentation of the
Containerclass now shows the color property and is well documented.https://api.flutter.dev/flutter/widgets/Container-class.html
github-actions commentedon Aug 15, 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.