I\'m new with Flutter and I wonder about how difficult is (for me) to find a solution on how to convert my variable var int counter = 0; into a variable var String $
int i=10;
String st = i.toString(); // Converted to String
Use toString
and/or toRadixString
int intValue = 1;
String stringValue = intValue.toString();
String hexValue = intValue.toRadixString(16);
or, as in the commment
String anotherValue = 'the value is $intValue';
You can use the .toString() function in the int class.
int age = 23;
String tempAge = age.toString();
then you can simply covert integers to the Strings.
String s = "45";
int i = int.parse(s);
int j = 45;
String t = "$j";
// If the latter one looks weird, look into string interpolation on https://dart.dev