initDefaultListFromUri static method

Future<void> initDefaultListFromUri(
  1. Uri uri, {
  2. bool? withCredentials,
  3. Map<String, String>? requestHeaders,
  4. dynamic sendData,
  5. void onProgress(
    1. ProgressEvent
    )?,
})

Initialises DefaultSuffixRules using a suffix list resource obtained from a URI.

See SuffixRules.fromString for the expected format of the suffix list.

HttpRequest.request is used to retrieve the resource, and the optional parameters can be used to tweak this request. If more fine-grained control over the request is needed, consider obtaining the suffix list using custom code first and then passing it to DefaultSuffixRules.initFromString.

An Exception is thrown if the request fails.

Implementation

static Future<void> initDefaultListFromUri(Uri uri,
    {bool? withCredentials,
    Map<String, String>? requestHeaders,
    dynamic sendData,
    void Function(ProgressEvent)? onProgress}) async {
  DefaultSuffixRules.initFromString(await _getUri(uri,
      withCredentials: withCredentials,
      requestHeaders: requestHeaders,
      sendData: sendData,
      onProgress: onProgress));
}