getUrlOnString method

String getUrlOnString()

Implementation

String getUrlOnString() {

  var urlOnText = split(" ");
  if(urlOnText.length > 1) {

    for (var element in urlOnText) {
      if(Uri.tryParse(element)?.hasAbsolutePath ?? false) {
        return element;
      }
    }

  }

  return (Uri.tryParse(this)?.hasAbsolutePath ?? false) ? this : "";

}