doWrite method Null safety

  1. @override
bool doWrite(
  1. MsgPackWriter writer,
  2. dynamic object

Writes the object to the provided MsgPackWriter writer

  • writer: The MsgPackWriter to use to serialize the object
  • object: The target object

Returns true if the object is serializable via the current extension, false otherwise


bool doWrite(MsgPackWriter writer, dynamic object) {
  if (object is DateTime) {

    return true;

  return false;