binaryToDecimal method

List<int> binaryToDecimal(
  1. String s
)

Implementation

List<int> binaryToDecimal(String s) {
  List<int> binaryList = List.empty();
  binaryList = binaryList.toList();
  for (int i = 0; i < s.length; i += 8) {
    String bin = s.substring(i, i + 8);
    int code = int.parse(bin, radix: 2);
    binaryList.add(code);
  }
  return binaryList;
}