Uri removeFragment()

Returns a Uri that differs from this only in not having a fragment.

If this Uri does not have a fragment, it is itself returned.

Source

Uri removeFragment() {
  if (!this.hasFragment) return this;
  return new Uri._internal(scheme, _userInfo, _host, _port,
                           _path, _query, null);
}