Search code examples
flutterdartcolorsradix

What does the word "radix" mean inside an int.parse in dart?


Could someone please explain for me what is the meaning of radix in this code? int.parse(hexColorString, radix: 16); Thank you for helping.


Solution

  • "radix" refers to the number base used to represent the value being parsed. For example, a radix of 10 indicates that the value being parsed is in decimal (base 10) format, while a radix of 16 indicates that the value is in hexadecimal (base 16) format. The radix argument is optional, and if it is not provided, the method will attempt to infer the radix based on the format of the input string.