fromList static method

List fromList(
  1. String data
)

Implementation

static List fromList(String data) {
  if (data.isEmptyJson) {
    return [];
  }
  try {
    var objList = json.decode(data);
    if (objList is! List) {
      return [];
    }
    return objList;
  } catch (e) {
    return [];
  }
}