Migration guide for material localized strings
Summary
#ReorderableListView's localized strings were moved from material localizations to widgets localizations. These strings were deprecated in material localizations.
Context
#ReorderableListView uses these strings to annotate its semantics actions. To apply the same annotations to ReorderableList and SliverReorderableList, they need to access these strings from widgets library.
Description of change
#The MaterialLocalizations strings for reorderItemToStart, reorderItemToEnd, reorderItemUp, reorderItemDown, reorderItemLeft, and reorderItemRight are deprecated and replaced by the same strings in WidgetsLocalizations.
Migration guide
#If you use these strings in your code, you can access them from WidgetsLocalizationsinstead.
Code before migration:
MaterialLocalizations.of(context).reorderItemToStart;Code after migration:
WidgetsLocalizations.of(context).reorderItemToStart;If you override MaterialLocalizations or WidgetsLocalizations, make sure to remove the translations from the MaterialLocalizations subclass and move them to the WidgetsLocalizations subclass.
Code before migration:
class MaterialLocalizationsMyLanguage extends MaterialLocalizationsEn {
// ...
@override
String get reorderItemRight => 'my translation';
}Code after migration:
class MaterialLocalizationsMyLanguage extends MaterialLocalizationsEn {
// ...
}
class WidgetsLocalizationsMyLanguage extends WidgetsLocalizationsEn {
// ...
@override
String get reorderItemRight => 'my translation';
}Timeline
#Landed in version: v3.10.0-2.0.pre
In stable release: 3.13.0
References
#Relevant PR:
- PR 124711: Deprecates string for ReorderableList in material_localizations.
除非另有说明,否则本网站上的文档反映的是 Flutter 的最新稳定版本。页面最后更新于 2025-01-30。 查看源代码 或 报告问题。