Commit Graph

14 Commits

Author SHA1 Message Date
Michael Goderbauer
43f3252c82
docimports for API samples (#151606)
Part of https://github.com/flutter/flutter/issues/150800

Turns out: None of these actually need any docImports. They just had broken references.
2024-07-11 20:36:55 +00:00
Bruno Leroux
de2615462c
Add a ReorderableListView example with cards + cleanup existing tests (#126155)
## Description

This PR adds one `ReorderableListView` example to demonstrate how `proxyDecorator` can be used to animate cards elevation.

https://user-images.githubusercontent.com/840911/236468570-d2b33ab3-6b6d-4f8d-90de-778dcf1ad8ce.mp4

For motivation, see https://github.com/flutter/flutter/issues/124729#issuecomment-1521524190.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/124729

## Tests

Adds 1 tests.

This PR also moves some misplaced example tests from `examples/api/test/reorderable_list` to `examples/api/test/material/reorderable_list` (and replaces two existing ones).
2023-05-05 16:39:11 +00:00
Greg Spencer
e3bc8efd39
Rename Sample classes (#124080)
Rename Sample classes
2023-04-04 20:34:29 +00:00
Michael Goderbauer
b308555ed1
Enable dangling_library_doc_comments and library_annotations lints (#117365) 2022-12-20 16:03:21 -08:00
Michael Goderbauer
81bc54be75
Enable use_colored_box lint (#117370) 2022-12-20 14:09:55 -08:00
Greg Spencer
e617d003fb
Normalize examples (#111223) 2022-09-09 21:17:11 +00:00
Michael Goderbauer
2cbad4b3ae
Final chapter: migrate api doc samples to super-parameters (#104007) 2022-05-17 15:35:07 -07:00
Phil Quitslund
80849adee1
[dev, bots, examples] rename local functions with _s (#102703) 2022-04-28 10:44:06 -07:00
Taha Tesser
b1f88a6535
ReorderableListView: fix broken dartpad example & update examples, add tests (#102723) 2022-04-28 10:19:08 -07:00
Darren Austin
e685c938a3
Replaced the reference to primaryVariant in code example as it will soon be deprecated. (#93351) 2021-11-09 17:49:40 -08:00
Taha Tesser
6fc988146b
[ReorderableListView] Update doc with example to make it clear proxyDecorator can overriden to customise an item when it is being dragged. (#91837) 2021-11-03 17:36:50 -07:00
Greg Spencer
fd9ce27748
Clean up examples, remove section markers and --template args (#91133)
This does a cleanup of the examples, removing all of the "section" markers and extra comments that we don't need anymore now that the samples are no longer in the source code. It also removes the --template arguments from the {@tool dartpad} and {@tool sample} directives, since those are no longer used. It converts two examples that I discovered were still embedded into linked examples in the examples folder.

I didn't delete the templates from the snippets config folder yet, because there are still embedded samples in the dart:ui package from the engine that use them. Once dart:ui no longer uses the templates, they can be removed.

I bumped the version of the snippets package to pick up a change that allows removal of the --template argument.
2021-10-04 12:16:17 -07:00
Greg Spencer
ab2b0851a2
Add smoke tests for all the examples, fix 17 broken examples. (#89021)
This adds a smoke test for every single API example. It also fixes 17 tests that had bugs in them, or were otherwise broken, and even fixes one actual bug in the framework, and one limitation in the framework.

The bug in the framework is that NetworkImage's _loadAsync method had await response.drain<List<int>>();, but if the response is null, it will throw a cryptic exception saying that Null can't be assigned to List<int>. The fix was just to use await response.drain<void>(); instead.

The limitation is that RelativePositionedTransition takes an Animation<Rect> rect parameter, and if you want to use a RectTween with it, the value emitted there is Rect?, and one of the examples was just casting from Animation<Rect> to Animation<Rect?>, which is invalid, so I modified RelativePositionedTransition to take a Rect? and just use Rect.zero if the rect is null.
2021-09-28 09:32:06 -07:00
Greg Spencer
33403bd28e
Extract Sample code into examples/api (#87280)
This extracts the sample code out from the API doc comments, and places them in separate files on disk, allowing running of the examples locally, testing them, and building of slightly larger examples.
2021-08-25 09:45:12 -07:00