1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] How I can convert a Color into MaterialColor so I can have a limited Pallete of...

Discussão em 'Mobile' iniciado por Stack, Outubro 13, 2024 às 01:32.

  1. Stack

    Stack Membro Participativo

    For my application I wanted to limit my palette of colors therefore I made a class full of constants containing instances of Colors:


    class Colors
    {
    static var red = Color(0xFFFF1212);
    static var blue = Color(0xFF1212FF);
    static var green = Color(0xFF12F1FA);
    }



    But sometimes a MaterialColor is required. So somehow I need to convert a Color instance into a MaterialColor instance. But the constuctor requires to offer a swatch (some sort of pallete for it). How I can do this?

    Continue reading...

Compartilhe esta Página