fromJson<T> static method

ModelLessArray<T> fromJson<T>(
  1. String jsonString
)

Implementation

static ModelLessArray<T> fromJson<T>(String jsonString) {
  ModelLessArray<T> arrayApiModels = ModelLessArray();

  try {
    List<dynamic> jsonData = json.decode(jsonString);
    for (var element in jsonData) {
      ModelLess apiModel = ModelLess.fromMap(element);
      arrayApiModels.set(apiModel);
    }
  } on Exception catch (e) {
    Console.write("Error Parsing Data for init an ArrayApiModel: $e");
  }

  return arrayApiModels;
}