inflate method
Implementation
List<Widget> inflate() {
// create box views
if (widget.boxes.isEmpty) {
var views = widget.model.viewableChildren;
Widget? view1;
if (views.isNotEmpty) view1 = views.elementAt(0).getView();
widget.boxes.add(view1 is BoxView ? view1 : _missingView);
Widget? view2;
if (views.length > 1) view2 = views.elementAt(1).getView();
widget.boxes.add(view2 is BoxView ? view2 : _missingView);
}
// ratio box1:box2. if 1, box 1 is 100% size
var ratio = widget.model.ratio;
if (ratio < 0) ratio = 0;
if (ratio > 1) ratio = 1;
var flex = (ratio * 1000).ceil();
List<Widget> list = [];
// left/top pane
var box1 = _constrainBox(widget.boxes[0], flex);
list.add(box1);
// handle
Widget handle = _buildHandle();
list.add(handle);
// right/bottom pane
var box2 = _constrainBox(widget.boxes[1], 1000 - flex);
list.add(box2);
return list;
}