getObjectList static method

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

get object list.

Implementation

static List<Map<String, dynamic>> getObjectList(String key) {
  List<String>? dataList = _prefs.getStringList(key);
  return (dataList == null || dataList.isEmpty)
      ? []
      : dataList.map((value) {
    Map<String, dynamic> dataMap = json.decode(value);
    return dataMap;
  }).toList();
}