Is there a map of Material design colors for Flutter?

前端 未结 6 800
执笔经年
执笔经年 2021-01-01 19:35

I have a widget that I\'d ideally like to take in a base Material color and output a widget themed with shades of that color. For example:

return new Contain         


        
6条回答
  •  醉酒成梦
    2021-01-01 20:05

    You can create your material color just like this:

    const MaterialColor primaryColorShades = MaterialColor(
      0xFF181861,
      {
        50: Color(0xFFA4A4BF),
        100: Color(0xFFA4A4BF),
        200: Color(0xFFA4A4BF),
        300: Color(0xFF9191B3),
        400: Color(0xFF7F7FA6),
        500: Color(0xFF181861),
        600: Color(0xFF6D6D99),
        700: Color(0xFF5B5B8D),
        800: Color(0xFF494980),
        900: Color(0xFF181861),
      },
    );
    

提交回复
热议问题