addView method

  1. @override
void addView(
  1. dynamic view, {
  2. int index = -1,
})
override

========================管理子View相关方法=======================

Implementation

@override
void addView(View view, {int index = -1}) {
  super.addView(view, index: index);
  if (view is GridChild) {
    var childView = view as GridChild;
    int xIndex = childView.xAxisIndex;
    if (xIndex < 0 || xIndex >= props.xAxisList.length) {
      xIndex = 0;
    }
    _xMap[props.xAxisList[xIndex]]!.addChild(childView);

    int yIndex = childView.yAxisIndex;
    if (yIndex < 0 || yIndex >= props.yAxisList.length) {
      yIndex = 0;
    }
    _yMap[props.yAxisList[yIndex]]!.addChild(childView);
  }
}