isValidUrl static method

bool isValidUrl(
  1. String url
)

Validates a URL. The URL must start with http or https followed by a valid domain.

Implementation

static bool isValidUrl(String url) =>
    RegExp(r'^(http|https):\/\/[^\s/$.?#].[^\s]*$').hasMatch(url);