Flutter variables are used to store data values that can be used throughout the application. The following are some common variables used in Flutter:
1. String: A sequence of characters enclosed in quotes, used to store text values.
Example:
“`
String name = “John”;
“`
2. int: A whole number used to store numerical values without decimal points.
Example:
“`
int age = 25;
“`
3. double: A number used to store numerical values with decimal points.
Example:
“`
double price = 9.99;
“`
4. bool: A data type used to store true or false values.
Example:
“`
bool isLoggedin = false;
“`
Flutter commands used to manipulate variables include:
1. var: A keyword used to declare a variable without specifying its data type.
Example:
“`
var name = “John”;
“`
2. final: A keyword used to declare a variable that cannot be changed after it is initialized.
Example:
“`
final int age = 25;
“`
3. const: A keyword used to declare a variable that is a compile-time constant and cannot be changed.
Example:
“`
const double price = 9.99;
“`
4. dynamic: A keyword used to declare a variable whose data type can be changed at runtime.
Example:
“`
dynamic value = “John”;
value = 25;
“`