6 lines
279 B
Dart
6 lines
279 B
Dart
|
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;
|
||
|
}
|