1 Anonymous Asked: August 30, 20202020-08-30T18:56:13+00:00 2020-08-30T18:56:13+00:00In: flutter How do I use hexadecimal color strings in Flutter? 1 How do I convert a hexadecimal color string like #b74093 to a Color in Flutter? I want to use a HEX color code in Dart. androidcolorsdartflutterios Share Facebook 1 Answer Voted Oldest Recent krushnajena 0 Questions 6 Answers 0 Best Answers 5 Points View Profile krushnajena 2020-08-30T19:28:36+00:00Added an answer on August 30, 2020 at 7:28 pm In Flutter the Color class only accepts integers as parameters, or there is the possibility to use the named constructors fromARGB and fromRGBO. So we only need to convert the string #b74093 to an integer value. Also we need to respect that opacity always needs to be specified. 255 (full) opacity is represented by the hexadecimal value FF. This already leaves us with 0xFF. Now, we just need to append our color string like this: const color = const Color(0xffb74093); // Second `const` is optional in assignments. The letters can by choice be capitalized or not: const color = const Color(0xFFB74093); 0 Reply Share Share Share on Facebook Share on Twitter Share on LinkedIn Share on WhatsApp Leave an answerCancel replyYou must login or register to add a new answer.