CustomMultiChildLayout (CustomMultiChildLayout) : CustomMultiChildLayout (CustomMultiChildLayout) : CustomMultiChildLayout (CustomMultiChildLayout
The CustomMultiChildLayout constructor has two properties, children and Delegate
Children are the children that we’re going to put in there, but we’re going to wrap that with a LayoutId, and we’re going to give that child an Id, which is a unique Id, and that Id can be of any type, and we’re going to use that in the layout; The delegate is an abstract class, we need to write a class that inherits the MultiChildLayoutDelegate and implements the methods in the delegate, performLayout is the method for the layout, shouldRelayout is the method that tells the delegate when it needs to refresh, We call the layoutChild in performLayout to calculate the size of the child element, and then use the positionChild method to complete the layout
Here I define a class that inherits from CustomMultiChildLayout, MyCustomMultiChildLayout, to get the id of the element and pass it to the delegate
A custom layout based on CustomMultiChildLayout is ready.