findMatch static method
Finds the nearest ancestor (MultiBindElement, MultiBindSlot) matching
type (including contract/alias types) and optional tag.
Implementation
static (MultiBindElement, MultiBindSlot<dynamic>)? findMatch(
BuildContext context,
Type type, {
String? tag,
}) {
var element = context.getElementForInheritedWidgetOfExactType<MultiBinder>()
as MultiBindElement?;
while (element != null) {
final slot = element.lookupSlot(type, tag: tag);
if (slot != null) {
return (element, slot);
}
element = element.parentMultiBinder;
}
return null;
}