finalize method

bool finalize(
  1. CssSelector cssSelector,
  2. void callback(
    1. CssSelector,
    2. T
    )?
)

Implementation

bool finalize(
    CssSelector cssSelector, void Function(CssSelector, T)? callback) {
  var result = true;
  var listContext = this.listContext;
  if (notSelectors.isNotEmpty &&
      (listContext == null || !listContext.alreadyMatched)) {
    var notMatcher =
        SelectorMatcher.createNotMatcher(notSelectors, cbContext);
    result = !notMatcher.match(cssSelector, null);
  }
  if (result &&
      callback != null &&
      (listContext == null || !listContext.alreadyMatched)) {
    if (listContext != null) {
      listContext.alreadyMatched = true;
    }
    callback(selector, cbContext);
  }
  return result;
}