Widget currentWidget

The widget in the tree that currently has this global key.

The current widget is null if there is no widget in the tree that matches this global key.

Source

Widget get currentWidget => _currentElement?.widget;