getParams method

String getParams(
  1. Map<String, String>? params
)

Implementation

String getParams(Map<String, String>? params) {
  if (params == null) return '';

  StringBuffer paramStr = StringBuffer('?');

  params.forEach((key, value) {
    if (paramStr.length > 1) paramStr.write('&');
    paramStr.write('$key=$value');
  });

  return paramStr.toString();
}