encodeOrdinalSortKey static method

Map<String, dynamic>? encodeOrdinalSortKey(
  1. OrdinalSortKey? value
)

Encodes the given OrdinalSortKey to a JSON representation. This produces the given the following structure:

{
  "name": <String>,
  "order": <double>
}

Implementation

static Map<String, dynamic>? encodeOrdinalSortKey(OrdinalSortKey? value) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = {
      'name': value.name,
      'order': value.order,
    };
  }

  return result;
}