mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
![]() `flutter widget-preview start` will now look for functions annotated with `@Preview()` within the developer's project. These functions will be used to generate `.dart_tool/widget_preview_scaffold/lib/generated_preview.dart`, which inserts the returned value from each preview function into a `List<WidgetPreview>` returned from a `previews()` method that is invoked by the widget preview scaffold root. **Example generated_preview.dart:** ```dart // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:foo/foo.dart' as _i1; import 'package:foo/src/bar.dart' as _i2; import 'package:widget_preview/widget_preview.dart'; List<WidgetPreview> previews() => [_i1.preview(), _i2.barPreview1(), _i2.barPreview2()]; ``` |
||
---|---|---|
.. | ||
hermetic | ||
permeable | ||
README.md |
This directory contains tests for specific flutter
commands.
Tests that are self-contained unit tests should go in hermetic/
.
Tests that are more end-to-end, e.g. that involve actually running
subprocesses, should go in permeable/
.
The ../../tool/coverage_tool.dart
script (which is used to collect
coverage for the tool) runs only the tests in the hermetic
directory
when collecting coverage.