L10nContext extension
Convenience extension on BuildContext for quick string lookups.
// Inside a build() method:
Text(context.t('ui.start_game'))
Text(context.tr('game.hp', {'current': 80, 'max': 100}))
- on
Methods
-
t(
String key, [Map< String, Object?> args = const {}]) → String -
Available on BuildContext, provided by the L10nContext extension
Looks upkeyin the nearest LocalizationScope; without one, giveskeyitself (withargsfilled in). -
tr(
String key, Map< String, Object?> args) → String -
Available on BuildContext, provided by the L10nContext extension
Looks upkeywithargs.