widgetKey property

String? widgetKey
final

The widget's key as the framework spells one — [<'save'>], [GlobalKey#] — or null for the great majority of widgets, which have none.

Its own field rather than half of description, because it answers a different question. A description says what a widget is; a key is the author saying which one it is, and so is the strongest evidence there can be that two nodes read in two places are the same node. Fused into the description it was the exact opposite of that — see splitKey.

Identity hashes are elided, so this is comparable across processes and across rebuilds. [GlobalKey#] says keyed by a GlobalKey and no more, which is all a bare GlobalKey() ever said about itself.

Implementation

final String? widgetKey;