I'm using LayoutBuilder and would like to pass values to a child widget:
LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Padding(
padding: const EdgeInsets.all(constraints.maxWidth / 10),
But I'm getting the error
Invalid constant value
Is there a way to pass constraints.maxWidth to the child widget?
Remove the const keyword before EdgeInsets.all because constraints.maxWidth is not a constant term