refresh method Null safety
- String languageCode
Refreshes the references with network data.
Implementation
Future<void> refresh(final String languageCode) async {
if (_isNetwork) {
return;
}
if (_isDownloading) {
return;
}
_isDownloading = true;
final bool successful = await _loadFromNetwork(languageCode);
if (successful) {
_isNetwork = true;
if (daoString != null) {
await daoString!.put(_DAO_STRING_KEY_LANGUAGE, languageCode);
}
notify();
}
_isDownloading = false;
}