skip to Main Content

where to get flutter color code

i wanna change background color using hexa color. But I can only pickup flutter defaults values

class _SplashState extends State<Splash> {
  var customFontWhite = GoogleFonts.coiny(
      textStyle:
          const TextStyle(color: Colors.white, letterSpacing: 3, fontSize: 28));
  @override
  Widget build(BuildContext context) {
    // ignore: prefer_const_constructors
    return Scaffold(
      backgroundColor: Colors.red,
      body: Center(
        child: Text(
          'Tic-Tac-Toy',
          style: customFontWhite,
        ),
      ),
    );
  }

3

Answers


  1. You can use it like this:

    backgroundColor: Color(0xFFff4b4b),
    
    Login or Signup to reply.
  2. For this you can use Color();, don’t forget to start always with 0xFF

    Color(0xFFYour color);
    
    Login or Signup to reply.
  3. You can use hexa colors without using any packages, just type

    Color(0xffff4b4b)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search