Migrate constraint check to utils

This commit is contained in:
Ankit Mahato
2023-07-20 01:33:03 +05:30
parent f5ac9f827e
commit bf49a56c0f
3 changed files with 17 additions and 12 deletions

View File

@ -400,18 +400,10 @@ class _BodySuccessState extends State<BodySuccess> {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
var showLabel = false;
switch (widget.options.length) {
case 1:
showLabel = (constraints.maxWidth < 300) ? false : true;
break;
case 2:
showLabel = (constraints.maxWidth < 400) ? false : true;
break;
case 3:
showLabel = (constraints.maxWidth < 500) ? false : true;
break;
}
var showLabel = showButtonLabelsInBodySuccess(
widget.options.length,
constraints.maxWidth,
);
return Padding(
padding: kP10,
child: Column(