getSearchParamFromURL static method

String getSearchParamFromURL(
  1. String url,
  2. String param
)

Implementation

static String getSearchParamFromURL(String url, String param) {
  final decodedUri = Uri.parse(Uri.decodeFull(url));
  final hasParam = decodedUri.queryParameters.keys.contains(param);
  if (!hasParam) return '';

  return Uri.encodeQueryComponent(decodedUri.queryParameters[param]!);
}