register 方法

Future<ServiceWorkerRegistration> register(
  1. String url,
  2. [Map? options]
)

实现

Future<ServiceWorkerRegistration> register(String url, [Map? options]) {
  var options_dict = null;
  if (options != null) {
    options_dict = convertDartToNative_Dictionary(options);
  }
  return promiseToFuture<ServiceWorkerRegistration>(JS(
      "creates:ServiceWorkerRegistration;",
      "#.register(#, #)",
      this,
      url,
      options_dict));
}