urls property

List<String> urls

Implementation

List<String> get urls{
  RegExp exp = RegExp(r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+');
  Iterable<RegExpMatch> matches = exp.allMatches(this);

  var texts = split(exp);
  var links = matches.map((e) => substring(e.start, e.end));
  for(int i =0; i < links.length; i++){
    texts.insert(i+i+1, links.elementAt(i));
  }
  return texts;
}