How would you get this code to work:
// Can't assign an int to a String
String heightInCM = 185;// Can't compare String to int
String heightCategory = heightInCM > 175 ? "Tall" : "Normal";
Change the “type” of heightInCM to var to infer an int, and this code will work.
Also, I believe it’s common in Dart to use single quotes for strings unless you have a good reason not to:
var heightInCm = 185;
var heightCategory = heightInCm > 175 ? 'Tall' : 'Normal';