hexConvertStr static method

String hexConvertStr(
  1. String? hex
)

Implementation

static String hexConvertStr(String? hex){
  if(hex?.isEmpty==true){
    return "";
  }
  List<int> bytes = [];
  for (int i = 0; i < hex!.length; i += 2) {
    String hexStr = hex.substring(i, i + 2);
    bytes.add(int.parse(hexStr, radix: 16));
  }

  String result = String.fromCharCodes(bytes);
  return result;
}