ServerSetHeader.fromDartObject constructor

ServerSetHeader.fromDartObject(
  1. DartObject object
)

Implementation

factory ServerSetHeader.fromDartObject(DartObject object) {
  final name = object.getField('name')?.toStringValue();
  final value = object.getField('value')?.toStringValue();

  if (name == null || value == null) {
    throw ArgumentError('name and value must be provided');
  }

  return ServerSetHeader(
    name: name,
    value: value,
  );
}