FlutterFlow Docs
Search…
Advanced Functionality πŸ€–
Update Local State
Using this Action, you can set/clear values for the Local State variable.
Update Local State Action Demo

Prerequisites

Before you start adding the Update Local State Action, you'll need to create the Local State variable using the instructions here.

Types of Update

There are two types of updates you can make to a Local State variable:
  • Set Value: Used to set the value either from any other variable or a specific one.
  • Clear Value: Used to remove the already stored value inside the variable.
  • Increment/Decrement: Used to increment or decrement the integer number. Entering a positive value will increment the number while a negative number will decrement the number.
  • Add to List: Used to add an Item to the variable defined as List.
  • Remove from List: Used to remove an Item from the variable defined as List.

Defining Update Local State Action

Go to your project page on FlutterFlow and follow the steps below to define the Update Local State Action to any widget.
  • Select Actions from the Properties panel (the right menu), and click Open. This will open an Action flow Editor in a new popup window.
  • Click on + Add Action.
  • On the right side, search and select the Update Local Stat action.
  • Set the Select field to update to the Local State variable name.
  • Choose the Select Update Type among Set Value, Clear Value, or Increment/Decrement, Add to List, Remove from List. Further options are displayed based on the Update Type.
  • Set the Value Source to From Variable.
  • Set the Source to Widget State.
  • Set the Available Options to the appropriate widget.
Adding Update Local State action