mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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