FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
130 stars 26 forks source link

App State list clear value not showing default items #4715

Closed jeffcyw95 closed 3 weeks ago

jeffcyw95 commented 4 weeks ago

Can we access your project?

Current Behavior

Upon clearing value of an app state with default values, the app state becomes empty instead of having the default value

Expected Behavior

app state to have default value after clearing value in an actions

Steps to Reproduce

As above

Reproducible from Blank

Bug Report Code (Required)

IT4WhsmA8YxJpbxE1s+NdcZR/WAWHEwlaOcrm8N9cw0aF5fpPaYPX/z4UBJoTbyndkFqemaWhT4Jp9rKm9z1J/UBEyuZfIQ6+qhASQv/QmK6RbqaCLmCSEF+GshgI0Ck0p6RsxImKvh1SEY+2VOLfO6/EwXDJufXIkQeRPGICKjXvgfuQ0SLb3kNh1JWeC/v

Visual documentation

image

Environment

- FlutterFlow version: 
- Platform:
- Browser name and version:
- Operating system and version affected:

Additional Information

No response

Alezanello commented 4 weeks ago

Hello!

You're absolutely correct; this is the expected behavior when clearing values. When you set a default value, you are assigning an initial value to the variable. Clearing the values removes all assignments, allowing you to add new ones.

As a workaround, you could create a second variable called "DefaultXXXXValue". This variable can store the default value. When you want to reset to the default, you simply clear the original variable and set its value from the "DefaultXXXXValue" as a backup. This way, you can easily restore the default value when needed.