ServerStatusCode.fromDartObject constructor

ServerStatusCode.fromDartObject(
  1. DartObject object
)

Implementation

factory ServerStatusCode.fromDartObject(DartObject object) {
  final code = object.getField('code')?.toIntValue();

  if (code == null) {
    throw ArgumentError.value(object, 'object', 'Invalid ServerStatusCode');
  }

  return ServerStatusCode(code);
}