minor changes
This commit is contained in:
@@ -30,15 +30,15 @@ const kStreamChatSupportedLanguages = {'en'};
|
||||
/// Generally speaking, this method is only intended to be used by
|
||||
/// [GlobalStreamChatLocalizations.delegate].
|
||||
GlobalStreamChatLocalizations? getStreamChatTranslation(Locale locale) {
|
||||
final languageCode = locale.languageCode;
|
||||
assert(
|
||||
kStreamChatSupportedLanguages.contains(languageCode),
|
||||
'getStreamChatTranslation() called for unsupported locale "$locale"',
|
||||
);
|
||||
switch (locale.languageCode) {
|
||||
case 'en':
|
||||
return const StreamChatLocalizationsEn();
|
||||
}
|
||||
assert(
|
||||
false,
|
||||
'getStreamChatTranslation() called for unsupported locale "$locale"',
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Implementation of localized strings for the stream chat widgets
|
||||
@@ -134,8 +134,7 @@ class _StreamChatLocalizationsDelegate
|
||||
assert(isSupported(locale), '');
|
||||
return _loadedTranslations.putIfAbsent(
|
||||
locale,
|
||||
() =>
|
||||
SynchronousFuture<StreamChatLocalizations>(
|
||||
() => SynchronousFuture<StreamChatLocalizations>(
|
||||
getStreamChatTranslation(locale)!,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user