KeyedSubtree constructor

const KeyedSubtree({
  1. Key? key,
  2. required Widget child,
})

Creates a widget that builds its child while assigning it a key.

This is useful when you want to preserve the state of a widget when it moves around in the widget tree by associating it with a consistent key.

Implementation

const KeyedSubtree({super.key, required this.child});