deleteRuleForDeleteRuleString static method Null safety

DeleteRule? deleteRuleForDeleteRuleString(
  1. String? rule
)

Returns inverse of deleteRuleStringForDeleteRule.

Implementation

static DeleteRule? deleteRuleForDeleteRuleString(String? rule) {
  switch (rule) {
    case "cascade":
      return DeleteRule.cascade;
    case "nullify":
      return DeleteRule.nullify;
    case "restrict":
      return DeleteRule.restrict;
    case "default":
      return DeleteRule.setDefault;
  }
  return null;
}