update method

void update()

Implementation

void update() {
  var oldLen = children?.length ?? 0;
  var netChange = updateChildren();
  if(netChange == 0){
    setState((){});
    return;
  }
  if(netChange < 0){
    for(var i = 0; i > netChange; i--){
      widget.listKey.currentState?.removeItem(oldLen-1+i, (context, animation) => SizeTransition(sizeFactor: animation), duration: Duration.zero);
    }
  }
  if(netChange > 0){
    for(var i = 0; i < netChange; i++){
      widget.listKey.currentState?.insertItem(children!.length+i-1, duration: Duration.zero);
    }
  }
}