Skip to content
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

AdoptAWidget: FittedBox #69503

Merged
merged 7 commits into from Nov 1, 2020
Merged

AdoptAWidget: FittedBox #69503

merged 7 commits into from Nov 1, 2020

Conversation

singhsuryanshu
Copy link
Contributor

AdoptAWidget: FittedBox

Added a code / DartPad sample to the FittedBox API Docs

This pull request is:

  • A code sample
  • More references
  • More explanation

closes #69478

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Oct 31, 2020
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@google-cla
Copy link

google-cla bot commented Oct 31, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Oct 31, 2020
@singhsuryanshu
Copy link
Contributor Author

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Oct 31, 2020
@@ -1474,6 +1474,29 @@ class CompositedTransformFollower extends SingleChildRenderObjectWidget {
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=T4Uehk3_wlY}
///
///
///{@tool sample --template=stateless_widget_scaffold_center.tmpl}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the .tmpl suffix here. Also, Make sure there's at least one space between the code comment /// and the comment contents, here and throughout the change.

Suggested change
///{@tool sample --template=stateless_widget_scaffold_center.tmpl}
/// {@tool sample --template=stateless_widget_scaffold_center}

///
///{@tool sample --template=stateless_widget_scaffold_center.tmpl}
///
///In this example, the image is stretched to fill the entire [Container](https://master-api.flutter.dev/flutter/widgets/Container-class.html) which would not happen normally without using FittedBox.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Make sure that each line is shorter than 80 characters if possible
  • The dartdocs automatically link widgets, so you do not need to include the URL like you would in a Github comment
Suggested change
///In this example, the image is stretched to fill the entire [Container](https://master-api.flutter.dev/flutter/widgets/Container-class.html) which would not happen normally without using FittedBox.
/// In this example, the image is stretched to fill the entire [Container], which would
/// not happen normally without using FittedBox.

Comment on lines 1482 to 1494
///```dart
///Widget build(BuildContext) {
/// return Container(
/// height: 400,
/// width: 300,
/// color: Colors.red,
/// child: FittedBox(
/// child: Image.network('https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
/// fit: BoxFit.fill,
/// ),
/// );
///}
///```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
///```dart
///Widget build(BuildContext) {
/// return Container(
/// height: 400,
/// width: 300,
/// color: Colors.red,
/// child: FittedBox(
/// child: Image.network('https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
/// fit: BoxFit.fill,
/// ),
/// );
///}
///```
/// ```dart
/// Widget build(BuildContext) {
/// return Container(
/// height: 400,
/// width: 300,
/// color: Colors.red,
/// child: FittedBox(
/// child: Image.network('https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
/// fit: BoxFit.fill,
/// ),
/// );
/// }
/// ```

///```
///
///
///{@end-tool}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
///{@end-tool}
/// {@end-tool}

///}
///```
///
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra line

Suggested change
///

packages/flutter/lib/src/widgets/basic.dart Show resolved Hide resolved
Copy link
Contributor

@shihaohong shihaohong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -1474,6 +1474,28 @@ class CompositedTransformFollower extends SingleChildRenderObjectWidget {
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=T4Uehk3_wlY}
///
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Just caught this extra line as well

Suggested change
///

@shihaohong shihaohong added d: api docs Issues with https://api.flutter.dev/ waiting for tree to go green labels Nov 1, 2020
@singhsuryanshu
Copy link
Contributor Author

The checks are not running .....
@shihaohong

@shihaohong
Copy link
Contributor

@singhsuryanshu The remaining checks are queued but not finished yet

@shihaohong shihaohong closed this Nov 1, 2020
@shihaohong shihaohong reopened this Nov 1, 2020
@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Windows tool_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@johnpryan
Copy link
Contributor

@singhsuryanshu Thanks for participating in AdoptAWidget. We would like to send you a special thanks. If you are interested, please send an email to nyener at google dot com and provide a link to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d: api docs Issues with https://api.flutter.dev/ framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adopt a Widget - FittedBox
4 participants