currentWidget property

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.

Implementation

Widget? get currentWidget => _currentElement?.widget;