toMap method

Map<String, dynamic> toMap({
  1. EnumMethod? enumMethod,
})

Converts instance to a map.

Implementation

Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
  return {
    "allowedOriginRules": allowedOriginRules.toList(),
    "contentWorld": contentWorld.toMap(enumMethod: enumMethod),
    "forMainFrameOnly": forMainFrameOnly,
    "groupName": groupName,
    "injectionTime": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => injectionTime.toNativeValue(),
      EnumMethod.value => injectionTime.toValue(),
      EnumMethod.name => injectionTime.name(),
    },
    "source": source,
  };
}