isUrl property

bool get isUrl

Returns true if this string is a valid URL.

Example: 'https://www.example.com'.isUrl -> true.

Implementation

bool get isUrl => RegExp(
  r'^https?://[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$',
).hasMatch(this);