CountController
The CountController widget is used to increment and decrement the count or number.
You could use the CountController widget to set the quantity of any product when buying in an e-commerce app.
Widget State
Before diving into form widgets, check out our guide on Widget States to efficiently manage the state and behavior of your form elements.
Adding CountController to your project
Here's an example of how you can use a CountController widget in your project:
- First, drag the CountController widget from the Form Elements tab (in the Widget Panel) or add it directly from the widget tree.
- Move to the properties panel (in the right) and scroll down to the Count Controller Properties.
- 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.
- 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.
- 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.