hexToNumber function
Converts a hexadecimal string to an integer.
Takes a hex string and parses it as a base-16 (hexadecimal) number.
Example: hexToNumber('1A') => 26
Implementation
int hexToNumber(String hex) {
return int.parse(hex, radix: 16);
}