fromString static method

List<bool> fromString(
  1. String bitString
)

Implementation

static List<bool> fromString(String bitString) {
  return bitString
      .split('')
      .map(
        (c) => switch (c) {
          '0' => false,
          "1" => true,
          _ =>
            throw ArgumentException.invalidOperationArguments(
              "fromString",
              reason: "Invalid bit string.",
            ),
        },
      )
      .toList();
}