fetch static method

dynamic fetch()

Implementation

static fetch() async {
  try {
    final LocaleSyncAPI api = LocaleSyncAPI();
    _data = await api.fetch(
      apiToken: _token,
      repositoryId: _repositoryId,
    );
    _storage.save(_data);
  } catch (e) {
    final cachedData = _storage.data;
    if (cachedData?["data"] != null && cachedData?["data"].isNotEmpty) {
      _data = cachedData!["data"].cast<String, dynamic>();
    }
  }
}