FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
125 stars 25 forks source link

Unable to compare Datatype equality #3680

Closed ryutosh closed 1 month ago

ryutosh commented 2 months ago

Can we access your project?

Current Behavior

Not able to use "Equal To" or "Not Equal To" condition for same datatypes, with warning "Current variable is not valid".

Bellow shanpshot shows result of trying comparison for two same data type(TranslatedFieldType)s. image

These two are stored in local states. You can see these in Model view. image

Even comparing same instance also fails. image

The failure of comparison also occured for one in local state and another in Firestore Document. image

Expected Behavior

Can compare equality.

Steps to Reproduce

  1. Create two local states of same data type.
  2. On some action, write compare condition for these.

Reproducible from Blank

Bug Report Code (Required)

ITEehfKB35ZJpbwG1c7qcsJWiQMxQUB+bZ0vlO1FGEkYF5DpEZYue8nUaXdeTMeWSgl2DGKloEcCwMmNkfP9KfUoAzOtG5t607hpWAnzQj2hb8mvCpGKYXJAJ9NMJlC036uNuxV5HPRvWloF3GGLcq3qNleeY8aSfxBlZ7vfcPo=

Visual documentation

As in current behavior section.

Environment

- FlutterFlow version: 4.1.83
- Platform: Mac OS
- Browser name and version: Chrome
- Operating system and version affected: MacOS Sonoma

Additional Information

I see there is operator method in FF generated codes. image

Alezanello commented 2 months ago

Hi there!

I couldn’t replicate the issue in a new blank project. Here’s what I did:

  1. Created a Data Type with the following fields:
    • StringValue
    • IntegerValue
    • DoubleValue
    • BoolValue
  2. Created two AppStates, each containing the same Data Type with identical values.
  3. Created a button with a conditional action that:
    • Checks if AppState1.StringValue == AppState2.StringValue
    • If true, displays "True"
    • Repeats the same check for each corresponding value
  4. Compiled and tested the button.
  5. Everything worked fine.

You can view the public project here: Public Project.

If you’re still experiencing issues, please let me know, and we can investigate further!

ryutosh commented 2 months ago

Thanks @Alezanello for your response.

Created a button with a conditional action that: Checks if AppState1.StringValue == AppState2.StringValue

Please read Current Behavior section and you will see I am not comparing field of data type, but data type instance itself.

Alezanello commented 2 months ago

Hey!!

Could you record a quick video no more than 1 minute to show all the process you do to get to that point? in order to replicate correctly and see what you are experiencing

ryutosh commented 2 months ago

Could you record a quick video no more than 1 minute to show all the process you do to get to that point? in order to replicate correctly and see what you are experiencing

Or, may I add one more action to describe onto your Public Project. ? That's more easy for me.

Alezanello commented 2 months ago

Hello Ryutosh! sorry for the late response on this issue.
Feel free to add or modify the Public Project to show me the way!

ryutosh commented 2 months ago

Thanks @Alezanello . However I edited your project, there was message that I don't have write access. So could you watch attached video?

https://github.com/user-attachments/assets/87240f5d-1bc1-4fc3-ac12-eea4c5e6bc5c

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

Alezanello commented 1 month ago

Hello!

I apologize for the late response.

I watched your video, and it seems like you're trying to validate the entire DataStruct against another DataStruct, rather than comparing the individual items within the structure.

For example:

In the project I created, I was comparing the individual fields, like DataA.a == DataB.a, DataA.b == DataB.b, and DataA.c == DataB.c. However, in your video, it looks like you're validating the entire structure (DataA == DataB).

I'll check with the engineering team to see if this behavior is a bug or a feature request. It could be that this functionality was never implemented or it's the expected behavior due to the code generation process.

Thank you for your patience!