Skip to content

Document Container color constructor argument #15042

Closed

Description

@ScottS2017

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:

https://docs.flutter.io/flutter/widgets/Container/Container.html

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:

https://docs.flutter.io/flutter/widgets/Container-class.html

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!

Scott

Activity

  1. added this to the milestone on Mar 2, 2018
  2. changed the title [-]Simple, low priority docs issue[/-] [+]Document Container color constructor argument[/+] on Mar 2, 2018
  3. InMatrix commented on Mar 2, 2018

    @InMatrix

    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.

  4. ScottS2017 commented on Mar 2, 2018

    @ScottS2017
    Author

    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.

  5. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Dec 4, 2018
  6. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  7. pedromassangocode commented on Jul 22, 2020

    @pedromassangocode

    Closing this because the documentation of the Container class now shows the color property and is well documented.

    https://api.flutter.dev/flutter/widgets/Container-class.html

  8. github-actions commented on Aug 15, 2021

    @github-actions

    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.

  9. locked as resolved and limited conversation to collaborators on Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions