convertToMapStringInt function

Map<String, int> convertToMapStringInt(
  1. dynamic json
)

Common converter functions

Implementation

Map<String, int> convertToMapStringInt(dynamic json) {
  if (json is! Map) throw FormatException('JSON must be an object');
  return Map<String, int>.fromEntries(json.entries
      .map((e) => MapEntry(e.key.toString(), int.parse(e.value.toString()))));
}