registerWidget abstract method

void registerWidget(
  1. Object key,
  2. Widget? widget
)

Register widget for the key. If null widget is specified, the default child widget will be used.

Registering widget prepares widget for snapshot and allows getSnapshot to provide the snapshot immediately.

Implementation

void registerWidget(Object key, Widget? widget);