complete0xHex function

String complete0xHex(
  1. String hex
)

Function for add 0x prefix.

Implementation

String complete0xHex(String hex) {
  if (hex.startsWith('0x')) {
    return hex;
  }
  return '0x$hex';
}