decodeOrdinalSortKey static method
Decodes the given value
to an OrdinalSortKey. This expects the given
value
to be of the following structure:
{
"name": <String>,
"order": <double>
}
Implementation
static OrdinalSortKey? decodeOrdinalSortKey(
dynamic value, {
bool validate = false,
}) {
OrdinalSortKey? result;
if (value is OrdinalSortKey) {
result = value;
} else if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/ordinal_sort_key',
value: value,
validate: validate,
));
result = OrdinalSortKey(
JsonClass.parseDouble(value['order'])!,
name: value['name'],
);
}
return result;
}