toInt method
Converts the boolean value to an integer.
Returns:
1fortrue0forfalse
Example:
dart true.toInt(); // 1
Implementation
int toInt() => this ? 1 : 0;
Converts the boolean value to an integer.
Returns:
1 for true0 for falseExample:
dart true.toInt(); // 1
int toInt() => this ? 1 : 0;