implement static method

NSAnimationDelegate implement({
  1. bool animationShouldStart_(
    1. NSAnimation
    )?,
  2. void animationDidStop_(
    1. NSAnimation
    )?,
  3. void animationDidEnd_(
    1. NSAnimation
    )?,
  4. double animation_valueForProgress_(
    1. NSAnimation,
    2. DartNSAnimationProgress
    )?,
  5. void animation_didReachProgressMark_(
    1. NSAnimation,
    2. DartNSAnimationProgress
    )?,
  6. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSAnimationDelegate 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 NSAnimationDelegate implement({
  bool Function(NSAnimation)? animationShouldStart_,
  void Function(NSAnimation)? animationDidStop_,
  void Function(NSAnimation)? animationDidEnd_,
  double Function(NSAnimation, DartNSAnimationProgress)?
  animation_valueForProgress_,
  void Function(NSAnimation, DartNSAnimationProgress)?
  animation_didReachProgressMark_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSAnimationDelegate');
  NSAnimationDelegate.animationShouldStart_.implement(
    builder,
    animationShouldStart_,
  );
  NSAnimationDelegate.animationDidStop_.implement(builder, animationDidStop_);
  NSAnimationDelegate.animationDidEnd_.implement(builder, animationDidEnd_);
  NSAnimationDelegate.animation_valueForProgress_.implement(
    builder,
    animation_valueForProgress_,
  );
  NSAnimationDelegate.animation_didReachProgressMark_.implement(
    builder,
    animation_didReachProgressMark_,
  );
  builder.addProtocol($protocol);
  return NSAnimationDelegate.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}