dispose method

void dispose()

Implementation

void dispose() {
  if (isDisposed) return;

  isDisposed = true;

  if (dotLottiePlayer != null) {
    try {
      final player = dotLottiePlayer as JSObject;
      final destroyMethod = player['destroy'.toJS] as JSFunction;
      destroyMethod.callAsFunction(player);
    } catch (e) {}
    dotLottiePlayer = null;
  }

  _viewInstances.remove(viewId);
  _creationParams.remove(viewId);
}