Here is the code I have written so far
The line of code I have bolded is the one most likely causing the error but cant figure out whats wrong with it?
String? calculateImagePercentage(
int? image1,
int? image2,
int? image3,
int? image4,
int? calcFor,
int? imageNum,
) {
/// MODIFY CODE ONLY BELOW THIS LINE
String percentValue = "";
if (imageNum == 2) {
if (imageNum == 1) {
if (image1 == 0) {
percentValue = "0%";
} else {
var n = ((image1 / (image1 + image2))*100).ceil();
percentValue = n.toString();
}
}
}
if (imageNum == 4) {
percentValue = "4";
}
return percentValue;
/// MODIFY CODE ONLY ABOVE THIS LINE
}