onAnyCompleted method

void onAnyCompleted(
  1. String id,
  2. void callback(
    1. AnimatableProperty
    )
)

Called when any animation completes.

Implementation

void onAnyCompleted(String id, void Function(AnimatableProperty) callback) {
  onWindowEvent(id, 'complete', (event) {
    final propName = event.data['property'] as String?;
    if (propName != null) {
      final prop = AnimatableProperty.values.firstWhere(
        (p) => p.name == propName,
        orElse: () => AnimatableProperty.x,
      );
      callback(prop);
    }
  });
}