convert2DartMap static method

Map<String, String>? convert2DartMap(
  1. dynamic objectArray,
  2. String key,
  3. String value
)

Implementation

static Map<String, String>? convert2DartMap(objectArray, String key, String value) {
  Map<String, String> map = {};
  if (objectArray != null) {
    for (dynamic item in objectArray) {
      map[item[key] ?? ""] = item[value] ?? "";
    }
  }
  return map;
}