ServerAllowOrigins.fromDartObject constructor

ServerAllowOrigins.fromDartObject(
  1. DartObject object
)

Implementation

factory ServerAllowOrigins.fromDartObject(DartObject object) {
  final raw = object.getField('origins')?.toSetValue() ?? {};
  final inherit = object.getField('inherit')?.toBoolValue() ?? true;

  return ServerAllowOrigins(
    origins: raw.map((e) => e.toStringValue()!).toSet(),
    inherit: inherit,
  );
}