fromMap static method

ContentBlockerAction fromMap(
  1. Map<String, dynamic> map, {
  2. EnumMethod? enumMethod,
})

Implementation

static ContentBlockerAction fromMap(
  Map<String, dynamic> map, {
  EnumMethod? enumMethod,
}) {
  return ContentBlockerAction(
    type: switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => ContentBlockerActionType.fromNativeValue(
        map["type"],
      ),
      EnumMethod.value => ContentBlockerActionType.fromValue(map["type"]),
      EnumMethod.name => ContentBlockerActionType.byName(map["type"]),
    }!,
    selector: map["selector"],
  );
}