UniqueWidget<T extends State<StatefulWidget>> constructor Null safety

const UniqueWidget<T extends State<StatefulWidget>>(
  1. {required GlobalKey<T> key}
)

Creates a widget that has exactly one inflated instance in the tree.

The key argument must not be null because it identifies the unique inflated instance of this widget.

Implementation

const UniqueWidget({
  required GlobalKey<T> key,
}) : assert(key != null),
     super(key: key);