Local State allows you to store values that you can use on different pages of your app. For example, your language selection on one page can be used to translate the text on other pages of the app.
You can also mark the Local State variable as 'Persisted' to store values that can be used when the app is restarted.
In this guide, you'll learn to work with Local State variables by building an example that stores language from the dropdown into the local state variable. The selected language is then shown on another page of the app (i.e without passing it from the previous page).
Storing language selection using local state variable
Supported Data Types
The following data types are available within FlutterFlow:
Integer: To store numbers such as 100, 4302, 50000, etc.
Double: To store a decimal number such as 12.43, 3233.50, 65.5666, etc.
String: To store plain text such as title, description, etc.
Image Path: To store the URL of the uploaded image.
Video Path: To store the URL of the uploaded video.
Audio Path: To store the URL of the uploaded audio.
Boolean: To store either a true or false value.
Record Reference: To store a reference of a document. Storing a reference helps you fetch the document data.
Timestamp: To store date and time value.
Lat Lng: To store the latitude and longitude of a particular place. Storing Lat Lng value helps you locate a place in Google Maps.
Working with Local State Variable
Working with local state variables includes the following: