Flutter: Data types
Dart supports several data types. In this article, we will learn about some of them:
|int||1, 5, 10, 100|
|double||1.5, 0.25, 10.5|
|num||1, 1.5, 10|
String data type holds a sequence of characters. You can create a string using single quotes
' or double quotes
var myString1 = 'This is a string'; var myString2 = "This is another string";
var myNumber = 5000;
double data type holds floating-point numbers.
var myDouble = 1.25;
num data type can hold integers or floating-point numbers. For example:
num myNum1 = 100; num myNum2 = 1.25;
bool data type can hold only two values:
var myBoolean = true;
We learned about some of the data types supported by Dart. Of course, there are many more data types like Maps, Lists, Sets, etc. But we will learn about them in the following articles of this course.