readList method

List<Map<String, dynamic>> readList(
  1. String key
)

Implementation

List<Map<String, dynamic>> readList(String key) {
  var value = prefrences.getString(key);
  if (value == null) return [];
  var decoded = <Map<String, dynamic>>[];
  try {
    decoded = jsonDecode(value);
  } catch (err) {
    debugPrint(err.toString());
  }
  return decoded;
}