appendParams method

String appendParams({
  1. required String key,
  2. required String value,
})

追加参数

Implementation

String appendParams({required String key, required String value}) {
  if (key.isEmptyString) {
    return this ?? "";
  }
  if (this.isEmptyString) {
    return "$key=$value";
  }
  Uri uri = Uri.parse(this!);
  Map<String, String> parameters = {};
  parameters.addAll(uri.queryParameters);
  parameters[key] = value;
  return uri.replace(queryParameters: parameters).toString();
}