of method Null safety
- BuildContext context
Returns the closest AutofillGroupState which encloses the given context.
An AutofillGroupState can be used to register an AutofillClient when it enters this AutofillGroup (for example, when an EditableText is mounted or reparented onto the AutofillGroup's subtree), and unregister an AutofillClient when it exits (for example, when an EditableText gets unmounted or reparented out of the AutofillGroup's subtree).
The AutofillGroupState class also provides an AutofillGroupState.attach method that can be called by TextInputClients that support autofill, instead of TextInput.attach, to create a TextInputConnection to interact with the platform's text input system.
See also:
- EditableTextState, where this method is used to retrieve the closest AutofillGroupState.
Implementation
static AutofillGroupState? of(BuildContext context) {
final _AutofillScope? scope = context.dependOnInheritedWidgetOfExactType<_AutofillScope>();
return scope?._scope;
}