FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
98 stars 17 forks source link

ENUM Type in Data Type set in App State is not working in App #2861

Closed JanikHalder closed 5 days ago

JanikHalder commented 2 weeks ago

Has your issue been reported?

Current Behavior

I created a ENUM in my project and use it in a Data Type, which then I use to create an App State. The problem which i am facing is, that if i want to display the enum in my App it just shows the default variable of the Data Type or if i didn't set a Value in the Data Type it shows the Text Default Variable Value.

Also if i use the ENUM of the Data Type in other things like components, i get an Null check operator used on a null value Error (if I didn't select a default value in the Data Type).

As you use just an ENUM as an App State Variable everything works as expected. But even if you use a Data Type which just contains an ENUM it is not working anymore.

Expected Behavior

App State Data Type should contain the right ENUM Value.

Steps to Reproduce

  1. Create ENUM
  2. Create Data Type which contains the ENUM
  3. Use the ENUM of the Data Type in any widget

Reproducible from Blank

Bug Report Code (Required)

ITFXhc/634hPxOZE0M7qKO5F9GQwFjsaU40V0tcbd0oaF4jqPZYuf+r+VxdoZ7yWTQk3fVCbgkAz08mLj4XqUsJcNU+aUoNoyZFQdAzdTn6mVJfQCJGwSGhPFppUGUCd0KungxFAGMtuSCEnw1r/cq3qNleeY8aSfxBlZ7vfcPo=

Context

I want to create a default state for a custom dropdown and also use the my Data Type across my app to have a custom UI depending on which category the user have selected.

Visual documentation

Bildschirmfoto 2024-05-05 um 15 14 43

Test should be the ENUM (here i set a default value in the text widget) and also Montag should be the ENUM value (here i set a default state in the Data Type)

Additional Info

No response

Environment

- FlutterFlow version: 4.1.47
- Platform: MacOS Desktop
- Browser name and version: -
- Operating system and version affected: macOS

General

Relative to the time the changes were made, data was lost within

When following my steps to reproduce, data loss happens

ignalauret commented 1 week ago

Hey @JanikHalder thanks for your report. I can confirm that the value of an Enum inside a DataType that is stored on Page State or App State is not being read by the UI. I will send this ticket to our Technical team so they can take a look. They will keep you updated on this thread. Have a great day!

ignalauret commented 1 week ago

@JanikHalder I checked with the Technical team, and we were able to make it work and use the Enum value from inside the DataType on the AppState. Could you please share with me the blank project with the Steps to reproduce and the bug occurring?

JanikHalder commented 1 week ago

https://app.flutterflow.io/project/enum-project-i9gp6f?tab=pageSelector&page=HomePage

Here is the Link to the Blank Project.

I did the same things as mentioned before. 1.) Create ENUM 2.) Create Data Type which contains the ENUM 3.) Use the ENUM of the Data Type in any widget But i guess i know the one thing which is missing. I set the ENUM as the default values of the State Variable. Could this be the issue?

ignalauret commented 1 week ago

@JanikHalder I can confirm that the Enum inside the DataType is not being read, and adding only the Enum in the App State is being read correctly. I will send this to our engineering team and they will keep you updated on this thread. Thanks for the help, have a great day!