decodeDragStartBehavior static method
Decodes the given value
to an DragStartBehavior. Supported values are:
horizontal
start
Implementation
static DragStartBehavior? decodeDragStartBehavior(
dynamic value, {
bool validate = true,
}) {
DragStartBehavior? result;
if (value is DragStartBehavior) {
result = value;
} else {
_checkSupported(
'DragStartBehavior',
[
'down',
'start',
],
value,
);
if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/drag_start_behavior',
value: value,
validate: validate,
));
switch (value) {
case 'down':
result = DragStartBehavior.down;
break;
case 'start':
result = DragStartBehavior.start;
break;
}
}
}
return result;
}