fromJson static method

Guard fromJson(
  1. Map<String, Object?> json
)

Implementation

static Guard fromJson(Map<String, Object?> json) => Guard(
  GuardLevel.values.firstWhere(
    (l) => l.name == json['level'],
    orElse: () => GuardLevel.warn,
  ),
  json['reason']! as String,
);