currentWidget property

Widget? get 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;