parse static method

SnapchatUrl? parse(
  1. String url
)

Implementation

static SnapchatUrl? parse(String url) {
  var matches = RegExp(
          r'(?:https?:)?\/\/(?:www\.)?snapchat\.com\/add\/(?<username>[A-z0-9\.\_\-]+)\/?')
      .allMatches(url);
  var username = matches.getValue("username");
  if (username == null) return null;
  return SnapchatUrl._(username);
}