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

Request sample code for popular API docs #21136

Closed
11 of 14 tasks
InMatrix opened this issue Aug 28, 2018 · 10 comments
Closed
11 of 14 tasks

Request sample code for popular API docs #21136

InMatrix opened this issue Aug 28, 2018 · 10 comments
Labels
d: api docs Issues with https://api.flutter.dev/ f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list

Comments

@InMatrix InMatrix added easy fix d: api docs Issues with https://api.flutter.dev/ labels Aug 28, 2018
@MisterJimson
Copy link

Where in the repo are these docs? I took a quick look around and couldn't find them.

@zoechi
Copy link
Contributor

zoechi commented Aug 31, 2018

@MisterJimson They are mixed with the code (comments that start with ///)

/// Implements the basic material design visual layout structure.
///
/// This class provides APIs for showing drawers, snack bars, and bottom sheets.
///
/// To display a snackbar or a persistent bottom sheet, obtain the
/// [ScaffoldState] for the current [BuildContext] via [Scaffold.of] and use the
/// [ScaffoldState.showSnackBar] and [ScaffoldState.showBottomSheet] functions.
///
/// See also:
///
/// * [AppBar], which is a horizontal bar typically shown at the top of an app
/// using the [appBar] property.
/// * [BottomAppBar], which is a horizontal bar typically shown at the bottom
/// of an app using the [bottomNavigationBar] property.
/// * [FloatingActionButton], which is a circular button typically shown in the
/// bottom right corner of the app using the [floatingActionButton] property.
/// * [FloatingActionButtonLocation], which is used to place the
/// [floatingActionButton] within the [Scaffold]'s layout.
/// * [FloatingActionButtonAnimator], which is used to animate the
/// [floatingActionButton] from one [floatingActionButtonLocation] to
/// another.
/// * [Drawer], which is a vertical panel that is typically displayed to the
/// left of the body (and often hidden on phones) using the [drawer]
/// property.
/// * [BottomNavigationBar], which is a horizontal array of buttons typically
/// shown along the bottom of the app using the [bottomNavigationBar]
/// property.
/// * [SnackBar], which is a temporary notification typically shown near the
/// bottom of the app using the [ScaffoldState.showSnackBar] method.
/// * [BottomSheet], which is an overlay typically shown near the bottom of the
/// app. A bottom sheet can either be persistent, in which case it is shown
/// using the [ScaffoldState.showBottomSheet] method, or modal, in which case
/// it is shown using the [showModalBottomSheet] function.
/// * [ScaffoldState], which is the state associated with this widget.
/// * <https://material.google.com/layout/structure.html>

/// The primary content of the scaffold.
///
/// Displayed below the app bar and behind the [floatingActionButton] and
/// [drawer]. To avoid the body being resized to avoid the window padding
/// (e.g., from the onscreen keyboard), see [resizeToAvoidBottomPadding].
///
/// The widget in the body of the scaffold is positioned at the top-left of
/// the available space between the app bar and the bottom of the scaffold. To
/// center this widget instead, consider putting it in a [Center] widget and
/// having that be the body. To expand this widget instead, consider
/// putting it in a [SizedBox.expand].
///
/// If you have a column of widgets that should normally fit on the screen,
/// but may overflow and would in such cases need to scroll, consider using a
/// [ListView] as the body of the scaffold. This is also a good choice for
/// the case where your body is a scrollable list.

@MisterJimson
Copy link

They don't seem to match with the web pages in this issue.

For example, the Scaffold API doc webpage has these sentences not present in the code.

The color of the Material widget that underlies the entire Scaffold
This class provides APIs for showing drawers, snack bars, and bottom sheets
Creates the mutable state for this widget at a given location in the tree

And these sentences from the repo's code Scaffold file are not present on the web page.

The geometry of the [Scaffold] after all its contents have been laid out
Creates a copy of this [ScaffoldGeometry] but with the given fields replaced with

This issue is about updating the API docs webpages, from what I can see there does not seem to be a direct relationship between the docs in the code and on the website, unless I am missing something.

@zoechi
Copy link
Contributor

zoechi commented Aug 31, 2018

/// The color of the [Material] widget that underlies the entire Scaffold.

image

@InMatrix
Copy link
Author

@MisterJimson Sorry about the confusion. The reason you saw the discrepancy between the docs and the code is that docs.flutter.io is generated from the beta branch of Flutter, but the code you were looking at is on the master branch. The API docs for the master branch lives at https://master-docs-flutter-io.firebaseapp.com/

@NPKompleet
Copy link
Contributor

@InMatrix I just added some sample code for BottomNavigationBar and Scaffold. Would more later.

dnfield pushed a commit that referenced this issue Oct 4, 2018
* added sample code for scaffold widget [#21136]

* Fixed indent and spacing for scaffold sample code

* Update scaffold.dart

Fix one more formatting issue
Hixie pushed a commit that referenced this issue Oct 16, 2018
* Added sample code for BottomNavigationBar widget [#21136]

* bottomnavigationbaritems made single line
@zoechi zoechi added the framework flutter/packages/flutter repository. See also f: labels. label Dec 11, 2018
@zoechi zoechi added this to the Goals milestone Dec 11, 2018
Piinks added a commit to Piinks/flutter that referenced this issue Feb 14, 2019
Piinks added a commit that referenced this issue Feb 15, 2019
* Added sample code for a simple Icon, ref: #21136

* Removed duplicate line.

* Fixed incoreect parameter.

* Update icon.dart

Removed empty prose and added better context for sample code. Changed sample code for better visibility in execution of default app themes.

* Alas, Trailing space.

Nixed trailing space in comments.
@Piinks
Copy link
Contributor

Piinks commented Feb 19, 2019

Updated/Checked-off the completed sample code snippets. ref: master docs

Piinks added a commit to Piinks/flutter that referenced this issue Feb 27, 2019
Piinks added a commit that referenced this issue Feb 27, 2019
* Added code snippet for TextField class. ref:#21136

* Errant semicolon
Piinks pushed a commit that referenced this issue Feb 28, 2019
* Update flat_button.dart

* Added smaple code for Flat Button

* Update flat_button.dart

* Revert "Update flat_button.dart"

This reverts commit c8f00df.

* Revert "Added smaple code for Flat Button"

This reverts commit adc4234.

* Update flat_button.dart

* Update flat_button.dart

* Update flat_button.dart

* remove white spaces

* remove white spaces

* add two different samples

* Update flat_button.dart
Piinks added a commit to Piinks/flutter that referenced this issue Feb 28, 2019
Piinks added a commit that referenced this issue Mar 1, 2019
* Added code snippet for Expanded class. ref:#21136

* Changed the code samples into snippet application samples.
@Piinks Piinks mentioned this issue Mar 1, 2019
10 tasks
Piinks added a commit that referenced this issue Mar 4, 2019
* Added code snippets for FloatingActionButton Class. ref:#21136

* Extraneous white spaces.

Co-Authored-By: Piinks <katelovett@google.com>

* Alignment correction.

* The analyze result wasn't showing on github interface. Checked through Cirrus and it's all-green.

Co-Authored-By: Piinks <katelovett@google.com>
@Piinks Piinks self-assigned this Mar 4, 2019
Piinks added a commit to Piinks/flutter that referenced this issue Mar 4, 2019
@Piinks Piinks mentioned this issue Mar 4, 2019
10 tasks
Piinks added a commit that referenced this issue Mar 7, 2019
* Added code snippet for Form Class. ref:#21136

* Formatting adjustments.

* Changed wording related to GlobalKey.
@Piinks Piinks removed their assignment Jun 12, 2019
@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@iapicca
Copy link
Contributor

iapicca commented Jul 22, 2020

Hi @InMatrix cc @Piinks
from the list above are missing only
Image class, Icon class and ThemeData class,
now the docs offer a brief, but representative, code sample

Is it safe to close this issue?
Thank you

@iapicca iapicca added documentation waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds f: material design flutter/packages/flutter/material repository. labels Jul 22, 2020
@Piinks
Copy link
Contributor

Piinks commented Jul 22, 2020

Hi @InMatrix cc @Piinks
from the list above are missing only
Image class, Icon class and ThemeData class,
now the docs offer a brief, but representative, code sample

Is it safe to close this issue?
Thank you

Awesome! LGTM, and thank you for checking! I think we can close this now. 🎉

@Piinks Piinks closed this as completed Jul 22, 2020
@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 28, 2021
@github-actions
Copy link

github-actions bot commented Aug 2, 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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
d: api docs Issues with https://api.flutter.dev/ f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list
Projects
Widget Documentation
Awaiting triage
Development

No branches or pull requests

8 participants