dispose method

void dispose()
inherited

Removes all children from the game and clears all caches.

This will call onRemove on all components in the tree, clear the images and assets caches, and process all pending lifecycle events.

After calling this method, the game is in a clean state with no components or cached resources.

Implementation

void dispose() {
  removeAll(children);
  processLifecycleEvents();
  images.clearCache();
  assets.clearCache();
}