In Dart, data types represent the kind of data that can be stored and manipulated by variables. Dart is a statically typed language, meaning that variables must have a specific type declared at compile-time. Here are the commonly used data types in Dart:
1. Number :
(a) int: Used to represent integers (whole numbers) such as -10, 0, 42.
(b) double: Used to represent floating-point numbers (numbers with decimal points) such as 3.14, -0.5, 2.71828.
List < int > numbers = [1, 2, 3, 4, 5];
List < String > names = ['Alice', 'Bob', 'Charlie'];
Map < String, int> ages = {'Alice': 30, 'Bob': 25, 'Charlie': 35};
dynamic value = 42;
value = 'Dart';
Object obj = 'Hello';