sign method

int sign()

Randomly generates a bool value and returns it as a 1 or -1.

Implementation

int sign() => nextBool() ? 1 : -1;