Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

i am change the background color of container using hexcode but showing error

Container(
color: Color(‘#260033’),
height: 150.0,
width: double.infinity,
child: Column(

i want to use hex code to change the container color.pls help me regarding this.

Container(
color: Color(‘#260033’), // showing error on this line
height: 150.0,
width: double.infinity,
child: Column(

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

i want to change the background of container using this hex color code but unable to this..

>Solution :

In flutter you have to use Color(0xff) with your hex code.

if you want to use the color #260033– use Color(0XFF260033)
FF represents full opacity. if you want to change the opacity replace FF with values in this table

        Container(
           color:Color(0xff260033),
           child: Text("some text"),
                 ),

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading