SizeBuilder constructor
//EXAMPLE:
SizeBuilder(builder: (width, height) {
Size layout = Size(width, height);
return Container(
width: width,
height: height,
color: Colors.red,
);
});
//RETURN THAT:
return LayoutBuilder(builder: (_, constraints) {
return widget.builder(constraints.maxWidth, constraints.maxHeight);
});
Implementation
const SizeBuilder({Key? key, this.builder}) : super(key: key);