setup method

Future<bool> setup()

Initialize your Model Data Here

Implementation

Future<bool> setup() async {
  Map<String, T> result = {};
  List<CacheObject> cache = await CacheHandler.getCacheList(getCacheId());
  for (CacheObject cacheObject in cache) {
    T? tmp = createModel(cacheObject.getData());
    if (tmp != null) {
      result[tmp.getId()] = tmp;
    }
  }
  setModels(result);
  return true;
}