toHexString static method

String toHexString(
  1. int num, {
  2. int left = 8,
})

int 转16 进制 left位补齐 0

Implementation

static String toHexString(int num, {int left = 8}) {
  String hex = num.toRadixString(16);
  String hexLeft = hex.padLeft(left, '0');
  return '0x${hexLeft.toUpperCase()}';
}