MultiLanguageBloc class

Constructors

MultiLanguageBloc({required List<String> supportedLanguages, required String defaultLanguage, String? initialLanguage, String? commonRoute})
factory

Properties

commonRoute String?
Route common in to screens
final
currentCommon Map
Current common in current json selected
no setter
currentValue Map
Current json Full
no setter
defaultLanguage String
Default language
final
hashCode int
The hash code for this object.
no setterinherited
lastLanguage String
Last language selected
getter/setter pair
outStreamList Stream
Stream of languages
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedLanguages List<String>
List of supported languages ex: 'en_US', 'pt_BR' Here you pass the names of files in folder "lang" without the ".json"
final

Methods

changeLanguage(String prefix) Future<void>
Change current language passing prefix ex: changeLanguage('en_US')
dispose() → void
getListLanguage() List<Map>
Get list of languages in route "config" inside jsons
init() Future<void>
Required called before all to load all jsons
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseJsonFromAssets(String assetsPath) Future<Map<String, dynamic>>
showAlertChangeLanguage({required BuildContext context, required String title, required String btnNegative}) Future
Show alert to change language
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited