Skip to content

Commit

Permalink
Small typo with text on the source of an example text file (#105326)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
youssef-attia authored Jun 6, 2022
1 parent e9a3cbf commit e9230ba
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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)

0 comments on commit e9230ba

Please sign in to comment.