serializeData method

void serializeData(
  1. dynamic data
)

Implementation

void serializeData(dynamic data) {
  if (writeExtra(data) == true) {
    return;
  } else if (data is ToCborable) {
    data.write(this);
  } else if (data is Map) {
    serializeMap(data);
  } else if (data is Iterable) {
    serializeIterable(data);
  } else if (data is int) {
    writeInt(data);
  } else if (data is String) {
    writeString(data);
  } else if (data is double) {
    writeFloat(data);
  } else if (data is bool) {
    writeBool(data);
  } else if (data == null) {
    writeNull();
  } else {
    throw UnsupportedError(
      '${data.runtimeType.toString()}'
      ' is not supported with CBOR serializations.',
    );
  }
}