Flutter Tutorial - Change Elevated Button Color On Tap

Flutter Tutorial - Change Elevated Button Color On Tap

HeyFlutter․com

2 года назад

30,381 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Sudeb Sarkar
Sudeb Sarkar - 01.11.2023 20:04

Source code not shared

Ответить
soran2023
soran2023 - 03.09.2022 23:38

The color only changes for a few seconds using this function.
I also get the error in blue that says:
Use a function declaration to bind a function to a name.

MaterialStateProperty<Color> getColor(Color color, Color colorPressed) {
final getColor = (Set<MaterialState> states){

if( states.contains(MaterialState.pressed) ){
return colorPressed;
}
else{
return color;
}
};

return MaterialStateProperty.resolveWith(getColor);

}

Ответить
Earl Vergille Revelo
Earl Vergille Revelo - 28.07.2022 17:06

how to make it if i want to create a permanent border after i click the button? thank

Ответить
Milind Sharma
Milind Sharma - 24.07.2022 12:13

I find your tutorials, like this one, sometimes quite confusing as you don't explain the logic behind certain things. It's very confusing to just copy your code and not understand what's going on.

Ответить
Feruz Boymuratov
Feruz Boymuratov - 22.03.2022 06:42

I really like your videos. But I have a question, what nationality are you? I mean, you say color as "kala"?

Ответить
사무직 노동자
사무직 노동자 - 17.03.2022 09:54

I want to hold the pressed color upon click...so I tried to use ternary operator, but it didn't work... what can i do ㅠㅠ

Ответить
masfiq reza
masfiq reza - 27.11.2021 07:24

Very nice.But after pressing the color gone. Can I make them stay? Like when I press it should be stay green. Can it be done?

Ответить
vamsi krishna thanikanti
vamsi krishna thanikanti - 31.10.2021 09:38

Hi Johannes Milke, First thanks for this video. Second, After I click on button its changing color as we mention in getColor but immediately its coming back to normal. Its not holding at color changed properties as you shown in video. What could be the wrong ?

Ответить
abdullah
abdullah - 16.10.2021 23:24

Hello my friend, I am a fan of flutter. I prefer to program on flutter, but I noticed that flutter is much slower in performance than java. Why can I solve this problem? Is there a solution to this problem in the future? Please reply and thank you.

Ответить
Md Shahid Ali
Md Shahid Ali - 16.10.2021 18:54

Sir Create a Video of Build Ios and macOS App and Publish to App Store.
Thanking You .

Ответить
Mohammad Shahid
Mohammad Shahid - 16.10.2021 08:34

Thank u so much for such great videos.. keep going bro 😊

Ответить
Md Shahid Ali
Md Shahid Ali - 16.10.2021 06:52

sir Create a video on when I set the color in setting then all color are changed who I set in a setting method in flutter application.

Ответить
LearnToCode
LearnToCode - 15.10.2021 22:49

thanks alot

Ответить
Darul - asar
Darul - asar - 15.10.2021 22:40

it seems to me that if we use the Materialbutton it will be easier, there is a built-in method where you can change the color

Ответить