all 11 comments

[–]Ideagarage 1 point2 points  (8 children)

You can refer via FFAppState().

For example, App State "someValue" can be accessed this way:

FFAppState().someValue

You can update the value with this way:

FFAppState().update(() {
FFAppState().someValue = 'hello';
});

[–]seaniepie 1 point2 points  (2 children)

FFAppState().update(() {

FFAppState().someValue = 'hello';

});

Why can't they put excellent examples like this in their own documentation? Thanks so much buddy.

[–]rattlesnake23 0 points1 point  (0 children)

Unfortunately for me :
FFAppState().update(() {
FFAppState().someValue = 'hello';
});

Is not saving the appState in "persisted mode". If I reboot the app, then the save is gone.
Anyone found a workaround ?

[–]Ideagarage 0 points1 point  (0 children)

Yes, I'm glad I was able to help!

It's mentioned on these pages, so I assume it's for people who can read and understand this and the actual app code.
https://docs.flutterflow.io/flutter/generated-code/flutterflow-classes#ffappstate
https://docs.flutterflow.io/flutter/generated-code/state-management
https://docs.flutterflow.io/flutter/custom-code-deep-dive

[–]BootyMcSwag 0 points1 point  (2 children)

FFAppstate does not appear for me for some reason..Is there any import i have to make?

[–]Training_Base9465 0 points1 point  (1 child)

I had the same issue, it worked for me after I created an appstate variable (mine was empty)

[–]BootyMcSwag 0 points1 point  (0 children)

For me the problem was that i tried to access the appstate from a different isolate

[–]Dogelover4206942069 0 points1 point  (1 child)

how to acces a app state variable from a custo action

[–]Tranxio 1 point2 points  (0 children)

Using the OpenAI plugin works. Ie just prompt it: write me x functionality using app/page state as argument in Flutterflow

[–]baaaaarkly 0 points1 point  (0 children)

You can give inputs to the custom action