isValidBackendUrl static method

bool isValidBackendUrl(
  1. String url
)

Validate backend URL format

Implementation

static bool isValidBackendUrl(String url) {
  try {
    final uri = Uri.parse(url);
    return uri.hasScheme &&
           (uri.scheme == 'https' || uri.scheme == 'http') &&
           uri.hasAuthority;
  } catch (e) {
    return false;
  }
}