Skip to content

SQLite REAL vs DECIMAL vs INTEGER -> double vs int issues #4859

@andro951

Description

@andro951

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

I'm using an SQLite database I made in a FlutterFlow project. I made a Read Query with an output column: WateringFrequencyInDays which is marked as a double. In the SQLite database, the WateringFrequencyInDays column is a REAL. When the value is something like 3.5, it works as expected, and the Query is usable resulting in the value 3.5 as a double. However, if the value is a whole number like 3, the app's page goes blank gray because it isn't converting to double. If I change the output column type to int when the value is 3, it will work correctly. This is very clearly not how it should work since in a REAL column, there can be values with or without decimals and it should be able to cast either of them to a double.

Expected Behavior

Be able to cast values from a REAL column that are whole numbers to a double.

Steps to Reproduce

Create a SQLite database with 2 entries. It should have 1 REAL column. One row should have a whole number like 3, and the other row should have decimal number like 3.5. Create a Read query that marks the return type as double, and make a text widget to display the 3.5 value. Next, make a text widget to display the 3 value still as a double.

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

IT43hs7ZuLl6sbhb7c2MbvoypGQnGlgJWq8vkNlRaDYvCIyqOph/eeOlXxduTe2+S3lhHFqgil0y7sGMuPL9KPQpGwuZRZxg+s9IczrNd3q8Sr6qDMyRPnFPN+JRIFSs0MCRmSYkIvFhci0m7zqmAtmuTjPYCZ+/Zwh9f6PHaOI=

Visual documentation

image

MinPH column is a REAL column. values like 5.5 will successfully cast to double where 6 won't.

Environment

- FlutterFlow version: 3.24.2
- Platform: Created on Windows on an Edge browser.  Not working when generating an APK and testing on android.
- Browser name and version: Microsoft edge
- Operating system and version affected:

Additional Information

No response

Metadata

Metadata

Assignees

Labels

status: can't reproduceFollowing the reported steps did not reproduce the bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions