diff --git a/docs/resources/control-flow/functions/action-triggers.md b/docs/resources/control-flow/functions/action-triggers.md index f55d4ba5..96d8f8e0 100644 --- a/docs/resources/control-flow/functions/action-triggers.md +++ b/docs/resources/control-flow/functions/action-triggers.md @@ -68,7 +68,7 @@ Certain widgets offer specific triggers that activate based on user interactions - **On Page Swipe**: Available on the PageView widget to trigger actions when the page is swiped. - **On Toggle**: Available on the ToggleIcon widget, this trigger responds each time the toggle is activated. - **On Completed, On Change**: Specific to the PinCode widget, these triggers activate when the user completes or alters a pin entry. -- **On Count Changed**: Present in the CountController widget, this trigger responds to changes in the count. +- **On Count Changed**: Present in the Count Controller widget, this trigger responds to changes in the count. ## Gesture Detector Triggers @@ -296,4 +296,4 @@ Here’s how you do it: allow="clipboard-write"> -
\ No newline at end of file + diff --git a/docs/resources/ui/widgets/built-in-widgets/count-controller.md b/docs/resources/ui/widgets/built-in-widgets/count-controller.md index f5690bbe..a054d042 100644 --- a/docs/resources/ui/widgets/built-in-widgets/count-controller.md +++ b/docs/resources/ui/widgets/built-in-widgets/count-controller.md @@ -1,38 +1,37 @@ --- slug: count-controller -title: CountController +title: Count Controller tags: [Form Elements] -description: Learn how to add CountController in your FlutterFlow app. +description: Learn how to add, configure, and use a Count Controller widget in your FlutterFlow app. --- -# CountController +# Count Controller -The CountController widget is used to increment and decrement the count or number. +The **Count Controller** widget lets users increase or decrease a numeric value. Use it for product quantities, guest counts, ticket selections, or any input that must stay within a defined range. -You could use the CountController widget to set the quantity of any product when buying in an e-commerce app. +## Adding a Count Controller Widget -:::tip[Widget State] -Before diving into form widgets, check out our guide on [**Widget States**](../../../../ff-concepts/state-management/widget-state.md) to efficiently manage the state and behavior of your form elements. -::: +To add a Count Controller widget: -## Adding CountController to your project +1. Add the **Count Button** widget from **Form Elements** in the **Widget Palette**. +2. To configure the count behavior, use the following options: -Here's an example of how you can use a CountController widget in your project: + - **Initial Count:** Sets the value displayed when the widget loads. The default is `0`. To set this value dynamically, select **Set from Variable**. + - **Step Size:** Sets how much the value increases or decreases with each tap. The default is `1`. + - **Minimum:** Sets the lowest value users can select. + - **Maximum:** Sets the highest value users can select. -1. First, drag the **CountController** widget from the **Form Elements** tab (in the Widget Panel) or add it directly from the widget tree. -2. Move to the properties panel (in the right) and scroll down to the **Count Controller Properties**. -3. The number on CountController appears as soon as it is loaded, called the Initial Count, 0 by default. To change this initial count, enter the value in the **Initial Count** input box. You can also set this value dynamically by having it **Set from Variable**. This can be used to display the default quantity of a product in an E-commerce app. -4. The Step Size property sets the value by which the count should be increased or decreased. The default value is 1. To change this, enter the value in the **Step Size** input box. -5. To allow users to set the valid count or quantity, you can limit the CountController range (min and max count) by specifying the value in the **Minimum** and **Maximum** input boxes. +For an inventory selector, you might set **Initial Count**, **Step Size**, and **Minimum** to `1`, and set **Maximum** to the available stock.