quickGetObject<T extends NUIEnt> method

T? quickGetObject<T extends NUIEnt>(
  1. String key,
  2. NUIEntMapper<T> entity
)

Implementation

T? quickGetObject<T extends NUIEnt>(String key, NUIEntMapper<T> entity){
  try{
    String? value = _pref!.getString(key);
    if(isNullOrEmpty(value)){
      return null;
    }
    return entity.toEntity(jsonDecode(value!));
  }catch(e){
    log("NUISharedPref -> Failed to decode object ${entity.entityName()}");
    return null;
  }
}