maybeOf method Null safety
- BuildContext context
Gets the immediate ancestor SelectionRegistrar of the BuildContext.
If this returns null, either there is no SelectionContainer above the BuildContext or the immediate SelectionContainer is not enabled.
Implementation
static SelectionRegistrar? maybeOf(BuildContext context) {
final SelectionRegistrarScope? scope = context.dependOnInheritedWidgetOfExactType<SelectionRegistrarScope>();
return scope?.registrar;
}