In this tutorial you will learn about the Dart Boolean and its application with practical example.
Dart Boolean
The Boolean data type is used to represent the truth values, which can be either True or False. Boolean are commonly used in decision making statements. In Dart, you cannot use 0 or 1 to represent true or false. Boolean can be declared using bool keyword.
1 |
bool isValid = true; |
Example:-
1 2 3 4 5 |
void main() { bool flag; flag = 10 > 5; print(flag); } |
Output:-
1 |
true |