decodeMethod function

Method decodeMethod(
  1. Object? json, [
  2. String field = 'method'
])

Implementation

Method decodeMethod(Object? json, [String field = 'method']) {
  final raw = _string(json, field);
  return Method.values.where((m) => m.name == raw).firstOrNull ??
      (throw FormatException('$field: not a method ($raw)'));
}