constrainedBigWidth function
double
constrainedBigWidth(
- BuildContext context,
- double preferredWidth, {
- double? constraintWidth,
Method to get preferredWidth constrained, if is smaller than default width, will return constraintWidth if not null, else return media query.
Implementation
double constrainedBigWidth (BuildContext context, double preferredWidth, {double? constraintWidth}) {
double width = preferredWidth;
double def = constraintWidth ?? MediaQuery.of(context).size.width;
if (preferredWidth < def) {
width = def;
}
return width;
}