S
S
sldo_ru2021-07-15 14:59:50
Dart
sldo_ru, 2021-07-15 14:59:50

How to change default color of preffix Icon in Flutter?

Hi all! I need to make the preffix Icon color red by default, and blue on focus, if set via Icon(color), then the color is set for all states. How can I solve this problem?

data: Theme.of(context).copyWith(
    iconTheme: Theme.of(context).iconTheme.copyWith(
        color: Colors.red,
    ),
    colorScheme: Theme.of(context).colorScheme.copyWith(
        primary: Colors.blue,
    ),
),

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Neonoviiwolf, 2021-07-15
@Neonoviiwolf

I’ll open a universal formula, take the widget in which you need to set something and go to sdk, it’s quite easy to find how it is set there, usually it’s just that there are checks in a row which parameter is not null

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question