How to use Hexadecimal color codes in Flutter

Normally, in Flutter you can mostly find predefined colors by doing something like:

What about if you want to assign your own color code? That’s easy. Use this format:


Replace COLOR_CODE with the color code you want to use E.g

Color(0xFFFFFFFF) //white
Color(0xFF000000) //black

Add a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.