LocalazyCdnManager class
Constructors
- LocalazyCdnManager({required String cacheFolder, required String cdnId, required String getFileName(String locale, String flavor), LocalazyLocale customFileSearch(LocalazyConfig config)?, Duration configCacheDuration = const Duration(days: 1)})
- Construct a localazy CDN manage for the localization files
Properties
- cacheFolder → String
-
Folder where to save cache and config files
final
- cdnId → String
-
CDN ID of your localazy project, you can find it by running localazy cdn and get it from the URI
final
- configCacheDuration → Duration
-
Cache duration for localazy config file
Default to one day
final
- customFileSearch → (LocalazyLocale Function(LocalazyConfig config)?)
-
Callback if you want to search the correct file manually
final
- getFileName → String Function(String locale, String flavor)
-
Callback to get the name of the file based on the locale and flavor
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearCache(
) → Future< void> -
download(
String locale, String flavor, {String? overrideFileName}) → Future< String?> -
Download the correct file based on locale and flavor
It will get the localazy CDN config file and then search the right file based on getFileName
or customFileSearch.
Returns null if nothing have been found on localazy
Returns ARB content from cache or from localazy CDN depending if file have changed since last download
Can throw StateError if no file match the given name of getFileName and
locale
/flavor
overrideFileName
can be used if you need multiple localization delegate on your flutter app that use one localazy manager but for multiple filek -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited