Skip to content

Can't save List<int> to app state #920

Closed
@Godfrey1912

Description

@Godfrey1912

Has your issue been reported?

  • I have searched the existing issues and confirm it has not been reported.
  • 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

As per now-closed #683 (comment).

A list of integers cannot be saved to an app state of type list< integer >. The solution provided in issue 683 is incorrect, as saving as a type of list< JSON > does not resolve the issue.

Expected Behavior

Having created an app state variable of type list< int >, I expect to be able to save a list of integers obtained from a JSON path to that variable in an "Update app state" action. This is not possible, and produces an error as described in issue 683.

Note that manually keyed-in values into the same app state behave correctly. In other words, it is possible to have a list of integers in a correctly-configured app state, but not possible to save them in bulk.

Steps to Reproduce

Create API endpoint which return a list of integers
Create JSON path of List< integer >
Create App State with type List< integer >
Create Login button or Register and use action "Update App State" and save the JSON path to App State variable
Run the Test Mode
Hit Login or Register button and check browser console for error

Reproducible from Blank

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

Bug Report Code (Required)

IT4Khc/1sIhgrsMA7aXyKe9ahmEXHD8jarswlsJud0kbC72qG7YAW/SkQE9WZ7yhdH03Ok20kT81+sKLvtzIN+wqF0+rRaU/yKpQbQLKfEKWbLKuOpbse39PGtpKC0zA56a32BYnHM5idCUO73GQC+i9TnLcQJT1NlUaAPyIDLP/o3/uQ0SLb3kNh1JWeC/v

Context

I need a list of integers for populating the X and Y axes of a chart. I also need to be able to filter these values, such as ">10" or "=50". This not possible when the JSON path is saved to an app state variable as list< JSON >.

Visual documentation

image
image

Additional Info

See also my discussion at: https://community.flutterflow.io/c/discuss-and-get-help/setting-app-state-list-values#comment_wrapper_19446918

Environment

- FlutterFlow version: 3.7.12
- Platform:web
- Browser name and version:Chrome 113.0.5672.63
- Operating system and version affected: Linux pop_os 22.04

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions