1. int
- Represents whole numbers, like 1, 2, -5, etc.
- Example:
int age = 25;
2. double
- Represents floating-point numbers (numbers with a decimal point), like 3.14, -0.5, etc.
- Example:
double pi = 3.14;
3. String
- Represents a sequence of characters, like "hello", "Dart", etc.
- Example:
String name = "Alice";
4. bool
- Represents boolean values - either
true or false.
- Example:
bool isStudent = true;
5. List
- Represents an ordered collection of items of the same type.
- Example:
List<int> numbers = [1, 2, 3];
6. Map
- Represents a collection of key-value pairs.
- Example:
Map<String, int> scores = {'Alice': 90, 'Bob': 85};
7. Set
- Represents a collection of unique items, without any order.