search property

String search

A string indicating the URL's parameter string; if any parameters are provided, this string includes all of them, beginning with the leading ? character.

MDN reference

Implementation

String get search {
  final search = searchParams.toString();
  return search.isEmpty ? '' : '?$search';
}