How to use hexadecimal color strings in Flutter?

Posted by Jessica Taylor | Updated on

Want to use hexadecimal color strings in Flutter? The Color class expects an ARGB integer. Since you try to use it with RGB value, represent it as int and prefix it with 0xff.

If you get annoyed by this and still wish to use strings, you can extend Color and add a string constructor

usage


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers