urlEncodeMap method

String urlEncodeMap (
  1. Map map
)

Deep encode the Map<String, dynamic> to percent-encoding. It is mostly used with the "application/x-www-form-urlencoded" content-type.

Implementation

static String urlEncodeMap(Map map) {
  return encodeMap(map, (key, value) {
    if (value == null) return key;
    return '$key=${Uri.encodeQueryComponent(value.toString())}';
  });
}