of static method
Coarse: depends on every change. Prefer segment in anything that renders repeatedly.
Implementation
static LL of(BuildContext context) {
final LLContentModel? model = InheritedModel.inheritFrom<LLContentModel>(
context,
aspect: LLAspect.any);
// A handle installed by the delegate wins, so `Localizations.override`
// scopes a subtree to another language exactly as the framework intends.
final LL? scoped = Localizations.of<LL>(context, LL);
if (scoped != null) return scoped;
if (model == null) return none;
return LL._(
model.client,
localeFromLanguageTag(model.language),
model.language,
model.direction == LLTextDirection.rtl
? TextDirection.rtl
: TextDirection.ltr,
);
}