parseParams function

Map parseParams(
  1. String str
)

Implementation

Map<dynamic, dynamic> parseParams(String str) {
  Map<dynamic, dynamic> params = createMap();
  str.split(new RegExp(r';').pattern).forEach((line) {
    // only split at the first '=' as there may be an '=' in the value as well
    int idx = line.indexOf("=");
    String key;
    String value = "";
    if (idx == -1) {
      key = line;
    } else {
      key = line.substring(0, idx).trim();
      value = line.substring(idx + 1, line.length).trim();
    }

    params[key] = toIntIfInt(value);
  });
  return params;
}