lookupSlot method

MultiBindSlot? lookupSlot(
  1. Type type, {
  2. String? tag,
})

Implementation

MultiBindSlot<dynamic>? lookupSlot(Type type, {String? tag}) {
  final list = _slotsByType[type];
  if (list == null || list.isEmpty) return null;
  for (var i = list.length - 1; i >= 0; i--) {
    final candidate = list[i];
    if (candidate.tag == tag) {
      return candidate;
    }
  }
  if (tag == null) {
    return list.last;
  }
  return null;
}