Small typo with text on the source of an example text file (#105326)

* Small typo with text on the source of an example text file

* Added short paragraph on example location

* Keep line length around 80 chars

* Moved description of adding tests to a different paragraph

* Removed whitespace

* small 80 chars fix

* small 80 chars fix

* fixed col length

* trailing whitespace
This commit is contained in:
Youssef Attia 2022-06-06 13:24:00 -07:00 committed by GitHub
parent e9a3cbf2b4
commit e9230bada5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,8 +77,14 @@ Use `{@tool dartpad}` for Dartpad examples, and use `{@tool sample}` for
examples that shouldn't be run/shown in Dartpad.
Once that comment block is inserted in the source code, create a new file at the
appropriate path under [`examples/api`](.). You should also add tests for your
sample code under [`examples/api/test`](./test).
appropriate path under [`examples/api`](.) that matches the location of the
source file they are linked from, and are named for the symbol they are attached
to, in lower_snake_case, with an index relating to their order within the doc
comment. So, for the `Curve2D` case, since it's in the `animation` package, in
a file called `curves.dart`, and it's the first example, it goes in
`examples/api/lib/animation/curves/curve2_d.0.dart`.
You should also add tests for your sample code under [`examples/api/test`](./test).
The entire example should be in a single file, so that Dartpad can load it.
@ -131,5 +137,5 @@ Tests go into a directory under [test](./test) that matches their location under
`_test.dart` at the end, like other tests. For instance, a `LayoutBuilder`
example that resides in [`lib/widgets/layout_builder/layout_builder.0.dart`](
./lib/widgets/layout_builder/layout_builder.0.dart) would have its tests in a
file named [`test/animation/curves/curve2_d.0_test.dart`](
file named [`test/widgets/layout_builder/layout_builder.0_test.dart`](
./test/widgets/layout_builder/layout_builder.0_test.dart)