computeStonePositions abstract method Null safety
Let you compute stone position for each stone. StonePositions must not overlap (stack not allowed), and not been drawn outside the wall (depending on WallBuilder.mainAxisSeparations).
To help you, the WallBuilder will check these two requisites. Added to that, you have access to layout main data:
- WallBuilder.direction : Direction of the wall to draw
- WallBuilder.mainAxisSeparations : number of elements of the main direction.
- WallBuilder.reverse : define whether to display the stones in reverse mode (check ScrollView.reverse) The returned data will be used to draw stones. If a stone is not in this map, it won't be drawn. All new created Stone inserted in the Map will be taken into account.
Map<Stone, StoneStartPosition> computeStonePositions(List<Stone> stones);