cj_getAllParamsFromWebUrl method

Map<String, dynamic>? cj_getAllParamsFromWebUrl({
  1. required bool paramToObjectIfOK,
})

获取 all params: Map<String, dynamic>? getAllParamsFromWebUrl(String webUrl, {required bool paramToObjectIfOK})

Implementation

Map<String, dynamic>? cj_getAllParamsFromWebUrl({
  required bool paramToObjectIfOK,
}) {
  Uri uri = Uri.parse(this);
  Map<String, dynamic>? params = uri.queryParameters;
  // ignore: unnecessary_null_comparison
  if (params == null) {
    return null;
  }

  if (paramToObjectIfOK) {
    params.forEach((key, value) {
      if (value is String) {
        params[key] = jsonDecode(value);
      }
    });
  }

  return params;
}