shortenMapsToItemCount method
Removes all children that have a higher position the itemCount.
Implementation
void shortenMapsToItemCount({required int itemCount}) {
childrenKeyMap.removeWhere(
(key, value) => value.originalOrderId >= itemCount,
);
}