estimateWidth method
Implementation
double estimateWidth(BuildContext context) {
double width = size;
if (!title.isNullOrBlank || !subTitle.isNullOrBlank) {
width += 7.5; // Spacing between image and text column
double textWidth = 0;
if (!title.isNullOrBlank) {
textWidth = WidthHelper.measureText(context, title!, const TextStyle(fontSize: 15.0, fontWeight: FontWeight.w400));
}
if (!subTitle.isNullOrBlank) {
double subWidth = WidthHelper.measureText(context, subTitle!, const TextStyle(fontSize: 11.0, fontWeight: FontWeight.w300));
if (subWidth > textWidth) textWidth = subWidth;
}
width += textWidth;
}
return width;
}