get method
String?
get(
- String languageCode, {
- String defaultLanguage = 'en',
- FallbackStrategy fallbackStrategy = FallbackStrategy.first,
Gets the title in the specified language with fallback options.
languageCode is the preferred language code.
defaultLanguage is the fallback language if the preferred language is not available.
fallbackStrategy determines which title to use if neither the preferred nor
default language is available.
Returns the title string in the requested language, or null if no title is available.
Implementation
String? get(
String languageCode, {
String defaultLanguage = 'en',
FallbackStrategy fallbackStrategy = FallbackStrategy.first,
}) {
return titles[languageCode] ??
titles[defaultLanguage] ??
(fallbackStrategy == FallbackStrategy.first
? titles.values.firstOrNull
: titles.values.lastOrNull);
}