convert method Null safety

  1. @override
Uint8List convert(
  1. String input
)
override

Converts input and returns the result of the conversion.

Implementation

@override
Uint8List convert(String input) {
  final result = Uint8List(input.length ~/ 2);
  for (int i = 0; i < input.length; i += 2) {
    var num = input.substring(i, i + 2);
    var byte = int.parse(num, radix: 16);
    result[i ~/ 2] = byte;
  }
  return result;
}