How do I determine the corner radius of a widget using the formula radius = hight/2
on a button that resizes after its child?
The child in this case is a Text that can be as long as the the passed string is.
This is what I got. I set the hight and maxWidth to zero in order to wrap the texts size, but I cant figure out a way to measure the width when applying the corner radius.
ButtonTheme(
height: 0,
minWidth: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(width/2)), //how can i calculate width?
child: RaisedButton(
onPressed: onPress,
child: Text('Some String of variable length'),
),
);
I've searched the web but nothing comes up.