Skip to main content

avoid-missing-tr

added in: 1.21.0
Pro+

Warns when the tr extension method is not called on localization keys.

Example

❌ Bad:

void fn() {
print(LocaleKeys.title); // LINT
Text(LocaleKeys.title); // LINT
}

✅ Good:

void fn() {
print(LocaleKeys.title.tr());
print(LocaleKeys.title.plural());

Text(LocaleKeys.title).tr();
Text(LocaleKeys.title).plural();

Custom(LocaleKeys.title.tr());
Custom(LocaleKeys.title).tr();
}