writeCountIf method

List<E> writeCountIf(
  1. MemoryPointer<RType>? p,
  2. List<E> values
)

Like writeCount, but does nothing if the struct pointer p is null.

Always returns the given list, whether or not the write happened.

Implementation

List<E> writeCountIf(MemoryPointer? p, List<E> values) {
  if (p == null) return values;
  final ref = codec.deref(p.offsetBy(offset));
  _innerArray().writeArray(ref, values);
  return values;
}