onOptionsUpdate method
Called when the behaviour got new options and should update accordingly.
Implementation
@protected
@mustCallSuper
void onOptionsUpdate(BubbleOptions? oldOptions) {
if (bubbles == null) return;
if (bubbles!.length > options.bubbleCount)
bubbles!.removeRange(0, bubbles!.length - options.bubbleCount);
else if (bubbles!.length < options.bubbleCount) {
final int numToSpawn = options.bubbleCount - bubbles!.length;
final newBubbles = generateBubbles(numToSpawn);
bubbles!.addAll(newBubbles);
}
}