title: Dart: convert decimal to hex
body: <p>I've been searching for a way to convert decimal numbers to hexadecimal format in the Dart programming language.</p>
  <p>The <code>hex.encode</code> method in the <code>HexCodec</code> class, for example, cannot convert the decimal 1111 (which has a hex value of 457) and instead gives an exception:</p>
  <blockquote>
  <p>FormatException: Invalid byte 0x457. (at offset 0)</p>
  </blockquote>
  <p>How do I convert a decimal number to hex?</p>