toInt method

  1. @useResult
int toInt()

Returns 1 if true and 0 otherwise.

See Integers.toBool.

true.toInt(); // 1
false.toInt(); // 0

Implementation

@useResult int toInt() => this ? 1 : 0;