formatDeviceList static method

dynamic formatDeviceList(
  1. dynamic list
)

Implementation

static formatDeviceList(list) {
  var newList = [];
  if (list == null || list is! List) return newList;
  for (var item in list) {
    Map<String, dynamic> info = {};
    info["deviceID"] = item["deviceID"];
    info["deviceName"] = item["deviceName"];
    newList.add(info);
  }
  return newList;
}