flutter/packages/flutter_tools/test/commands.shard
Ben Konyi f25b4b77ff
[ Widget Previews ] Add support for detecting previews and generating code (#161911)
`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()];
```
2025-01-28 17:59:57 +00:00
..
hermetic remove dependency on Usage from Pub class (#162279) 2025-01-28 17:32:27 +00:00
permeable [ Widget Previews ] Add support for detecting previews and generating code (#161911) 2025-01-28 17:59:57 +00:00
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.