-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add documentation. Also, add constructors to SliverGrid. #10904
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
Conversation
|
cc @HansMuller for review |
| /// The following shows the code required to write a widget that fully conforms | ||
| /// to the [ImageProvider] and [Widget] protocols. (It is essentially a | ||
| /// bare-bones version of the [Image] widget.) | ||
| /// bare-bones version of the [widgets.Image] widget.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize that this worked. NICE
|
Landing this now but I must remember to check if that does indeed work... |
| /// ```dart | ||
| /// new Image.asset('images/cat.png') | ||
| /// ``` | ||
| /// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this would be a good place to say that a 4x device would get the 3.5x cat, since that's the closest (or whatever our criteria actually is).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in new PR
| /// Once code has been ported to use [CustomScrollView], other slivers, such as | ||
| /// [SliverGrid] or [SliverAppBar], can be put in the [CustomScrollView.slivers] | ||
| /// list. | ||
| /// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really helpful. A little example that showed a ListView and the same CustomScrollVIew might be helpul too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, also done for grid.
| }) : super(key: key, delegate: delegate); | ||
|
|
||
| /// Creates a sliver that places multiple box children in a two dimensional | ||
| /// arrangement with a fixed number of tiles in the cross axis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be OK to say grid instead of "arrangement"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we try to avoid using the same words as in the name of the member being documented, because if someone is reading the docs, then the name has already failed them. :-)
| /// | ||
| /// Uses a [SliverGridDelegateWithFixedCrossAxisCount] as the [gridDelegate], | ||
| /// and a [SliverChildListDelegate] as the [delegate]. | ||
| SliverGrid.count({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to say that the grid's main axis is the scrolling axis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in the main GridView and SliverGrid class-level docs.
| super(key: key, delegate: new SliverChildListDelegate(children)); | ||
|
|
||
| /// Creates a sliver that places multiple box children in a two dimensional | ||
| /// arrangement with tiles that have a maximum cross-axis extent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where the tiles' cumulative cross axis extent is [maxCrossAxisExtent]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think that's accurate. the current text seems more correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added "each" to make that clearer.
|
LGTM |
|
Oops, I landed this before the LGTM. My bad. Will apply your fixes. |
|
-> #10953 |
Applies comments I missed from flutter#10904.
Applies comments I missed from #10904.
Applies comments I missed from flutter#10904.
No description provided.