isValidUrl static method

bool isValidUrl(
  1. String text
)

Whether the provided text is a valid URL or not.

Implementation

static bool isValidUrl(String text) {
  try {
    Uri.parse(text);
    return true;
  } on FormatException {
    RolleeLogger.connectLog("Invalid URL: $text");
    return false;
  } catch (e) {
    RolleeLogger.connectLog("Invalid URL: $text");
    return false;
  }
}