binaryToByte function

int binaryToByte(
  1. String binary
)

Convert a binary string to an integer. This function takes a binary string 'binary' and converts it into an integer. It uses the 'int.parse' method with a radix of 2 to interpret the binary string. The resulting integer represents the value of the binary string.

Implementation

int binaryToByte(String binary) {
  return int.parse(binary, radix: 2);
}