isBinary property

bool get isBinary

Checks if the string can be parsed as a binary number (only contains 1's and 0's).

Implementation

bool get isBinary => toIntOrNull(radix: 2) != null;