Change button color on tap

Actions & Logic
Resolved

Hello. I was trying over and over to change the color of the button on tap but without any success.

The question is if there are bugs on the flutter flow side or I'm doing something wrong. See the scenario below to follow my step.

Best regards,

Andrey Maleev

What have you tried so far?

Scenario:

  • Created a button on a page.

  • Created a local state page variable (tried both boolean and enum).

    • Lets for this example use boolean for simplicity: bool IsPressedBnt;

  • Added action for the button:

    • On Tap -> Update page state

      • Set fields -> IsPressedBnt

        • Select update type -> Set value

        • Value to set -> True

  • The fill color parameterisation:

    • Choose: if/then/else condition

      • if isPressedBnt then Color 1 else Color 2

The testing was done in the "preview app", I have also tried to run the app in test mode (but this feature is way to buggy to use, at least for me, there are no texts that are visible and icons disappears)

Did you check FlutterFlow's Documentation for this topic?
No
2
10 replies