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
..
2025-06-03 08:48:14 +00:00
2025-06-03 08:48:14 +00:00

Flutter

Flutter is a new way to build high-performance, cross-platform mobile, web, and desktop apps. Flutter is optimized for today's — and tomorrow's — mobile and desktop devices. We are focused on low-latency input and high frame rates on all platforms.

See the getting started guide for information about using Flutter.