String getFoodListStringByFood(String foodName, int count, int calories){ int maxWidth = 35; String limitedText = foodName.length > maxWidth ? "${foodName.substring(0, maxWidth - 3)} ... $count x $calories kcal" : "$foodName $count x $calories kcal"; return limitedText; }