implement static method

NSAnimatablePropertyContainer implement({
  1. required ObjCObjectBase animator(),
  2. required NSDictionary animations(),
  3. required void setAnimations_(
    1. NSDictionary keyedValues
    ),
  4. required ObjCObjectBase? animationForKey_(
    1. NSString aClassName
    ),
  5. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSAnimatablePropertyContainer protocol. To implement multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly.

If $keepIsolateAlive is true, this protocol will keep this isolate alive until it is garbage collected by both Dart and ObjC.

Implementation

static NSAnimatablePropertyContainer implement({
  required Dartinstancetype Function() animator,
  required objc.NSDictionary Function() animations,
  required void Function(objc.NSDictionary) setAnimations_,
  required objc.ObjCObjectBase? Function(DartNSAnimatablePropertyKey)
  animationForKey_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(
    debugName: 'NSAnimatablePropertyContainer',
  );
  NSAnimatablePropertyContainer.animator.implement(builder, animator);
  NSAnimatablePropertyContainer.animations.implement(builder, animations);
  NSAnimatablePropertyContainer.setAnimations_.implement(
    builder,
    setAnimations_,
  );
  NSAnimatablePropertyContainer.animationForKey_.implement(
    builder,
    animationForKey_,
  );
  builder.addProtocol($protocol);
  return NSAnimatablePropertyContainer.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}