transferCachedView static method

void transferCachedView(
  1. Widget from,
  2. Widget to
)

Transfers any cached view payload from from to to.

This lets reconciled widget replacements preserve expensive cached view output when their cache keys are still valid after an element update.

Implementation

static void transferCachedView(Widget from, Widget to) {
  to._cachedView = from._cachedView;
  to._cachedViewKey = from._cachedViewKey;
}