SizeBuilder constructor

const SizeBuilder({
  1. Key? key,
  2. Widget builder(
    1. double width,
    2. double height
    )?,
})
//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);