joinMap method

String joinMap(
  1. String separator,
  2. String separatorEntries
)

Joins the map entries into a single string with specified separators.

This method iterates over the map's entries and joins them into a single string. Each key-value pair is joined using separator, and each entry is separated by separatorEntries.

separator is used to separate keys and values in each entry. separatorEntries is used to separate each key-value pair.

Returns a String representing the joined map entries.

Implementation

String joinMap(String separator, String separatorEntries) {
  var res = "";
  forEach((key, value) {
    res = "${res.isEmpty ? '' : "$res$separatorEntries"}$key$separator$value";
  });
  return res;
}