Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter layout builder

var container = new Container(
  // Toggling width from 100 to 300 will change what is rendered
  // in the child container
  width: 100.0,
  // width: 300.0
  child: new LayoutBuilder(
    builder: (BuildContext context, BoxConstraints constraints) {
      if(constraints.maxWidth > 200.0) {
        return new Text('BIG');
      } else {
        return new Text('SMALL');
      }
    }
  ),
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flutter #layout #builder
ADD COMMENT
Topic
Name
5+5 =