isUsableHttpUrl static method

bool isUsableHttpUrl(
  1. String? value
)

Whether a string is a usable absolute http(s) URL. Delegates to the canonical commons rule (rac_dev_config_is_usable_http_url).

Implementation

static bool isUsableHttpUrl(String? value) {
  if (value == null) return false;
  final lib = PlatformLoader.loadCommons();
  final fn = lib
      .lookupFunction<
        Bool Function(Pointer<Utf8>),
        bool Function(Pointer<Utf8>)
      >('rac_dev_config_is_usable_http_url');
  final ptr = value.toNativeUtf8();
  try {
    return fn(ptr);
  } finally {
    calloc.free(ptr);
  }
}