keyToString property

Map<String, dynamic> get keyToString

Map<dynamic,dynamic> to Map<String,dynamic>

Implementation

Map<String, dynamic> get keyToString {
  Map<String, dynamic> resultMap = {};
  forEach((key, value) {
    if (value is Map) {
      resultMap[key.toString()] = value.keyToString;
    } else if (value is List && value.isNotEmpty) {
      value = value.map((e) {
        if (e is Map) return e.keyToString;
        return e;
      }).toList() as V;
    } else {
      resultMap[key.toString()] = value;
    }
  });
  return resultMap;
}