getGlobalKey method

GlobalKey<State<StatefulWidget>>? getGlobalKey(
  1. String id
)

Returns the internal GlobalKey to assign to the widget in the tree.

Usage:

ElevatedButton(
  key: McpEvents.instance.getGlobalKey('auth.login_button'),
  ...
)

Implementation

GlobalKey? getGlobalKey(String id) => _widgets[id]?.globalKey;