readJson<T> method

Future<T?> readJson<T>({
  1. dynamic defaultValue,
})

Read a JSON value from NyStorage

Implementation

Future<T?> readJson<T>({dynamic defaultValue}) async {
  T? response = await NyStorage.readJson<T>(this, defaultValue: defaultValue);
  if (response == null) return null;
  try {
    return response;
  } catch (e) {
    NyLogger.error(e);
    return null;
  }
}