Quickstart Guide
Welcome to the FlutterFlow Quickstart Guide! This guide introduces the basic FlutterFlow concepts through a short, hands-on exercise. You'll build a product quantity selector that allows users to adjust the quantity of an item before adding it to their shopping cart.
To complete this guide, you need:
- A FlutterFlow account.
- A web browser.
- About 15-20 minutes.
Below is a preview of what your completed app will look like:
What You'll Learn
- Build a layout with widgets.
- Customize widget styles.
- Add interactivity with actions.
- Manage page state in response to user input.
- Run and test your app.
Follow these steps to build the app:
1. Clone the Starter Project
This guide uses a prepared starter app so you can focus on building the interaction. Open the FlutterFlow Quickstart project, click Clone, and the project will be added to your account.
To begin with a separate project instead, see Create a Project.
After cloning the project, you’ll see a page with product images and a description. You’ll add a feature that allows users to update the product quantity.
2. Build the UI
Build the quantity control by combining layout and display widgets in the product page's Widget Tree.
- Open the product page and locate the content below the product description.
- Add a Container to hold the quantity control.
- Add a Row inside the Container.
- Add a Text widget for the "Quantity" label.
- Add controls for decreasing the quantity, displaying its current value, and increasing it.
- Arrange the widgets so the label appears on the left and the quantity controls appear on the right.
To learn more, see Building Layouts and the Widget Overview.
3. Customize Styles
Next, style the quantity control to match the rest of the product page. Use the Properties Panel to adjust each selected widget.
- Adjust the spacing and alignment of the Row.
- Select the Container that holds the quantity control and adjust its background color, padding, size, and corner radius.
- Style the "Quantity" label and value so they are easy to read.
- Customize the decrease and increase controls with suitable icons, colors, and sizes.
- Compare the result with the completed preview and make any final visual adjustments.
4. Manage State
Once your UI is set up, make your app interactive by adding a page state variable. A state variable stores data that can change as users interact with the page. In this exercise, it stores the current product quantity and updates the displayed value when users select the increase or decrease control.
4.1 Add a State Variable
Add a page state variable that will hold the current quantity value. Here's how to add and use the state variable:
- Select the page's root widget in the Widget Tree.
- Open the page's state management settings and add a new field.
- Name the field
quantity, set its data type to Integer, and give it an initial value of1. - Select the Text widget that displays the quantity.
- Set its value from Page State > quantity.
To learn more about this workflow, see Creating a Page State.
4.2 Update the State Variable
Use actions to change quantity when a user selects the increase or decrease control:
- Select the increase control and add an On Tap action.
- Choose Update Page State, select
quantity, and set it to its current value plus1. - Select the decrease control and add another On Tap action.
- Update
quantityto its current value minus1. - Confirm that both controls update the Text widget bound to
quantity.
See the Action Flow Editor and Update Page State guides for more details.
5. Run the App
Use Test Mode to try the interaction and see changes quickly. Test Mode runs a web version of your app and can automatically sync changes from the FlutterFlow builder.
- Select Test Mode from the left-side menu.
- Wait for the test session to start.
- Click or tap the increase and decrease controls and confirm that the displayed quantity changes.
Run Mode creates a fully functional build that can include live data and be shared with project members. Because it creates a new build, it typically takes longer and does not support hot reload.
Congratulations! You've built your first app with FlutterFlow.
Verify the Result
Before moving on, confirm that:
- The initial quantity is displayed correctly.
- The increase control raises the quantity.
- The decrease control lowers the quantity.
- The layout remains aligned as the value changes.
- The interaction works in Test Mode.
Next Steps
Continue learning with these guides:
Need Help?
If you're experiencing any issues with the app, review the steps above and verify that each widget and action is configured as described.
For additional help, ask a question in the Community Forum or contact FlutterFlow Support.