packStringEmptyIsNull method

void packStringEmptyIsNull(
  1. String? v
)

Convenient function that call packString(v) by passing empty String as null.

Convenient when you not distinguish between empty String and null on msgpack wire. See packString method documentation for more details.

Implementation

void packStringEmptyIsNull(String? v) {
  if (v == null || v.isEmpty) {
    packNull();
  } else {
    packString(v);
  }
}