fromMap static method

UserScript? fromMap(
  1. Map<String, dynamic>? map
)

Gets a possible UserScript instance from a Map value.

Implementation

static UserScript? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = UserScript(
    groupName: map['groupName'],
    injectionTime:
        UserScriptInjectionTime.fromNativeValue(map['injectionTime'])!,
    iosForMainFrameOnly: map['forMainFrameOnly'],
    source: map['source'],
  );
  instance.allowedOriginRules =
      Set<String>.from(map['allowedOriginRules']!.cast<String>());
  instance.contentWorld = map['contentWorld'];
  instance.forMainFrameOnly = map['forMainFrameOnly'];
  return instance;
}