flutter/dev/automated_tests
Ben Konyi 3595e7dad0
[ Widget Preview ] Add support for theme and brightness properties on Preview (#167001)
The `theme` parameter of `Preview(...)` allows for developers to provide
a callback that returns a `PreviewThemeData` instance which can contain
theming data for Material and Cupertino widgets in both light and dark
modes. The provided theme data will be injected into the widget tree and
applied to the previewed widget.

The `brightness` parameter allows for developers to specify an initial
brightness setting (e.g., light vs dark mode) for the previewed widget.
If not provided, the current system default is used.

A new button has also been added to each widget preview card that allows
for toggling between light and dark mode for individual previews.

**Demo:**


https://github.com/user-attachments/assets/f0a4a3bc-25d2-49b0-a5f6-9149eccfc1d4

Fixes https://github.com/flutter/flutter/issues/166436
Fixes https://github.com/flutter/flutter/issues/166275
Fixes https://github.com/flutter/flutter/issues/166279
Fixes https://github.com/flutter/flutter/issues/166437
2025-04-15 17:51:40 +00:00
..
flutter_test Auto-format Framework (#160545) 2024-12-19 20:06:21 +00:00
icon Enable widget load assets in its own package in test (#35991) 2019-07-16 09:47:42 -07:00
integration_test Adjust tools tests that would be broken by formatting (#160393) 2024-12-17 00:34:00 +00:00
test_smoke_test Auto-format Framework (#160545) 2024-12-19 20:06:21 +00:00
pubspec.yaml [ Widget Preview ] Add support for theme and brightness properties on Preview (#167001) 2025-04-15 17:51:40 +00:00
README.md Fix tests (#3977) 2016-05-17 12:45:37 -07:00

This is a fake package for use by automated testing. For example, the flutter_tools package uses this to test flutter test.