registerTarget method

void registerTarget(
  1. String id,
  2. GlobalKey<State<StatefulWidget>> key
)

Registers a target section with the given id and key.

The key must be attached to the widget representing the target section within the scrollable area.

Implementation

void registerTarget(String id, GlobalKey key) {
  _targets[id] = key;
}