setToRebuild static method

void setToRebuild(
  1. _SubscriberTagSet aspects
)

Implementation

static void setToRebuild(_SubscriberTagSet aspects) {
  for (final aspect in aspects) {
    final elements = _subscribersList[aspect];

    var i = 0;
    while (i < elements.length) {
      final elem = elements.elementAt(i);
      if (elem.mounted) {
        // debugPrint("$elem exists");
        i++;
        if (!elem.dirty) {
          // debugPrint("$elem mark rebuild");
          elem.markNeedsBuild();
        }
      } else {
        // debugPrint("$elem remove");
        elements.remove(elem);
      }
    }
    //* Deprecated:
    // for (final elem in elementSet) {
    //   if (elem.mounted) {
    //     newSet.add(elem);
    //     if (!elem.dirty) {
    //       elem.markNeedsBuild();
    //     }
    //   }
    // }
    // _subscriberList[aspect] = newSet;
  }

  /// Deprecated of Flutter 3.13.0
  //   if (_rebuildSet.isEmpty) {
  //     _regFutureQueue();
  //   }
  //   _rebuildSet.addAll(aspects);
}