serializeOptional function
dynamic
serializeOptional(
- Type self,
- SerialBuffer buffer,
- dynamic data, {
- SerializerState? state,
- dynamic allowExtensions = true,
Implementation
serializeOptional(Type self, SerialBuffer buffer, dynamic data, {SerializerState? state, allowExtensions = true}) {
if (state == null) state = SerializerState();
if (data == null) {
buffer.push([0]);
} else {
buffer.push([1]);
self.optionalOf!.serialize?.call(self.optionalOf, buffer, data, state: state, allowExtensions: allowExtensions);
}
}