nullable<T> function

  1. @Deprecated('Use nil instead')
PayloadType<T?> nullable<T>(
  1. PayloadType<T> type
)

Make the given type accept null values as well.

When the value is null, it will store a single byte with the value 0. If the value is not null it will store a single byte with the value 1 and the encoded result of the type right after it.

It has a byte length of 1 + type.length(value).

Usage:

payload.set(nil(uint8), null);

Implementation

@Deprecated('Use nil instead')
PayloadType<T?> nullable<T>(PayloadType<T> type) => _Nil(type);