Ben Konyi 27d9c0ff2b
[ Widget Previews ] Add support for localizations in widget previews (#169229)
This change adds a new `localizations` property to the `Preview`
annotation, which takes a callback that returns a
`PreviewLocalizationsData` object. This class contains the same
localization properties that can be provided to `WidgetsApp` and other
similar widgets.

This change also refactors much of the localization resolution logic
into a shared `LocalizationsResolver` class to allow for localization
resolution to be done in the widget preview scaffold on a per-preview
basis.

Fixes https://github.com/flutter/flutter/issues/166433
2025-06-04 20:21:20 +00:00
..