toInt method
Converts the boolean value to an integer.
Returns:
1fortrue0forfalseornull
Example:
dart bool? flag = true; flag.toInt(); // 1
Implementation
int toInt() => validate().toInt();
Converts the boolean value to an integer.
Returns:
1 for true0 for false or nullExample:
dart bool? flag = true; flag.toInt(); // 1
int toInt() => validate().toInt();