getJson<T> method

T? getJson<T>(
  1. String key
)

Implementation

T? getJson<T>(String key) {
  try {
    if (!_check(key)) return null;
    final json = sp.getString(key);
    if (json != null) return jsonDecode(json) as T;
  } catch (e) {
    if (kDebugMode) print('getJson $key error:${e.toString()}');
  }
  return null;
}