addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. required CGSize contentSize(),
  3. required CGSize effectiveContentSize(),
  4. required NSDirectionalEdgeInsets contentInsets(),
  5. required NSDirectionalEdgeInsets effectiveContentInsets(),
  6. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSCollectionLayoutContainer protocol to an existing objc.ObjCProtocolBuilder.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilder(
  objc.ObjCProtocolBuilder builder, {
  required NSSize Function() contentSize,
  required NSSize Function() effectiveContentSize,
  required NSDirectionalEdgeInsets Function() contentInsets,
  required NSDirectionalEdgeInsets Function() effectiveContentInsets,
  bool $keepIsolateAlive = true,
}) {
  NSCollectionLayoutContainer.contentSize.implement(builder, contentSize);
  NSCollectionLayoutContainer.effectiveContentSize.implement(
    builder,
    effectiveContentSize,
  );
  NSCollectionLayoutContainer.contentInsets.implement(builder, contentInsets);
  NSCollectionLayoutContainer.effectiveContentInsets.implement(
    builder,
    effectiveContentInsets,
  );
  builder.addProtocol($protocol);
}