List<Map> getErrorsMap(List<Errors> errors){ List<Map> mapList = List.empty(growable: true); errors.forEach((element) { mapList.add(element.toJson()); }); return mapList; }