endBatch method

Map<int, TextData>? endBatch()

Implementation

Map<int, TextData>? endBatch() {
  Map<int, TextData> textDataMap = {};
  if (_updateNodeIdList.isEmpty) {
    return null;
  }
  for (var id in _updateNodeIdList) {
    VirtualNode? node = _virtualNodes[id];
    if (node is TextVirtualNode) {
      // If the node has been updated, but there is no updateLayout call from native(C++)
      // render manager, we should renew the layout on end batch and update to render node.
      TextData textData = node.createLayout();
      textDataMap[id] = textData;
    }
  }
  return textDataMap;
}