deserializeOptional function

dynamic deserializeOptional(
  1. Type self,
  2. SerialBuffer buffer, {
  3. SerializerState? state,
  4. dynamic allowExtensions = true,
})

Implementation

deserializeOptional(Type self, SerialBuffer buffer, {SerializerState? state, allowExtensions = true}) {
  if (state == null) state = SerializerState();
  if (buffer.get() != 0) {
    return self.optionalOf!.deserialize?.call(self.optionalOf, buffer, state: state, allowExtensions: allowExtensions);
  } else {
    return null;
  }
}