FlexLayout wrap on resize

I have a FlexLayout container with two child components. I am trying to find out whether FlexLayout can auto wrap child components when resizing the browser. If FlexLayout works, it will reduce a bunch of css I have to code.


FlexLayout layout = new FlexLayout();
layout.add(child1, child2);
setFlexGrow(1, child1);
setFlexGrow(2, child2);

There is a method for the FlexLayout Class called setWrapMode you can then e.g. add a layout.setWrapMode(FlexLayout.WrapMode.WRAP); to enable auto wrap