decodeNotchedShape static method

NotchedShape? decodeNotchedShape(
  1. dynamic value, {
  2. bool validate = true,
})

Decodes the value to a NotchedShape. Supported values are:

  • circular

Implementation

static NotchedShape? decodeNotchedShape(
  dynamic value, {
  bool validate = true,
}) {
  NotchedShape? result;
  if (value is NotchedShape) {
    result = value;
  } else {
    _checkSupported(
      'NotchedShape',
      [
        'circular',
      ],
      value,
    );

    if (value != null) {
      assert(SchemaValidator.validate(
        schemaId: '$_baseSchemaUrl/notched_shape',
        value: value,
        validate: validate,
      ));
      switch (value) {
        case 'circular':
          result = CircularNotchedRectangle();
          break;
      }
    }
  }
  return result;
}