# FlutterFlow Studio docs > These docs are for FlutterFlow Studio, the visual builder. They aren't for FlutterFlow, the app builder you use by describing your app, which has its own docs: https://docs.flutterflow.io/ffx/llms.txt # Getting Started with FlutterFlow Studio > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/ FlutterFlow Studio is a visual development environment that lets you build mobile, web, and desktop apps incredibly fast, without sacrificing on app quality or features. FlutterFlow Studio is a visual development environment that lets you build mobile, web, and desktop apps incredibly fast, without sacrificing on app quality or features. - [Build Your First App](https://docs.flutterflow.io/quickstart): Get started with FlutterFlow Studio by building your first FlutterFlow Studio app step-by-step. - [App Development Roadmap](https://docs.flutterflow.io/roadmap): Learn the three essential layers of app development: UI Layer, Logic Layer, and Data Layer for building FlutterFlow Studio applications. ### FlutterFlow Studio Tour - [FlutterFlow Studio Builder](https://docs.flutterflow.io/flutterflow-ui/dashboard): Explore the FlutterFlow Studio Builder interface, learn about the dashboard, widgets panel, and how to navigate the visual development environment. - [Building Blocks](https://docs.flutterflow.io/resources): Dive into the building blocks of the platform: projects, widgets, functions and more. ### Best Practices Essential guidelines and recommendations for building robust FlutterFlow Studio applications. Discover security best practices and performance optimization techniques to ensure your apps are production-ready, scalable, and maintainable. - [Secure your API Key](https://docs.flutterflow.io/best-practices/secure-api-keys): Learn best practices for keeping your API keys created in Google Cloud Console safe and secure in production applications. - [Test Your Apps Locally](https://docs.flutterflow.io/testing/local-run): Set up Local Run to debug and validate your app in physical devices. - [Naming Variables](https://docs.flutterflow.io/resources/style-guide): Learn FlutterFlow Studio naming conventions and best practices for variables, functions, and components to maintain clean, readable code. ### Scaling FlutterFlow Studio Apps Learn advanced techniques and strategies to scale your FlutterFlow Studio applications from simple prototypes to enterprise-grade solutions with native integrations and modular architecture. - [Integrating Native Plugins in FlutterFlow Studio](https://docs.flutterflow.io/concepts/advanced/method-channels): Extend FlutterFlow Studio's capabilities by integrating native platform plugins and custom functionality using method channels for advanced app development. - [Building Super Apps using Libraries](https://blog.flutterflow.io/scaling-super-apps-modular-architecture-with-flutterflow-libraries/): Discover how to create scalable, modular applications using FlutterFlow Studio libraries to build complex, maintainable super apps with independent feature libraries. ### Additional Tools Discover additional tools and references to enhance your FlutterFlow Studio development experience: - [System Requirements](https://docs.flutterflow.io/before-you-begin/setup-flutterflow): Ensure you meet system requirements required to smoothly run FlutterFlow Studio application on the web & desktop. - [What's New in FlutterFlow Studio](https://community.flutterflow.io/c/whats-new-in-flutterflow): Follow latest updates, features, and the latest enhancements in FlutterFlow Studio. ## Still Have Problems? If you're still experiencing issues or need additional help, here are some resources to get you back on track: - **[Submit Bug Report](https://docs.flutterflow.io/misc/submit-bug-report)** - Report bugs or issues you've encountered - **[Community Forum](https://community.flutterflow.io)** - Ask questions and get help from the community - **[Reddit Community](https://www.reddit.com/r/FlutterFlow/)** - Join discussions on Reddit - **[FlutterFlow Support](mailto:support@flutterflow.io)** - Get direct support from the FlutterFlow support team. # Quickstart Guide > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/quickstart Build your first interactive FlutterFlow Studio app by creating a layout, customizing its style, managing state, and testing the result. Welcome to the FlutterFlow Studio Quickstart Guide! This guide introduces the basic FlutterFlow Studio 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. :::note[Before You Begin] To complete this guide, you need: - A [**FlutterFlow Studio account**](https://app.flutterflow.io/). - A web browser. - About 15-20 minutes. ::: Below is a preview of what your completed app will look like: Quick start demo app ## 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](#clone-project) 2. [Build the UI](#build-ui) 3. [Customize styles](#customize-style) 4. [Manage state](#manage-state) 5. [Run the app](#run-app) ## 1. Clone the Starter Project {#clone-project} This guide uses a prepared starter app so you can focus on building the interaction. Open the [FlutterFlow Studio Quickstart project](https://app.flutterflow.io/project/f-f-quick-start-app-umu392), click **Clone**, and the project will be added to your account. To begin with a separate project instead, see [Create a Project](https://docs.flutterflow.io/resources/projects/how-to-create-find-organize-projects#how-to-create-a-project). ![clone-project.avif](https://docs.flutterflow.io/assets/images/clone-project-994b7d019a46e8a06e35911a126d24d2.avif) 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. ![final-quick-start.avif](https://docs.flutterflow.io/assets/images/final-quick-start-f218dc46f227c5d088a7541ac6b6dddc.avif) ## 2. Build the UI {#build-ui} Build the quantity control by combining layout and display widgets in the product page's Widget Tree. 1. Open the product page and locate the content below the product description. 2. Add a **Container** to hold the quantity control. 3. Add a **Row** inside the Container. 4. Add a **Text** widget for the "Quantity" label. 5. Add controls for decreasing the quantity, displaying its current value, and increasing it. 6. Arrange the widgets so the label appears on the left and the quantity controls appear on the right.
:::note To learn more, see [**Building Layouts**](https://docs.flutterflow.io/concepts/layouts) and the [**Widget Overview**](https://docs.flutterflow.io/resources/ui/widgets). ::: ## 3. Customize Styles {#customize-style} Next, style the quantity control to match the rest of the product page. Use the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) to adjust each selected widget. 1. Adjust the spacing and alignment of the Row. 2. Select the Container that holds the quantity control and adjust its background color, padding, size, and corner radius. 3. Style the "Quantity" label and value so they are easy to read. 4. Customize the decrease and increase controls with suitable icons, colors, and sizes. 5. Compare the result with the completed preview and make any final visual adjustments.
## 4. Manage State {#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](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle) that will hold the current quantity value. Here's how to add and use the state variable: 1. Select the page's root widget in the Widget Tree. 2. Open the page's state management settings and add a new field. 3. Name the field `quantity`, set its data type to **Integer**, and give it an initial value of `1`. 4. Select the Text widget that displays the quantity. 5. Set its value from **Page State > quantity**. :::note To learn more about this workflow, see [**Creating a Page State**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#creating-a-page-state). :::
### 4.2 Update the State Variable Use actions to change `quantity` when a user selects the increase or decrease control: 1. Select the increase control and add an **On Tap** action. 2. Choose **Update Page State**, select `quantity`, and set it to its current value plus `1`. 3. Select the decrease control and add another **On Tap** action. 4. Update `quantity` to its current value minus `1`. 5. Confirm that both controls update the Text widget bound to `quantity`. :::note See the [**Action Flow Editor**](https://docs.flutterflow.io/resources/functions/action-flow-editor) and [**Update Page State**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#update-page-state-action) guides for more details. :::
## 5. Run the App {#run-app} Use [**Test Mode**](https://docs.flutterflow.io/testing/run-your-app#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 Studio builder. 1. Select **Test Mode** from the left-side menu. 2. Wait for the test session to start. 3. Click or tap the increase and decrease controls and confirm that the displayed quantity changes. [**Run Mode**](https://docs.flutterflow.io/testing/run-your-app#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 Studio. ## 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: - [Building Layouts](https://docs.flutterflow.io/concepts/layouts) - [Widget Overview](https://docs.flutterflow.io/resources/ui/widgets) - [Page State](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#page-state) - [Action Flow Editor](https://docs.flutterflow.io/resources/functions/action-flow-editor) - [Run and Test Your App](https://docs.flutterflow.io/testing/run-your-app) ## 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](https://community.flutterflow.io/) or contact FlutterFlow Support. # Roadmap > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/roadmap This roadmap guides you through the key layers of app development: the UI Layer, Logic Layer, and Data Layer. Understanding these layers is essential for creating apps that are visually appealing, functionally robust, and secure. This roadmap guides you through the key layers of app development: the **UI Layer, Logic Layer,** and **Data Layer**. Understanding these layers is essential for creating apps that are visually appealing, functionally robust, and secure. ![layers.avif](https://docs.flutterflow.io/assets/images/layers-aea5e7fd1325b59a7152ec28570b56bc.avif) ## UI Layer The UI Layer is all about the visual elements and interactions in your app. It includes widgets for buttons, forms, navigation, and layouts. In FlutterFlow Studio, this layer also covers customization options like themes and responsive design, ensuring your app looks great and is easy to use. - **FlutterFlow Studio Widgets:** - [Atomic Design](https://docs.flutterflow.io/resources/ui/overview) - [Pages](https://docs.flutterflow.io/resources/ui/pages), [Widget](https://docs.flutterflow.io/resources/ui/widgets) & [Components](https://docs.flutterflow.io/resources/ui/components) - [TextFields](https://docs.flutterflow.io/resources/forms/textfield) & [Other Form Widgets](https://docs.flutterflow.io/resources/forms) - **Navigation Elements:** - [Page Transitions (Slide, Fade, etc.)](https://docs.flutterflow.io/concepts/animations/page-transition) - [AppBar and other Page Elements](https://docs.flutterflow.io/resources/ui/pages/scaffold) - [Bottom Sheets](https://docs.flutterflow.io/concepts/navigation/bottom-sheet) - [Webviews](https://docs.flutterflow.io/concepts/navigation/webview) - **User Experience (UX):** - [Design System](https://docs.flutterflow.io/concepts/design-system) - [Responsiveness](https://docs.flutterflow.io/concepts/layouts/responsive) - Interaction Feedback - [Animations](https://docs.flutterflow.io/concepts/animations) - [Haptic Feedback](https://docs.flutterflow.io/concepts/alerts/haptic-feedback) ## Logic Layer The Logic Layer handles your app's business logic and decision-making. This includes state management, conditional actions, and navigation logic. - **State Management:** - Representing Data - [Variables](https://docs.flutterflow.io/resources/data-representation/variables) - [Datatypes](https://docs.flutterflow.io/resources/data-representation/data-types) & [Custom Data Types](https://docs.flutterflow.io/resources/data-representation/custom-data-types) - [Enums](https://docs.flutterflow.io/resources/data-representation/enums) - [Constants](https://docs.flutterflow.io/resources/data-representation/constants) - [State Variables](https://docs.flutterflow.io/concepts/state-management) - [Managing Widget States](https://docs.flutterflow.io/concepts/state-management/widget-state) - Dynamic Lists [(Generating Dynamic Children)](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/generate-dynamic-children) - **Actions & Business Logic:** - [Actions](https://docs.flutterflow.io/resources/functions/action-flow-editor) - [Conditional Actions](https://docs.flutterflow.io/resources/functions/conditional-logic) - [Custom Code](https://docs.flutterflow.io/concepts/custom-code) - [Form Validation Logic](https://docs.flutterflow.io/resources/forms/form-validation) - **Navigation Logic:** - [Navigation & Routing](https://docs.flutterflow.io/concepts/navigation/overview) - [Deep & Dynamic Linking](https://docs.flutterflow.io/concepts/navigation/deep-dynamic-linking) - **Notification Systems**: - [Triggering Push Notifications](https://docs.flutterflow.io/concepts/notifications/push-notifications) - [Alert Dialogs](https://docs.flutterflow.io/concepts/alerts/alert-dialog) ## Data Layer The Data Layer manages data storage, retrieval, and integration with external sources like APIs and databases. - **Authentication:** - [Auth Methods Overview](https://docs.flutterflow.io/integrations/authentication-methods) - [Firebase or Supabase or Custom Authentication](https://docs.flutterflow.io/integrations/authentication-types) - **Database Integration:** - [Firebase](https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started) or [Supabase](https://docs.flutterflow.io/integrations/database/supabase/database-actions) integration. - Local Storage with [AppState](https://docs.flutterflow.io/resources/data-representation/app-state) or [SQLite DB](https://docs.flutterflow.io/integrations/database/sqlite) - **API Integration:** - Working with [REST APIs](https://docs.flutterflow.io/resources/backend-logic/create-test-api) - [Streaming APIs](https://docs.flutterflow.io/resources/backend-logic/streaming-api) # App Development > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/before-you-begin/app-architecture Before you jump in and start using FlutterFlow Studio, it's helpful to have an idea of how app development works more broadly. Before you jump in and start using FlutterFlow Studio, it's helpful to have an idea of how app development works more broadly. Traditionally, developing an app required writing a lot of code. You can think of code as a set of instructions for the computer, or device, executing the code. The codebase is usually divided up into two pieces: instructions for the frontend, and instructions for the backend. # Frontend vs Backend Frontend development deals with creating the parts of an application that users interact with directly. This includes: - Defining the visual pieces of your app, like text or buttons - Figuring out how these pieces should be laid out on the screen - Setting up logic for how your app should react to retrieved data and user interactions Backend usually refers to more complex logic and data storage. This includes: - Setting up a database that is capable of storing, sending and retrieving data - Leveraging off-the-shelf services, like authentication providers or payment platforms - Defining business logic, either by writing code or using a low-code tool The interaction between frontend and backend often occurs through APIs (Application Programming Interfaces). In most cases, the backend exposes endpoints for the frontend to send requests to. The backend handles the request, and sends some data back in response - which the frontend can use to change its visual appearance. # Where does the code execute? Backend code runs on a server, which could be located in a data center or hosted on a cloud platform like AWS, Google Cloud, or Azure. The server is responsible for handling requests, processing data, and sending responses back to the frontend. Frontend code runs on the user's device. This could be a web browser for web applications or the operating system for mobile applications. The frontend code is responsible for displaying the user interface and handling user interactions. # Frontend architecture When it comes to developing the frontend of your application, there are several key architectural patterns and best practices to consider. These include: - **Component-Based Architecture:** Breaking down the UI into reusable components, each responsible for a specific part of the interface. This makes the code more modular and easier to maintain. - **State Management:** Managing the state of the application, which includes the data displayed in the UI and the user's interactions. - **Responsive Design:** Ensuring that your application looks and works well on different screen sizes and orientations. This involves using flexible layouts and scalable assets. - **Performance Optimization:** Making sure your app runs smoothly by optimizing rendering, minimizing the number of network requests, and reducing the size of your assets. By understanding these concepts and implementing best practices, you can create robust and user-friendly applications with FlutterFlow Studio. # Create an account > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/before-you-begin/setup-flutterflow Ensure you meet system requirements and grasp technical concepts for smooth building in FlutterFlow Studio. Create your free account to get started with FlutterFlow Studio. After you've set up your account, you'll be able to create as many projects as you like. You can [**sign up**](https://app.flutterflow.io/create-account) via Apple, Google, or Github. ## System Requirements The FlutterFlow Studio application can be accessed from your browser or installed as a desktop app. ### General recommendations: - Use a screen that is at least **1280 x 1024** ### Browser recommendations: - FlutterFlow Studio works best on **Google Chrome** - We recommend keeping your browser up-to-date, specifically within the latest two versions - You should allow pop-up and redirects and ClipBoard from _app.flutterflow.io_. ### Desktop recommendations: - **macOS**: While FlutterFlow Studio should work on 10.13 or higher, we recommend using 13 or higher - **Windows**: While FlutterFlow Studio should work on 7 or higher, we recommend using 10 or higher :::note Some Windows users may experience a crash. To fix this, install the [**Microsoft Visual C++ 2015–2022 Redistributable (both x64 and x86)**](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) from the official Microsoft site. ::: On macOS and iPad, the app is named **FlutterFlow Studio**. For details on target platform system requirements, please see the [Flutter documentation](https://docs.flutter.dev/reference/supported-platforms). ### Desktop vs Web: We recommend using the desktop application for improved performance and access to features like [**local run**](https://docs.flutterflow.io/testing/local-run). However, our desktop applications are currently in a preview phase, which may result in some instability. ## Update the Desktop App When a new version is available, the desktop app shows a small note in the bottom-right corner of the dashboard and the editor. The note reads **Update available** and names the version. It doesn't block your work. Select **Update** to install the new version. Select the **More update options** button (⋮) next to it for more choices: - **Remind me tomorrow**: Hides the note for a day on this computer. - **Skip version x.y.z**: Hides the note until a newer version is released. - **Turn on automatic updates** or **Turn off automatic updates** (macOS only): When automatic updates are on, updates install when you quit the app. ### Update on macOS When you select **Update**, the note shows a progress bar while the app downloads the new version. You can keep working during the download. When the download finishes, the note reads **Update ready**. Select **Restart** to install the update and reopen FlutterFlow Studio on the new version. If you quit the app instead, the update installs when it closes. With automatic updates on, the app downloads updates in the background and shows **Update ready** when one is ready. The **More update options** menu then offers **Install when I quit**. If the app can't update itself, the note reads **Couldn't install the update**. Select **Try again**, or open the **More update options** menu and select **Download installer** to install the new version manually. If the app is running from outside the Applications folder, such as from a disk image or your Downloads folder, the note reads **Move it to Applications**. Select **Get installer**, or move the app to the Applications folder and update again. ### Update on Windows When you select **Update**, the app opens the updater in a separate window, and the note reads **Finish in the updater**. Follow the updater's prompts. The installer runs without setup pages, FlutterFlow Studio quits, and the installer reopens it on the new version. To bring the updater window back, select **Open updater**. ### Check for Updates To check for an update yourself: - **macOS**: Choose **Check for Updates…** in the FlutterFlow Studio menu in the menu bar. The menu also has **Turn On Automatic Updates** or **Turn Off Automatic Updates**. - **Windows**: In the editor, open the project menu and select **Check for Updates**, or open your account menu and select **Check for updates**. The note shows the result: **Checking for updates**, then the available update, **Update ready**, **You're up to date**, or **Couldn't check for updates**. If the check fails, select **Try again**. ### Required Updates Some updates are required, such as critical updates or updates for a version that's too old. A required update opens a dialog that blocks the app until you update. On macOS, the dialog shows download progress and restarts the app as soon as the download finishes. On Windows, the dialog opens the updater, as **Update** does from the note. ## Open Links in the Desktop App On macOS and Windows, the desktop app can open FlutterFlow Studio links directly to a specific project page, settings tab, or dashboard view. A link can come from a chat message, a ticket, or the address bar of the web app. The desktop app accepts these kinds of links: - A `flutterflow://` link, such as `flutterflow://project/PROJECT_ID?tab=uiBuilder`. When you select one, your operating system opens it in the desktop app. - A link copied from the FlutterFlow Studio web app. If the link points to the project that's already open, the desktop app switches to the linked view without reloading the project. Otherwise, it opens the project at that view. ### Open a Link You've Copied To open a copied link in the desktop app, follow these steps: 1. In a project, open the Command Palette by pressing **Command + K** on macOS or **Ctrl + K** on Windows, and then select **Open FlutterFlow Studio Link**. On macOS, you can also choose **File > Open FlutterFlow Studio Link…** or press **Command + Shift + O**. 2. Paste the link, and then select **Open**. If the link doesn't point to a supported FlutterFlow Studio view, the dialog shows an error.

### Copy a Link to the Current View In Desktop App, to share the view you're working on, open the Command Palette and select **Copy Desktop Link to Current View**. FlutterFlow Studio copies a `flutterflow://` link that opens the same project, tab, and page or component in the desktop app. Copy a desktop link to the current view ### Open Web Links in the Desktop App Automatically By default, project links open in the browser. To open them in the desktop app instead, follow these steps: 1. In the web app, go to your **My Account** page. 2. Under **Desktop Application**, turn on **Open in desktop app**. If your account page shows choices instead of a switch, select **Desktop app**. When this setting is on and you open a project link in a new browser tab, the desktop app opens at the linked view. The first time, your browser might ask for permission to open the FlutterFlow Studio desktop app. The browser tab shows **Link opened in the FlutterFlow Studio desktop app**. To load the project in the browser instead, select **Open here instead**. :::note - The desktop app must be installed. This setting applies only to links opened from the web app. - This setting applies only when you open a project link in a new browser tab. Navigating to a project from inside the web app, such as from the dashboard, stays in the browser. To keep a single link in the browser, add `?noRedirect=1` to the URL. If the URL already has query parameters, add `&noRedirect=1` instead. :::

# Dashboard > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-ui/dashboard Explore the dashboard in FlutterFlow Studio, a centralized location for managing projects and your account. When you log in to FlutterFlow Studio, the first page you’ll see is the **Dashboard**. It serves as a central hub for managing your projects, including creating, searching for, deleting, and duplicating projects. The Dashboard also lets you choose your preferred theme—dark or light—for a more comfortable viewing experience. The Dashboard provides convenient access to organizational resources, facilitating seamless collaboration among team members. It also integrates with a marketplace where users can browse and download widgets, templates, and plugins. You can also find links to various resources to help you build apps with FlutterFlow Studio. Your account information and plan details are easily accessible from this page as well. ![dashboard](https://docs.flutterflow.io/assets/images/dashboard-6259117ba315654d5e29a9450fc01022.avif) - **Projects**: Projects section displays all the projects you have created in FlutterFlow Studio. Use the overflow menu to rename, duplicate, delete, leave the project, add tags, and open the project in a new browser tab. :::note When you duplicate a project with Firebase configured, you must delete the config files in the duplicated project and initiate a new [**Firebase setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for it. ::: - **Notification Center**: The Notification Center simplifies how you manage comments and invites across projects. It centralizes all your project communications. When you're ready to address a comment, select it to go directly to the relevant section of the project. - **Dark/Light Mode**: The Dark/Light Mode option allows you to choose between a light and dark color scheme for the app builder. - **View Options**: Switch between **List View** and **Grid View** to choose how projects are displayed on the Dashboard. Grid View displays projects as tiles for visual browsing, while List View provides a compact layout for quickly scanning your projects. - **Search**: This option allows you to search for your projects. - **Filter Projects**: Filter projects by privacy setting: private, shared by you, or shared with you. - **Tag Projects**: You can create and add a tag to projects, providing a quick and organized way to classify and identify projects based on their characteristics, purpose, or status. For detailed steps, see [Creating and Managing Tags](https://docs.flutterflow.io/resources/projects/how-to-create-find-organize-projects#create-and-add-tags-to-projects). - **Create a New Project**: To create a new project, use the **+ Create New** button. Learn more about [creating a new project](https://docs.flutterflow.io/resources/projects/how-to-create-find-organize-projects#how-to-create-a-project). - From **My Teams** section, you can share custom code, assets, design systems, and APIs among team members and across projects. - **Marketplace**: Use the [**FlutterFlow Marketplace**](https://docs.flutterflow.io/marketplace) to access prebuilt components and templates created by other users and add new functionality to your app. - **Resources**: From the **Resources tab**, you can find various useful links that can help you build apps on FlutterFlow Studio. [Video tutorials](https://www.youtube.com/@FlutterFlow/videos) are extremely helpful for learning about concepts visually. - **Community**: The **Community tab** redirects you to our [Community Forum](https://community.flutterflow.io/home), a place for you to share ideas, ask questions, and troubleshoot issues with other FlutterFlow Studio builders. The community shares a lot of amazing ideas! :::caution[Creating a Forum Account] - When you select the [**Community**](https://app.flutterflow.io/community) tab, FlutterFlow Studio automatically creates a forum account and redirects you to the Community Forum. To add a password to your forum account, go to the forum [**settings**](https://community.flutterflow.io/settings/account) and select **Forgot Password**. - Additionally, make sure your FlutterFlow Studio profile includes a name. The same name will be used for the community forum profile. ::: :::note[Who Can Sign In to the Community] To sign in to the Community, your account must meet these requirements: - Your email address is verified. - Your email address isn't a temporary or disposable address. Accounts with a disposable address can't sign in to the Community. - Your account is at least a few days old, and you have spent some time building a project in FlutterFlow. If your account doesn't meet a requirement, selecting **Community** shows a message that explains why, instead of opening the forum. If your account is new or you haven't built much yet, keep building in your project and try again later. Accounts created before September 1, 2026 only need a verified email address that isn't disposable. After your account qualifies, it stays qualified. ::: - **URL Access (Only Available for Enterprise Users)**: You can view and copy URLs that need to be whitelisted for FlutterFlow Studio to function correctly in enterprise environments with restricted internet access. See **[Whitelisting URLs](https://docs.flutterflow.io/misc/enterprise#whitelist-urls)** for more information. ![url-access](https://docs.flutterflow.io/assets/images/url-access-dashboard-c7344917b601031042084edb5dee953c.avif) - **Account**: This is helpful if you want to look at your account information, upload a profile picture, reset your password, see your referrals, or delete your account. - **Log Out**: Safely log out from your FlutterFlow Studio account. # App Builder > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-ui/builder Explore the App Builder in FlutterFlow Studio, featuring a comprehensive interface with four main sections-Navigation Menu, Toolbar, Canvas, and Properties Panel. On opening the project, you'll see the App Builder, which consists of four main sections: [Navigation Menu](#navigation-menu), [Toolbar](#toolbar), [Canvas](#canvas-area), and [Properties Panel](#properties-panel). ![App Builder](https://docs.flutterflow.io/assets/images/navigation-menu-74bb7c08ba58382777ca2616d4fb3699.avif) ## Classic and New Builder FlutterFlow Studio has two versions of the App Builder and the dashboard: the classic UI and the new UI. The new UI switches the dashboard and the builder together. Your choice is saved to your account and applies to all your projects and devices. Accounts created on or after October 27, 2026 open projects in the new builder. Other accounts stay in the classic UI until you switch. ### Try the New UI {#try-the-new-builder} If you have an existing account and haven't chosen a UI, the classic dashboard shows a dialog once with screenshots of the new dashboard and builder. You can choose one of these options: - Click **Switch to the new UI** to switch. FlutterFlow Studio opens the new dashboard, and the first project you open starts a tour of the new builder. - Click **Not now** or close the dialog to stay in the classic UI. FlutterFlow Studio doesn't show this dialog again. If you use the new dashboard without having chosen the new UI, the classic builder can show a similar prompt the first time you open a project. Click **Switch to new builder** to switch and continue to a short tour, or click **Keep classic builder** to stay. You see only one of these prompts. ### Switch UIs {#switch-builders} You can switch at any time. To switch from the classic UI to the new UI, use one of these options: - Open the project menu and click **Switch to New UI**. - Open **App Settings** and click the **Try the new builder** card at the top of the settings list. - Open your account page and turn on the **New UI** switch. To switch from the new UI to the classic UI, use one of these options: - Open the project menu and click **Switch to Classic UI**. - Open your account page, and in the **New UI** section, click **Off**. :::tip To replay the tour of the new builder, open the project menu and click **New Builder Tour**. :::

## Navigation Menu The Navigation Menu, located on the left side of the builder, allows you to switch between various FlutterFlow Studio features. These include designing the UI, managing databases, setting up API, adjusting app settings, adding integrations, and more. Here is a list of all the features accessible from the navigation menu: 1. **Dashboard**: Manage projects, access account info, and FlutterFlow Studio resources. 2. **Widget Palette**: Access all widgets for your app. 3. **Page Selector**: Manage pages, components, and custom code files, and organize them using folders. Custom functions, widgets, and actions with analyzer errors show a red (error) or amber (warning) marker in the list. Hover over the marker to read the message. After you click in the list, use the keyboard to move through it: **Up** and **Down** move between rows, **Right** expands a folder, **Left** collapses it or moves to the parent folder, **Home** and **End** go to the first and last rows, **Enter** or **Space** opens a row, and **Esc** releases focus. 4. **Widget Tree**: Get an overview of all widgets on a selected page. 5. **Storyboard**: Visualize app's design and navigation. 6. **Search**: Search across your project and filter results by Data, Design, State, Code, or Pages & Components. 7. **Test Mode**: [Test your app](https://docs.flutterflow.io/testing/run-your-app#test-mode) in a live debugging environment. 8. **Firestore**: Create collections and adjust Firestore-related settings. 9. **Data Types**: Create custom data types for your app. 10. **App Values**: Manage [App State variables](https://docs.flutterflow.io/resources/data-representation/app-state) and Constants. 11. **API Calls**: Define API calls. 12. **Media Assets**: Upload assets for your app and team. 13. **Cloud Functions**: Write and deploy cloud functions for Firebase. 14. **Tests**: Add automated tests. 15. **Agents**: Create, configure, and manage [AI Agents](https://docs.flutterflow.io/integrations/ai-agents) to integrate conversational AI interactions into your app. 16. **App Events**: Define and manage [App Events](https://docs.flutterflow.io/concepts/app-events) that allow different parts of your app to communicate without being directly connected. 17. **Theme settings**: Customize visual appearance. 18. **Settings and Integrations**: Access app-related settings and integrations. ## ToolBar From [ToolBar](https://docs.flutterflow.io/flutterflow-ui/toolbar), you can search for project resources, change canvas size, see project history, branching, optimization and enhancements, view-download code, and run your app. ## Canvas Area In the [Canvas Area](https://docs.flutterflow.io/flutterflow-ui/canvas), you can see a preview of a device's screen and build your app page. ## Properties Panel The Properties Panel lets you modify both the visual appearance and interactive behavior of UI elements on the canvas. It allows you to add [Actions](https://docs.flutterflow.io/resources/functions/action-flow-editor), set up a [Backend Query](https://docs.flutterflow.io/resources/backend-query), add [Animations](https://docs.flutterflow.io/concepts/animations) and more. The Properties Panel will vary slightly depending on the entity you have selected. To explore the details of each Properties Panel, click on the following: - **[Page Properties](https://docs.flutterflow.io/resources/ui/pages/properties)** (when you have selected a Page) - **[Widget Properties](https://docs.flutterflow.io/resources/ui/widgets/properties)** (when you have selected any widget, including built-in components) # Toolbar > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-ui/toolbar Learn how to use the FlutterFlow Studio Toolbar to access project management, version control, help, testing, and development tools. The Toolbar, located at the top of the app builder, provides easy access to numerous tools and features. It includes options for project configuration, undoing and redoing changes, saving versions of your app, accessing help, reporting or debugging issues, viewing project comments, downloading your app code, and running your app directly in FlutterFlow Studio. ![toolbar](https://docs.flutterflow.io/assets/images/toolbar-389715779718e03169d96c888c03305d.avif) ## Project Info Click on the project info to view the project name, branch, environment, FlutterFlow Studio version and release date, and the Flutter version used by the project. ## Undo and Redo Changes Use the **Undo** and **Redo** arrows beside the project info to move backward or forward through your recent edits. You can also press **Cmd + Z** to undo or **Shift + Cmd + Z** to redo. If you are unsure which change to undo or redo, right-click an arrow to open the change history. Each state has a short description of the edit, so you can review the list and select the exact state you want to return to.
![Undo and redo arrows with the Edit History menu showing recent changes.](https://docs.flutterflow.io/assets/images/undo-redo-edit-history-35867a7fe033ec0d045c523b66dcf6c6.png)
## Help Menu From here, you can access essential resource links that can help you while building your app. 1. **Search Docs**: Paid users can search the FlutterFlow Studio documentation directly from the builder. 2. **Community Forum**: Visit the [Community Forum](https://community.flutterflow.io/) to participate in discussions, share knowledge, and collaborate with other FlutterFlow Studio users. 3. **Feedback**: You can provide feedback and help us improve the product. 4. **Bug Report**: You can submit a bug report from here. 5. **Generate Bug Report Code**: Click this option to generate a unique code that helps the FlutterFlow team assess and troubleshoot your issue. Include this code when submitting a bug report. 6. **Tutorials**: You can start the tutorial for building your first app directly in FlutterFlow Studio. 7. **FAQs and Docs**: While building your app, you might need to consult our official documentation frequently. This option opens the FlutterFlow Studio documentation. 8. **What's New?**: View the latest FlutterFlow Studio features, improvements, and product updates. In the [new builder](https://docs.flutterflow.io/flutterflow-ui/builder#classic-and-new-builder), **What's New** is a top-level item in the project menu instead of in the Help menu. 9. **Current Status/Known Issues**: View FlutterFlow Studio's current system status and any known issues. 10. **Show/Hide Chat**: You can use this option to show or hide the chat button at the bottom right of the app builder. ## Keyboard Shortcuts With keyboard shortcuts, you can perform common actions related to widgets and run your project in Test Mode or Run Mode with just a few keystrokes, saving you time and effort. Select this option to see all the shortcuts. For example, press **Option/Alt + 1** to **4** to switch the Page Selector filter between **All**, **Pages**, **Components**, and **Custom Code**. ![keyboard-shortcuts.avif](https://docs.flutterflow.io/assets/images/keyboard-shortcuts-44a1ba8b277b35d1a7164217833fbfc9.avif) ## Command Palette Open the Command Palette by selecting the search button or pressing **Cmd/Ctrl + K**. Search for an item, then select the right arrow to see where it is used. Select a result to open it directly. ![command-palette.avif](https://docs.flutterflow.io/assets/images/command-palette-e3cd96697f631d56997e0646a0950a4c.avif) In the desktop app, the Command Palette also includes **Open FlutterFlow Studio Link** and **Copy Desktop Link to Current View**. For details, see [Open Links in the Desktop App](https://docs.flutterflow.io/before-you-begin/setup-flutterflow#open-links-in-the-desktop-app). ## AI Agent [AI Agent](https://docs.flutterflow.io/concepts/ai-agent) lets you work with AI coding agents directly from the FlutterFlow Studio desktop app. It is helpful for making project updates with natural-language prompts, such as creating pages, adjusting widgets, wiring actions, or reviewing your project structure. ## AI Generation History The **AI Generation History** panel lets you track the status of your AI-generated items. It provides a list of all previously generated pages and components, and you can easily preview them in the panel. ## Project Comments Project Comments let you leave thoughts, questions, or feedback on a specific widget for your project team or client. While adding a comment, you can tag users, and they will be able to respond, creating a thread of conversation. :::note To tag users, select the **@** symbol and choose the project team member(s). ::: ## Project Suggestions Project Suggestions identifies opportunities to improve your app's design and performance. **Optimizations**: This identifies elements that may slow down your app, such as queries on columns, unused or duplicate backend queries, and widgets with unbounded sizes. **UI Enhancements**: This provides tips for creating a more visually appealing and user-friendly design, such as increasing the size of a widget's tap target. :::note You can control which types of suggestions you receive by selecting the settings icon on the right. ::: ![optimizations-UI-enhancements.avif](https://docs.flutterflow.io/assets/images/optimizations-UI-enhancements-c22c98b3aedf1373eac8dff13f47df86.avif) ## Project Issues This section displays errors and warnings that may cause build failures or app crashes. Select an issue to view its description and navigate to the relevant location in your project. :::tip[Errors vs Warnings] **Errors** prevent your app from compiling and running. These must be resolved in order to run the app. They can be due to missing actions, errors in custom code, incorrect data types, and so on. **Warnings**, while not preventing compilation, indicate potential issues such as incorrect rule configuration or performance problems. Although it's possible to ignore warnings, addressing them can enhance the quality of your app and prevent future issues. ::: ![warnings-errors.avif](https://docs.flutterflow.io/assets/images/warnings-errors-4f6ae376c05b81d4a4a413c2e9f9ddbc.avif) ## Version Control **Version Control** is a system that tracks changes to your project's files over time, allowing you to revert to previous states if needed. In FlutterFlow Studio, you can use [Branching](https://docs.flutterflow.io/collaboration/branching) to create a separate copy of your project to build or test features without affecting the main version. ## Developer Menu The Developer Menu provides access to tools such as code viewing, GitHub integration, and source code download capabilities. 1. **View Code**: This option lets you view the *Dart* code for all the pages of your FlutterFlow Studio project. You can also view the dependencies used by the app here. 2. **Connect GitHub Repo**: You can use this option to connect your project to a [GitHub](https://github.com/) repository and upload its code. See [Connect a GitHub Repository](https://docs.flutterflow.io/exporting/push-to-github#connect-a-github-repo) for step-by-step instructions. 3. **Download Code**: You can download the entire codebase of the app generated by FlutterFlow Studio using this option. If your project has errors, or custom code changed since it was last checked, a **Download code?** dialog appears before the download starts. It shows how many errors your project has and names up to five custom code items with errors. If custom code changed since its last check, the dialog also offers **Check custom code**, which checks the code instead of downloading. Select **Download anyway** to continue with the download, or **Cancel** to stop. If the download fails, FlutterFlow shows the build error instead of the success message. 4. **Download APK**: Use this to generate a release build of your Android app. It will automatically download the `.apk` file after the build is complete. 5. **FlutterFlow CLI**: You can also download the code using *[FlutterFlow CLI](https://pub.dev/packages/flutterflow_cli)*. See instructions [here](https://docs.flutterflow.io/flutterflow-cli/exporting). :::note _Connect GitHub Repo_, _Download Code_, and _Download APK_ features require a [**paid plan**](https://flutterflow.io/pricing). ::: 6. **Open in VSCode**: This option lets you open your entire FlutterFlow Studio project in a VS Code environment, offering a richer development experience. You’ll have real-time autocomplete and error detection, easier access to existing Flutter and Dart tooling, and the ability to leverage the AI ecosystem. 7. **Refactor Project**: This option opens your FlutterFlow Studio project in a YAML-based file editor, allowing you to perform bulk edits more efficiently. You can search, edit, and replace values across multiple files—useful for renaming keys, updating data types, or migrating resources to a Library. Check out the [**Refactor Project**](https://docs.flutterflow.io/resources/projects/refactor-project) documentation for more details. ## Share Project You can make a project public so that others can view and clone your project. Before sharing your project, make sure to remove any sensitive information. :::note - You can only share projects where you are the owner. - The share feature can be used to create Marketplace items. See [**FlutterFlow Marketplace**](https://docs.flutterflow.io/marketplace) for more information. ::: ## Preview App You can use this option to run your app in [Preview mode](https://docs.flutterflow.io/testing/run-your-app#preview-mode). ## Test Mode Use this menu to run your app in [Test Mode](https://docs.flutterflow.io/testing/run-your-app#test-mode) or [Run Mode](https://docs.flutterflow.io/testing/run-your-app#run-mode). # Canvas > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-ui/canvas Dive into the versatile Canvas in FlutterFlow Studio, where you can effortlessly design and preview your app’s interface. The Canvas shows the selected device screen, such as mobile, tablet, web, or desktop. It allows you to add widgets via drag-and-drop. You can select, move, and position widgets anywhere on the Canvas. The Canvas also includes zoom controls, light and dark previews, multi-language preview, App Bar and Nav Bar controls, text size simulation, and more. ![canvas area](https://docs.flutterflow.io/assets/images/canvas-2b5295cce5fbb47f5e7219a154f7d607.avif) ## Show or Hide Navigation Menu From here, you can open or close the [Navigation Menu](https://docs.flutterflow.io/flutterflow-ui/builder#navigation-menu). ## Zoom Controls There are zoom in (+) and zoom out (-) buttons to control the zoom level of the Canvas. While working on complex UI designs, this comes in handy when you want to zoom in on a specific area or zoom out for an overview. Next to the zoom buttons, click **Fit device to canvas** to zoom so the whole device fits in the Canvas. While this toggle is on, the zoom label reads **Fit**, and the device stays fitted when you change the device, its orientation, or its posture, or when you resize the window. To turn it off, click the toggle again. ## Preview Screen The Preview Screen is where you build the UI for the selected device. You can customize the screen by adding widgets using drag and drop from the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette) and by applying properties from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel). ## Set Preview Screen Size Use the device picker at the top of the Canvas, after the zoom controls, to preview your app at different dimensions. The picker shows the name of the selected device and its screen resolution in physical pixels. Click it to open a menu of devices, and then select one to test how your layout responds at that screen size. The menu includes the following: - **Search devices...**: Type to filter the list. Each word you type must match the device name, brand, year, or size, so `pixel 9 pro` lists only matching Pixel devices. Use the arrow keys to move through the list. - **Frequently used**: The devices you select most often. To remove a device from this section, hover over it and click the remove button. The device remains available in its device category. - **Phones**, **Foldables**, **Tablets**, and **Desktop**: Devices grouped by type, with the newest devices listed first. The devices include recent iPhones, Pixels, and Galaxy foldables, and the iPhone Duo. - **Custom size (px)**: Enter the desired width and height, and then click **Apply**. Next to the device picker are the following controls: - **Rotate to landscape** or **Rotate to portrait**: Rotates the preview. This button isn't available for desktop devices or when you edit a component. - **Closed**, **Half-open**, and **Open**: For a foldable device, switch between folded, half-open, and open states. **Half-open** appears only when that state differs visually from **Open**, such as on the iPhone Duo. The device frame shows the device's side buttons, camera cutout, and safe areas. A custom size has no device frame.

## Add App Bar From here, you can add an [App Bar](https://docs.flutterflow.io/resources/ui/pages/scaffold#appbar) to your page. Clicking this button opens a popup displaying different App Bar styles for you to choose from. Select an App Bar style from the list, and it will appear in the Preview Screen. ![appbar-style.avif](https://docs.flutterflow.io/assets/images/appbar-style-69cc04345c9bf715e4889aafb113b01d.avif) ## Save Screenshot Click the **Save Screenshot** camera icon beside the Preview Screen to save an image of the current preview. ## Designer Import/Export Use this menu to copy screens between FlutterFlow Studio and FlutterFlow Designer. - **Export to Designer:** Copy pages from your FlutterFlow Studio project into Designer, where you can explore new styles and continue refining the layouts. See [Import from FlutterFlow Studio](https://docs.flutterflow.io/designer/import) for detailed instructions. - **Paste from Designer:** Copy designs from Designer into your FlutterFlow Studio project. In Designer, use **Export to FlutterFlow Studio** to copy the frames, then select **Paste from Designer** on the Canvas. See [Export from Designer](https://docs.flutterflow.io/designer/export#export-options) for more information. ## Dark/Light Mode Use this toggle to switch your app preview between light and dark mode, so you can ensure your design looks great in both modes. This feature is only available if you've enabled dark mode support in your project. ## Builder Settings Builder Settings let you adjust how the FlutterFlow Studio builder, Canvas, preview screen, and Property Panel behave while you design. ![builder-settings](https://docs.flutterflow.io/assets/images/builder-settings-5d1f3329679f6d47bcee8981a5e130f3.avif) ### Platform Settings #### Set Builder to Dark Mode Use this option to switch the FlutterFlow Studio builder between light and dark mode. This changes the appearance of the FlutterFlow Studio platform, not the theme of your app.
### Canvas Settings #### Enable Snapping Enable snapping to make widget width and height snap to multiples of the specified value while resizing. This helps keep widget sizes consistent as you adjust layouts on the Canvas.
#### Show Resize Bars Show resize bars to display handles on the right and bottom sides of the preview screen. You can use them to resize the preview screen to a custom size and test how your layout responds at different screen sizes. ![handle-bars](https://docs.flutterflow.io/assets/images/handle-bars-bc6d168860d8ace0c4aec71c1c127450.gif) #### Set Canvas Color Use this option to change the background color of the Canvas. This can be helpful when creating components or previewing widgets against a different page background. For example, if a component uses dark text, setting a lighter canvas color can make it easier to see while designing.
### Device Preview Settings #### Show Safe Area Enable this option to show the device safe area in the builder. Safe areas help you preview where content may be affected by device notches, rounded corners, status bars, or other screen insets. :::note If the device bezel is displayed, the safe area is always enabled in the preview. :::
#### Adjust Text Sizing Use this option to preview your app with different text scale settings. This helps you test how your UI responds when users increase text size from their device accessibility settings.
#### Display Keyboard Enable this option to show the keyboard on the preview screen. This is useful for checking how form fields, buttons, and bottom-aligned content appear when the keyboard is open.
#### Display Device Bezel Use this option to show the device frame in the preview. This is particularly useful for checking how your screen will look with device-specific features such as the safe area or notches on iPhones and Android devices.
#### Show System UI Enable this option to show the device's status bar and navigation bar in the preview, inside the device bezel. The bars use the page's app bar color and adapt to the preview's light or dark mode. This option is available only in Page View when **Display Device Bezel** is on and a predefined device, such as an iPhone, is selected. **Show System UI** is off by default.
#### Show Overflows Enable this option to show overflow errors in the builder as they will appear in Test Mode. This can help you catch layout issues before running or testing your app.
#### Display Language If you've enabled multi-language support for your project, you can use this to preview your app in different languages. Open **Canvas Settings** and change the **Display Language** to preview the translated text in your app. :::tip This feature is valuable for testing your app across multiple locales without needing to run your app. :::
### Property Panel Settings #### Keep Common Properties Collapsed Enable this option to keep common sections in the Property Panel collapsed by default, such as **Visibility**, **Padding**, and **Alignment**. This can make the Property Panel easier to scan when you only want to open the sections you need.
## Add Nav Bar Use this button to add the [Nav Bar](https://docs.flutterflow.io/resources/ui/pages/scaffold#nav-bar) to your page. Clicking it opens a popup where you can enable the Nav Bar for your project. Once the Nav Bar is enabled, you can customize it to match your design. ![add-navbar.avif](https://docs.flutterflow.io/assets/images/add-navbar-6d11cbb07831d4afe49cd682fe1b3671.avif) ## Video Guide Watch this video if you prefer watching a video tutorial.
# Storyboard > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-ui/storyboard Master the Storyboard view in FlutterFlow Studio to visualize your app’s design and user navigation. The Storyboard allows you to see screens and interactions, ensuring a seamless user experience. The Storyboard view allows you to visualize the overall design and navigation of your app. On Storyboard, you can see different screens and user interactions that make up your app. This allows you to see how users will navigate through your app and ensure that the user experience is as intuitive and user-friendly as possible. :::note This feature is currently in Beta. It is optimized for projects with 30 pages or less. ::: ![storyboard.avif](https://docs.flutterflow.io/assets/images/storyboard-9f1b0d822bd94f58e43e928cedc4279a.avif) ## Storyboard legend In a storyboard, a legend is a visual key or guide that explains the meaning of the different lines, icons, and colors used inside the canvas. We use the following elements inside the storyboard: ![storyboard-legend.avif](https://docs.flutterflow.io/assets/images/storyboard-legend-d18cbc2e4f0067bf3ae2e13505ea5687.avif) 1. The solid line is used to represent the [Navigate](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action) or Login action. 2. The dotted line is used to represent the Bottom Sheet action. 3. The right arrow icon represents hidden widgets. These widgets may not be visible in the current page view (e.g., they might be on another tab) but they still have a navigation action to display them. ## Highlight routes on a page With so many pages displayed on a Storyboard, it may be difficult to identify the route path from a specific page, especially when lines overlap each other. To highlight the pathways leading into and out of a specific page, just click on a page, and the routes will be highlighted in blue color. ![highlight-routes.avif](https://docs.flutterflow.io/assets/images/highlight-routes-0bcb55b5f6e3997421746074e0d61188.avif) ## Move pages You might want to adjust the default arrangements of pages on canvas and group the pages that belong to the same feature. To do so, select the page and drag it to the desired place. ## Open a page from Storyboard You can also open a page directly from a Storyboard. To do so, simply double-click on a page. --- ## Video guide Watch this video if you prefer watching a video tutorial.
--- ## FAQs
I am getting "Error: Unable to initialize Storyboard"

This error typically occurs because the initial page has not been set. To resolve this, please set the initial page in the [App Details](https://docs.flutterflow.io/resources/projects/settings/general-settings#app-details) settings of your project.

# Widget Palette > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-ui/widget-palette Explore the Widget Palette in FlutterFlow Studio to access a wide range of UI elements. This feature offers an intuitive interface for dragging and dropping Flutter widgets onto your canvas. The Widget Palette in FlutterFlow Studio provides access to all UI elements. These are essentially FlutterFlow Studio widgets that can be dragged and dropped onto the canvas. You can use the search bar to quickly locate a specific widget for your application. ![widget-palette.avif](https://docs.flutterflow.io/assets/images/widget-palette-1f9d01356928e265066e46fa3bd4e443.avif) ## 1. Widgets From the Widgets tab, you can access all standard FlutterFlow Studio widgets. They are organized into different categories based on their purpose, making it easier to navigate and find the appropriate widget for your app. ## 2. Components Components are widgets with certain functionalities that can be reused throughout your app. They are constructed from either standard or custom widgets. Once you have created a [component](https://docs.flutterflow.io/resources/ui/components/creating-components) or [custom widget](https://docs.flutterflow.io/concepts/custom-code/custom-widgets), you can access it from here. ## 3. Templates Templates are predefined and ready-to-use widgets. These include UI elements that are commonly used in most apps and can serve as a starting point in creating parts of the user interface. You can also create your own templates from the standard widget. ## 4. Theme Widgets Theme Widgets enable you to customize the visual appearance of individual widgets and reuse them consistently throughout your app. They are an integral part of the design system, allowing you to build widgets based on your theme. Once you [create a theme widget](https://docs.flutterflow.io/concepts/design-system#theme-widgets), you can access it from here. ## 5. Floating Widget Palette The Floating Widget Palette gives you quick access to widgets directly from the canvas. This feature is useful for swiftly adding widgets without the need to open the Widget Palette via the navigation menu. ![Floating Widget Palette](https://docs.flutterflow.io/assets/images/floating-widget-palette-907809164f7c6c702ed4986cff32b266.gif) # My Teams > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-ui/my-teams On the My Teams page, you can manage billing for your team, edit projects simultaneously, and share code, design systems, APIs, and assets. This makes collaboration between team members much easier and helps keep everyone on the same page. Even if you don't have team members, you can still use this page to share resources between your own projects and keep your development process organized. On the My Teams page, you can manage billing for your team, edit projects simultaneously, and share code, design systems, APIs, and assets. This makes collaboration between team members much easier and helps keep everyone on the same page. Even if you don't have team members, you can still use this page to share resources between your own projects and keep your development process organized. By sharing resources from one place, teams can build more consistently across projects. ## Team Code :::caution **Team Code Libraries are deprecated**. Please use the new [**Libraries**](https://docs.flutterflow.io/resources/projects/libraries) to share and reuse projects across multiple projects. ::: ## Team Media Assets Your team might be working on multiple projects that use the same icons, images, audio files, and other graphic resources. If each project has its own assets, the team has to upload the same resources multiple times. However, if the team shares an asset library across projects, they can save time, increase productivity, and ensure design consistency. If an asset needs to be updated, the team can update it in one place, and the changes will reflect across all projects. To share team media assets: 1. Go to **My Teams**, select your team, and click **Upload Media**. 2. Media assets shared with the team appear in the Media Assets tab of the Navigation Menu. You can then select and use these assets directly from the asset picker in the Properties Panel. **Upload shareable media assets** ![upload-sharable-media](https://docs.flutterflow.io/assets/images/upload-sharable-media-d19e33e5d75a5a69f1d89951e3f07eb1.avif) **Access media assets** ![access-media-assets](https://docs.flutterflow.io/assets/images/access-media-assets-178639dcb9dffac3183119af2868a154.avif) ## Team Design Library A company may have a website, a mobile app, and a desktop app, each with its own user interface and user experience. Instead of recreating the same design settings for each project, you can create a shared design system to speed up the work and keep designs consistent across projects. A design system includes colors, typography, fonts, icons, app assets, a Nav Bar, and an App Bar. :::tip To store pre-designed UI components, we recommend using [**Libraries**](https://docs.flutterflow.io/resources/projects/libraries) for easy reuse across projects. ::: Here's how you can share the design library: 1. Navigate to **My Teams > Team Design Library** and click **+ Create New**. 2. Enter a name for the **Design System Project**. 3. A new project will open where you can configure the Theme, [Nav Bar](https://docs.flutterflow.io/resources/ui/pages/scaffold#nav-bar), [App Bar](https://docs.flutterflow.io/resources/ui/pages/scaffold#appbar), and [App Assets](https://docs.flutterflow.io/resources/projects/settings/general-settings#app-assets).

4. To use the shared design library, open the project where you want to use the design system and navigate to **Theme Settings** (navigation menu) **> Design System**. 5. Click **No Design System Selected**. 6. A popup opens displaying the list of shared design systems. Select one to add it to your project.

## Team API Library :::caution **Team API Libraries are deprecated**. Please use the new [**Libraries**](https://docs.flutterflow.io/resources/projects/libraries) to share and reuse projects across multiple projects. ::: ## Add Domains You can add custom domains and share them with all team members. This makes it simple to connect domains to the right projects and collaborate seamlessly. To add a domain, click **Add Domains** under **My Teams**. ![Add custom domain](https://docs.flutterflow.io/assets/images/add-custom-domain-81f55cb9f2c61724d3768dd789dac99b.avif) # Resource Hierarchy Overview > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-ui/resource-hierarchy Explore the Resource Hierarchy Overview to understand the correlation between traditional Flutter app components and their equivalents in FlutterFlow Studio. This guide aims to help you understand the structure and elements of a typical FlutterFlow Studio project. It will walk you through some important parts of the app, from the overall project down to individual design elements, explaining their purpose and how they relate to traditional Flutter app components. ## FlutterFlow Studio App Parts The diagram below illustrates how a FlutterFlow Studio app is structured. ![FlutterFlow Studio app part.avif](https://docs.flutterflow.io/assets/images/ff-app-part-5d677a6580a1a528a2951299d2280d84.avif) 1. **Project**: Represents the overall application you are building in FlutterFlow Studio. It encompasses all the other elements listed below and serves as the container for your entire app development effort within FlutterFlow Studio. Learn more about creating a project [here](https://docs.flutterflow.io/resources/projects/how-to-create-find-organize-projects#how-to-create-a-project). 2. **Page**: Refers to individual screens within the FlutterFlow Studio project. Each page represents a part of the user interface where users can interact with the app. Multiple pages collectively make up the complete user interface of your application. Learn more about pages in FlutterFlow Studio [here](https://docs.flutterflow.io/resources/ui/pages#creating-a-page). 3. **Built-in-widgets**: These are pre-designed widgets provided by FlutterFlow Studio that you can use to build your app’s user interface. Built-in widgets simplify the development process by offering common UI elements such as buttons, text fields, sliders, etc. 4. **Component**: A component in FlutterFlow Studio is a reusable UI block that can be used across different pages within the project. Components are useful for maintaining consistency and reducing redundancy in the app design, as the same component (like a custom dialog box) can be inserted wherever needed. Learn more about creating a component [here](https://docs.flutterflow.io/resources/ui/components). 5. **Design System**: This refers to a set of standards for design within your FlutterFlow Studio project. A design system in FlutterFlow Studio includes predefined styles that ensure visual consistency throughout the app. Learn more about design system [here](https://docs.flutterflow.io/concepts/design-system). ## Flutter to FlutterFlow Studio If you are coming from Flutter, it is beneficial for you to understand the Flutter to FlutterFlow Studio mapping. The diagram below illustrates the correlation between traditional Flutter app components and their equivalents within FlutterFlow Studio. ![Flutter to FlutterFlow Studio app parts](https://docs.flutterflow.io/assets/images/flutter-to-flutterflow-c4f7ad3c554b0e399fdd6456dc36c176.avif) 1. **MyApp to Project**: In Flutter, `MyApp` typically represents the root of your application, where you set up routes and other global configurations. In FlutterFlow Studio, the equivalent is the "Project," which encompasses the entire application you are building, including its configurations and settings. Learn more about creating a project [here](https://docs.flutterflow.io/resources/projects/how-to-create-find-organize-projects#how-to-create-a-project). 2. **MyPage to Page**: `MyPage` in Flutter represents a specific screen in the app. Similarly, In FlutterFlow Studio, each "Page" corresponds to a screen, where you build the layout and functionality specific to that page of the project. Learn more about pages in FlutterFlow Studio [here](https://docs.flutterflow.io/resources/ui/pages#creating-a-page). 3. **Column, Button, Text to Built-in widgets**: In FlutterFlow Studio, widgets are categorized under "Built-in widgets," which users can drag and drop onto their canvas to build the UI. Learn more about widgets [here](https://docs.flutterflow.io/resources/ui/overview#widgets). 4. **Custom widget to Component**: `CustomWidget` in Flutter indicates user-defined widgets that serve specific functions not covered by built-in widgets. FlutterFlow Studio translates this into "Component" allowing you to create and use custom components within your projects. Learn more about creating a component [here](https://docs.flutterflow.io/resources/ui/components). 5. **Theme/style constants to Design System**: In Flutter, theme and style constants are used to ensure consistent styling across an app. FlutterFlow Studio uses a "Design System" to manage and apply uniform styles and themes throughout the application. Learn more about design system [here](https://docs.flutterflow.io/concepts/design-system). ## Resource Description A Resource Description is a brief text note that explains the purpose, usage, or key details of a particular resource. By supplying clear, concise descriptions, you create better project documentation and a smoother development experience—both for yourself and any collaborators. :::note Here are some reasons why resource descriptions can be helpful: - **Team Collaboration**: When multiple developers or designers work on the same project, concise descriptions help everyone understand each element’s role without guesswork. - **Better Search**: Descriptions are indexed in the FlutterFlow Studio search. This helps locate pages, components, and other resources quickly, especially in large projects. - **Project Documentation**: Acts as built-in documentation of your app, which makes future updates easier. ::: You can add a description for each of the following resources in FlutterFlow Studio: - **Project**: Use the project-level description to summarize the overall goals or scope of your app. For instance, "A delivery management app for small businesses" helps keep the team aligned on the primary objective. - **Page**: Explains a page’s main function. Example: "Displays the user’s shopping cart and checkout options." - **Component**: Clarifies the functionality or design intention of a reusable component. Example: "Reusable card component to be used as ListTile." - **Action Blocks**: Provide a concise description of what the set of actions does (e.g., "Sends a notification to the user’s email address upon form submission"). - **Custom Functions**: Describe the logic or purpose behind the function. Example: "Calculates shipping costs based on weight and distance." - **Custom Actions**: Specify the custom behavior you’ve created, such as "Opens a QR scanner and returns the scanned value." - **Custom Widgets**: Explain the widget’s purpose or structure. Example: "Carousel widget for displaying multiple images with pagination." - **Data Type**: Summarizes the purpose of a custom data model. Example: "Represents a user’s order including items, total cost, and status." - **Parameters**: Provide context for how a parameter is used, including expected data types or value ranges. Example: "String to store the user’s phone number—must include country code." - **Page/Component State Variables**: Clarify what state data is being stored and why. For instance, "Tracks the currently selected tab in this component." - **App State Variables**: Describe the global data shared across pages. Example: "Stores the user’s authentication token for all network requests". - **Constant**: Add the intended purpose of any fixed value used throughout the app. Example: "Base API URL for all network calls". - **Enum**: Provide a rationale for the enumerated values. Example: "Defines possible user roles—admin, editor, viewer". - **Firestore Collection**: Explain what data the collection holds and how it relates to your app’s functionality. Example: "Stores all user profiles with fields for name, email, and profile photo URL". In FlutterFlow Studio, you can read descriptions as tooltips when hovering over the green note icon. :::tip In the generated code, FlutterFlow Studio inserts descriptions as docstring-like comments near the relevant classes, methods, or properties. For instance, a data type named `OrderInfo` with a description of “Represents a user’s order, including items, total cost, and status” will have that text added above the class declaration: ```jsx /// Represents a user’s order, including items, total cost, and status. class OrderInfo { /// The total price in USD for this order. double totalAmount; List items; // ... } ``` In a standard IDE (e.g., VS Code or Android Studio), if you place your mouse over a custom data type class name, the description set in FlutterFlow Studio appears as a tooltip, helping you quickly grasp the purpose of a resource. ![resource-description.avif](https://docs.flutterflow.io/assets/images/resource-description-870afc6b99db9b5637c1beadba3677e5.avif) ::: # FlutterFlow Studio Resources > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources Learn about the key building blocks in FlutterFlow Studio - [Projects](https://docs.flutterflow.io/resources/projects): 7 items - [UI Building Blocks](https://docs.flutterflow.io/resources/ui/overview): 4 items - [Data Representation](https://docs.flutterflow.io/resources/data-representation): 8 items - [Control Flow & Logic](https://docs.flutterflow.io/resources/control-flow-overview): 6 items - [Naming Variables & Functions](https://docs.flutterflow.io/resources/style-guide): Naming conventions for FlutterFlow Studio, including guidelines for widgets, components, state variables, constants, and more. # What is a Project? > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects Understand what constitutes a project in FlutterFlow Studio and how to manage them effectively. A **Project** in FlutterFlow Studio represents a complete Flutter application. It contains all the generated code for a Flutter app. This means that you can export your code and your app will run as a normal Flutter app without requiring FlutterFlow Studio. A FlutterFlow Studio project includes all the files and packages generated by the `flutter create` command, along with additional packages specifically added to support common functionalities. These include: ### UI and Styling - [**auto_size_text**](https://pub.dev/packages/auto_size_text): Automatically resizes text to fit within its bounds. - [**cached_network_image**](https://pub.dev/packages/cached_network_image): Provides a widget that displays images from the internet, caching them for performance. - [**flutter_animate**](https://pub.dev/packages/flutter_animate): Facilitates adding animations to widgets. - [**font_awesome_flutter**](https://pub.dev/packages/font_awesome_flutter): Offers a comprehensive set of icons provided by FontAwesome. - [**from_css_color**](https://pub.dev/packages/from_css_color): Converts CSS color strings to Flutter color objects. - [**google_fonts**](https://pub.dev/packages/google_fonts): Enables custom fonts to be used easily from the Google Fonts catalog. - [**page_transition**](https://pub.dev/packages/page_transition): Adds customizable page transition effects. ### Navigation - [**go_router**](https://pub.dev/packages/go_router): A declarative router based on URL patterns, simplifying navigation logic. ### Data Management and Storage - [**collection**](https://pub.dev/packages/collection): Provides additional collection types and utilities. - [**json_path**](https://pub.dev/packages/json_path): Allows querying JSON data structures with path expressions. - [**provider**](https://pub.dev/packages/provider): A popular state management technique to propagate changes across the app. - [**shared_preferences**](https://pub.dev/packages/shared_preferences): Facilitates persistent storage of simple data (key-value pairs). ### Platform Specific Integrations - [**path_provider**](https://pub.dev/packages/path_provider): Locates commonly used locations on the filesystem. - [**path_provider_android**](https://pub.dev/packages/path_provider_android), [**path_provider_foundation**](https://pub.dev/packages/path_provider_foundation), [**path_provider_platform_interface**](https://pub.dev/packages/path_provider_platform_interface): Platform-specific implementations and interface for `path_provider`. - [**shared_preferences_android**](https://pub.dev/packages/shared_preferences_android), [**shared_preferences_foundation**](https://pub.dev/packages/shared_preferences_foundation), [**shared_preferences_platform_interface**](https://pub.dev/packages/shared_preferences_platform_interface), [**shared_preferences_web**](https://pub.dev/packages/shared_preferences_web): Platform-specific implementations for `shared_preferences`. - [**url_launcher**](https://pub.dev/packages/url_launcher), [**url_launcher_android**](https://pub.dev/packages/url_launcher_android), [**url_launcher_ios**](https://pub.dev/packages/url_launcher_ios), [**url_launcher_platform_interface**](https://pub.dev/packages/url_launcher_platform_interface): Packages that enable launching URLs on various platforms, allowing the app to open web links, emails, and more. ### Utilities - [**intl**](https://pub.dev/packages/intl): Provides internationalization and localization facilities, including message translation, plurals and genders, and date/number formatting. - [**flutter_cache_manager**](https://pub.dev/packages/flutter_cache_manager): Manages cached files, supporting custom file retrieval strategies and cache rules. - [**timeago**](https://pub.dev/packages/timeago): A library to format dates as a relative time (e.g., "5 minutes ago"). Any elements (e.g. pages, widgets), business logic or packages that are added to the project will be included in the generated code. :::tip[Generated Code] FlutterFlow Studio automatically generates a complete Flutter application for you. To dive deeper into the project structure of a Flutter app generated by FlutterFlow Studio, explore the [**Directory Structure**](https://docs.flutterflow.io/generated-code/project-structure) guide. ::: # Create, Find, and Organize Projects > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/how-to-create-find-organize-projects Learn how to create, find, and organize projects in FlutterFlow Studio to streamline your app development process. # ## How to Create a Project To create a new project, go to the Dashboard and click **+ New Project** in the upper-right corner. This opens a window where you can start with a template app or a blank project.

## How to Find Projects Go to the Project Dashboard to view all your projects. You can search for specific projects using the search bar.
Narrow your search scope with the dropdown menu next to the search bar: - **All Projects:** Shows all projects you can access. - **My Private Projects:** Shows projects accessible only to you. - **My Shared Projects:** Shows projects you own and have shared with others. - **Shared With Me:** Shows projects shared with you that you do not own. - **Team Projects:** Shows projects that belong to your teams. - **Library Projects:** Shows projects configured as libraries for reuse across other projects. - **Marketplace Listings:** Shows projects connected to your Marketplace listings. - **Archived Projects:** Shows projects you have archived. - **Beta Projects:** Shows projects using the Beta environment. - **Prod Projects:** Shows projects using the Production environment. ![filter-projects](https://docs.flutterflow.io/assets/images/filter-projects-665e7c456b47e85db1d936f2c1243a32.avif) ## Organizing Projects ### Create and Add Tags to Projects Tags help categorize and filter your projects for easier management. To create a tag, click **+ Tag** or open the three-dot menu on a project card and select **Create Tag**. Add a tag to a project by opening the three-dot menu on the project card and selecting a tag. Each project can have only one tag.
### Searching and Filtering by Tags When a tag is selected, the project list filters to show only projects associated with that tag. This filter can be combined with the search bar to refine your project search further.
### Editing and Removing Tags Modify or remove tags by clicking the gear icon within the orange Tag button. This lets you quickly update tag names and assignments. ![edit-tags](https://docs.flutterflow.io/assets/images/edit-tags-a332d8bd24063d78cd99b8397ca832fa.avif) # Run and Test Projects > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/how-to-run-test-projects Learn how to run and test projects in FlutterFlow Studio to ensure your app functions correctly and meets your requirements. There are 4 ways to test your project in FlutterFlow Studio. - **[Preview](https://docs.flutterflow.io/testing/run-your-app#preview-mode)**: This mode allows for quick testing of the user interface on a virtual device without requiring a full build. - **[Test](https://docs.flutterflow.io/testing/run-your-app#test-mode)**: This mode runs a web version of your app with Flutter's "Hot Reload" feature, enabling you to visualize changes immediately. - **[Run](https://docs.flutterflow.io/testing/run-your-app#run-mode)**: This mode allows for testing a fully functional version of your app with live data. - **[Local Run](https://docs.flutterflow.io/testing/local-run)**: This feature, available in the FlutterFlow Studio Desktop App, lets you test your app on an emulator or physical mobile device. # Collaborate on Projects > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/collaboration Learn how to collaborate effectively on projects in FlutterFlow Studio, including best practices for teamwork and project management. In FlutterFlow Studio you can share projects with your entire organization (team), with individual users within your organization, or external users. ## Sharing a Project with Team To share a project with team members, use the **Share with team** dropdown in the **Collaboration** page of your project's settings, and select how you want the project to be shared: ![share_with_team.png](https://docs.flutterflow.io/assets/images/share_with_team-d9300d604efe99f80fc07d46d2912eda.png) - **Team project:** A project associated with your team and automatically visible to all team members. When a project is a Team Project, team members are automatically added as Editors. You can specifically designate team members as Viewers, but you cannot remove them. - **Restricted team project:** A project associated with your team but only visible to specific team members who are added directly. After selecting this option, you’ll need to manually choose the team members you want to share the project with. - **Personal project:** A project not associated with any team, where editing capabilities depend on the type of personal plan you have. :::note - The Team owner always has edit access to the project, regardless of who created or shared it, and retains full team plan capabilities. - The Team owner can also selectively share the project with any number of team members. - A [**Library**](https://docs.flutterflow.io/resources/projects/libraries) project will not have the *Restricted Team Project* option. - Sharing a project with team members is only available on the **Growth** plan and **higher**. Check out our [**pricing**](https://www.flutterflow.io/pricing) section. ::: ## Sharing a Project with External Collaborators You can invite users to your project who are not part of your organization. For instance, you might want to share your work with clients, stakeholders, or team members of the client. You can add users as Read Only users to any project regardless of your pricing plan in the **Collaborators** page of your project's settings. :::note - Users with read-only access will only be able to access that specific project and won't be able to access any shared *Teams* libraries (e.g., custom code, design system). - You must verify your email before inviting users. - If a user isn't already a FlutterFlow Studio user, we will send them an invite email. Their status will be shown as Pending until they create an account. ::: To add an external user as a collaborator as an Editor to a project, you first need to purchase a collaborator pass. To purchase a collaborator pass, go to the [My Teams](https://app.flutterflow.io/team) page and, under the **Collaborator Passes** section, click **Add Pass** and complete the checkout process. Once the pass is created, enter the user email and select the project (Team Project or Restricted Team Project) you’d like to grant them access to. :::note - You must be a Team Owner to purchase and assign a Collaboration Pass. - Collaborator Passes can only be assigned to users who have a paid plan (Basic, Growth, or Business). :::

## Transferring Project :::danger This step can not be undone. If you want to regain project ownership, the new project owner will need to transfer ownership back to you. ::: To transfer ownership to another user, navigate to **Settings & Integrations > Project Setup > Collaboration > Project-Level Access**, click on the current role and select **Owner**. :::note You can transfer a project to any FlutterFlow Studio user (including [external collaborators](#sharing-a-project-with-external-collaborators)) as long as they have an active paid plan. ::: ![transfer-ownership.avif](https://docs.flutterflow.io/assets/images/transfer-ownership-38bf5147ec948ecaffe2d643eb6d8970.avif) ## Real-Time Collaboration Real-Time Collaboration is a powerful feature that allows multiple builders to work together on the same project or, rather same page and design system simultaneously. With this, all builders can see the changes being made to the page as they happen and can also make their own changes to the page without interfering with the work of others. This increases efficiency and productivity, as multiple builders can work on various aspects of the project or together on the same page at the same time. When multiple builders are on the same page, it looks like this: real-time-collaboration.gif :::note Real-Time collaboration is only available on the **Growth** plan and **higher**. Check out our [**pricing**](https://www.flutterflow.io/pricing) section. ::: ## Project Activity You can see a running history of changes made while building that helps you track progress and stay up to date on project changes. :::note Project Activity is only available to **Enterprise** users. Check out our [**pricing**](https://www.flutterflow.io/pricing) section. ::: ![project-activity](https://docs.flutterflow.io/assets/images/project-activity-3d3eee4fef07cfaf66934cc1a76937e8.avif) ### Reading Activity Entries Each entry shows who made the change, the action they performed, the affected item, and a short summary. Hover over an entry to see the full text. Changes by the same person that involve the same action and item are grouped into one entry. A label before the description tells you how the change was made: - **(AI)**: An AI feature in FlutterFlow Studio made the change. - **(SDK)**: The change came through the FlutterFlow AI SDK, such as from the CLI, an MCP client, or a script. This label indicates how a change was submitted, not whether a person or an AI agent decided to make it. - **(agent)**: A FlutterFlow Studio-hosted agent made the change through the SDK. When someone uses undo or redo, the entry starts with **undid:** or **redid:** followed by the description of the change. If the summary doesn't include every change, it ends with **more changes**. The tooltip explains that the summary is incomplete. ### Investigate Changes With an AI Agent When you need to work out what changed in a project during a given period, ask your AI agent to retrieve the project's activity logs. The agent uses the `activity_logs` tool of the FlutterFlow MCP server. For setup, see [Build with AI Agents](https://docs.flutterflow.io/flutterflow-cli/build#investigate-project-activity). # General Settings > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/settings/general-settings Learn how to configure general settings for your FlutterFlow Studio app. General Settings serve as the control center for configuring essential aspects of your app. ## App Details Edit the metadata and app-level settings for your project. - **Project Name**: The name of your FlutterFlow Studio project. This is the name shown inside FlutterFlow Studio. - **Project Description**: Optional internal notes about the project. Use this to describe the app, its purpose, or any context that helps collaborators understand the project. ### App Names Use **App Names** to configure the package and display names for each environment. - **Current Environment**: Select the environment you want to configure, such as **Production**, **Staging**, or **Development**. - **Package Name**: The unique package or bundle identifier for your app. You can define different package names for different environments. - **Display Name**: The name shown to users on the installed app and in stores such as the App Store and Play Store. :::tip After changing the package name, errors may appear on the toolbar due to invalidated Firebase config files. To resolve this, generate new config files by going to **Settings & Integrations > Project Setup > Firebase > Regenerate Config Files**. ::: ### Pinned FlutterFlow Studio Version Use this section to pin the project to a specific FlutterFlow Studio version or keep it on the **Latest Version (Unpinned)**. Pinning can help protect complex projects from unexpected changes caused by platform updates. For more details, see [Pinning Projects to Stable FlutterFlow Studio Versions](https://docs.flutterflow.io/resources/projects/settings/flutterflow-version-management). :::caution Once pinned, upgrading the FlutterFlow Studio version may introduce breaking changes that could cause errors in your project. If needed, you can revert to the previous version, but any changes made to the project after upgrading will be lost. ::: ### Initial Page You can specify your app's **Entry Page** and **Logged In Page** from this section. - **Entry Page**: The Entry Page is the first page users see when they open your app. When authentication is disabled, all users are directed to this page by default. If authentication is enabled, this page becomes the login, signup, or onboarding page for users who are not authenticated. - **Logged In Page** (*available only if auth is enabled*): This page is displayed when the app starts for authenticated users. If a user successfully signs in, they are automatically redirected to the page specified here. If the user is already authenticated, this page bypasses the Entry Page. To set the page, choose the page you want to use from the dropdown menu. ![initial-page](https://docs.flutterflow.io/assets/images/initial-page-d9f36f9a9e089c4010558d95d327adfb.avif) ### Download Settings - **Run "dart fix"**: Enabling this runs the `dart fix` command when downloading the code. This makes the generated code cleaner and potentially more performant. - **Download Unused Project Assets**: Enable this option to download all assets, including those that are not currently used in the project. This is useful when you need to access and use the assets in custom code or other parts of your project. :::note When you publish your app to the web or build an APK, the build can include up to 1 GB of assets in total, counting assets from the project and its libraries. If your project goes over this limit, the build fails with an error that asks you to reduce your assets. To get under the limit, reduce asset sizes or remove unused assets from the project and its libraries. Turning off **Download Unused Project Assets** also skips unused project assets, but library assets always download in full. Downloading your code and pushing to GitHub aren't affected. ::: ### Routing & Deep Linking Configure global navigation and deep linking settings for your app. - **Override Default Transition**: Enable this to set a default page transition that applies across the app unless a page or action overrides it. - **Pages Require Authentication by Default**: Enable this to require authentication for pages by default. You can still configure page-level access as needed. - **Firebase Dynamic Links (retired)**: Appears only in projects that saved the earlier **Use Firebase Dynamic Links** setting. Firebase Dynamic Links has been retired, so you can only turn this off. To set up links for your app, see [FlutterFlow Studio Dynamic Links](https://docs.flutterflow.io/concepts/navigation/flutterflow-dynamic-links) and the [Deep & Dynamic Linking](https://docs.flutterflow.io/concepts/navigation/deep-dynamic-linking) guide. - **URL Scheme**: Defines the scheme and domain values used for deep links. Keep these values unique to your app and aligned with your configured domain. - **Advanced Route Settings**: Opens additional routing options for configuring app navigation behavior. ### Display Settings The **Display Settings** section allows you to configure how text scales within your app. This is particularly helpful for accessibility, ensuring that users with visual impairments can comfortably read content. - **Min Text Scaling Factor**: Defines the minimum allowable scale for text. This prevents text from shrinking below a certain threshold, helping maintain legibility for all users. For example, setting this to `1` ensures text is never rendered smaller than its base size, regardless of device settings or user preferences. - **Max Text Scaling Factor**: Defines the maximum allowable scale for text. This limits how large text can appear, which is useful for preserving layout consistency on devices with accessibility text scaling enabled. For example, setting this to `10` allows text to scale up to 10× its original size. - **Persist Text Scaling Factor**: When enabled, the current text scaling factor will be stored and applied even after the app is restarted. This ensures a consistent user experience across sessions. This setting requires both **Min** and **Max Text Scaling Factors** to be set. If either is unset, persistence will have no effect. :::note Once the text scaling factors are set, you can use the [**Update Text Scaling Factor**](https://docs.flutterflow.io/concepts/accessibility#update-text-scaling-factor-action) action to let users dynamically adjust text size. ::: For example, suppose the Min Text Scaling Factor is set to 1.0 and the Max Text Scaling Factor is set to 5.0. If a user's device requests a scaling factor of 2.5, FlutterFlow Studio will accept it because it falls within the allowed range. So, if the base font size is 16.0, the final rendered size would be: `2.5 × 16.0 = 40.0` If a device requests a scaling factor higher than 5.0 (such as 6.0), it will be capped at 5.0. Thus, for a base font size of 16.0, the final rendered size will be: `5.0 × 16.0 = 80.0`. Similarly, if a device requests a scaling factor below 1.0 (for example, 0.5), it will be raised to 1.0 to ensure readability. The resulting font size would remain: `1.0 × 16.0 = 16.0`. ### UI Settings - **Show Component Preview in Palette**: Enable this to show component previews in the Widget Palette. This helps you identify reusable components visually while building. ## App Assets Use App Assets to upload images for your splash screen and app launcher icon. ### Splash Splash screens are the first thing users see when your app starts up. They give the app time to get ready while showing users your branding or loading experience. This screen typically contains the image or logo of the app. To configure the splash screen: 1. Navigate to **Settings and Integrations** from the Navigation Menu > **General** section > **App Assets**. 2. Under the **Splash** section, click **Upload Image** and upload the image you would like to display on the splash screen. 3. You can try any of the **Image Fit** options to determine how the uploaded image should display on the splash screen. 4. To control the image dimensions manually, you can set the **width** and **height** properties. - To set an **exact size**, select **PX** and enter the desired values. - To set the dimensions as a **% of the screen size**, select **%** and enter the desired value. 5. The **Min Duration** property helps you set how long the splash screen will be visible. For reference, 1000 ms equals 1 second. 6. You can also set a **Background Color** to match the background of the image. 7. In mobile apps, you might occasionally notice a blank white screen briefly appearing (as the Flutter engine loads) before the splash screen is displayed. To change the color of this screen, use the **Pre-loading** Color property. 8. Typically, web apps don't use a splash screen, so if you prefer a more traditional web experience, you can choose to **Disable for Web**. ![splash-image](https://docs.flutterflow.io/assets/images/splash-image-a40ac0d29201d04fe452038c3b038623.avif) ### Launcher Icon The launcher icon, also known as the app icon, represents your application on a user's device. The image asset you upload here is used as the app launcher icon. To add the app launcher icon: 1. Click **Settings and Integrations** from the Navigation Menu. 2. Under the **General** section, select **App Assets**. 3. Under the **Launcher Icon** section, click **Upload Image**. 4. Use the **Unset** dropdown menu to select from images already uploaded to Project Media/Assets. 5. [Download the project](https://docs.flutterflow.io/flutterflow-cli/exporting) and run the following command in your terminal to generate the launcher icon: `flutter pub run flutter_launcher_icons:main` 6. [Run your app](https://docs.flutterflow.io/testing/run-your-app) on a real device or emulator to see the app launcher icon. ### Android Adaptive Icon [Adaptive icons](https://developer.android.com/develop/ui/views/launch/icon_design_adaptive) let app icons adapt to different device environments. Unlike traditional launcher icons, adaptive icons are designed to scale and display well across different devices. Adaptive icons consist of two layers: 1. **Foreground layer**: This layer usually contains the logo or main visual element of the icon. 2. **Background layer**: This provides a fill (color or background image) behind the foreground, which can be manipulated by the device’s software. Here are the steps to add adaptive icons: 1. [Create an adaptive icon](https://developer.android.com/develop/ui/views/launch/icon_design_adaptive#design-adaptive-icons). You can either use this [online tool](https://icon.kitchen/) or use these [resources](#create-adaptive-icon) to create one. 2. Return to FlutterFlow Studio and navigate to **Settings and Integrations > General** > **App Assets > Android Adaptive Icon.** 1. Upload the **Foreground Icon**. If you use the online tool, you'll find it inside the `IconKitchen-Output > android > res > mipmap-xxxhdpi > ic_launcher_foreground.png`. 2. For **Background Type**, you can either set the **Color** or **Image**. Use a color that aligns with your app's branding for a cohesive look. 3. [Download the project](https://docs.flutterflow.io/flutterflow-cli/exporting) and run the following command in your terminal to generate the launcher icon: `flutter pub run flutter_launcher_icons:main` 4. [Run your app](https://docs.flutterflow.io/testing/run-your-app) on a real device or emulator to see the app launcher icon. ![adaptive-icons](https://docs.flutterflow.io/assets/images/adaptive-icons-12360989e7fcdd7452191243b0ad3208.avif) #### Useful Resources See the following resources for more information on Android adaptive icons. #### Create Adaptive Icon - [Create app icons in Android Studio](https://developer.android.com/studio/write/create-app-icons#create-adaptive) - [Figma template](https://material.uplabs.com/posts/adaptive-icon-sticker-sheet) (requires login) - [Affinity Designer template](https://cyrilmottier.com/2017/07/06/adaptive-icon-template/) - [Bjango templates](https://github.com/bjango/Bjango-Templates) include adaptive icons - [Adobe XD template](https://github.com/faizmalkani/adaptive-icon-template-xd) #### Adaptive Icon Fundamentals - [Understanding Android Adaptive Icons](https://medium.com/google-design/understanding-android-adaptive-icons-cee8a9de93e2) - [Designing Adaptive Icons](https://medium.com/google-design/designing-adaptive-icons-515af294c783) - [Implementing Adaptive Icons](https://medium.com/google-developers/implementing-adaptive-icons-1e4d1795470e) ## Nav Bar and App Bar See how to configure the [Nav Bar](https://docs.flutterflow.io/resources/ui/pages/scaffold#enable-nav-bar-in-settings) and the [App Bar](https://docs.flutterflow.io/resources/ui/pages/scaffold#appbar). # Project Setup > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/settings/project-setup Learn how to set up your project in FlutterFlow Studio. Setting up a project in FlutterFlow Studio ensures that your app is prepared to provide a robust and user-friendly experience across different platforms and regions. By adding necessary permissions, enabling multiple platforms, and supporting multiple languages, you can expand your app's reach and functionality while maintaining high standards of performance and user satisfaction. ## Permissions In your app, you must be transparent and get upfront consent before using the user's private information, such as location, health data, photos, or any information that reveals their identity via the camera and/or microphone. This is done by adding a permission flow just before accessing the data. We automatically add permissions whenever you add features that access the user's private data. You still need to add permission messages. These messages help users clearly understand how your app will use the data it is requesting. :::note - You cannot show custom permission messages on Android, so the messages added here are displayed only on iOS devices. To write a clear permission message, see [**Apple's Human Interface Guidelines**](https://developer.apple.com/design/human-interface-guidelines/patterns/accessing-private-data/#requesting-permission). - You cannot turn off permissions (with messages) added by FlutterFlow Studio. This helps prevent issues during app review. - See how to [**request permission**](#request-permission-action). :::
![permissions-fi](https://docs.flutterflow.io/assets/images/permissions-fi-12cf77c30e36d15240091c31024bea2f.avif)
Asking for camera permission before capturing a photo
### Adding a permission message Although we add some default permission messages, you must update them to clearly explain the reason for requesting each permission. To add a permission message: 1. Select **Settings & Integrations** from the left navigation menu. 2. Under **Project Setup**, select **Permissions**. 3. Customize the permission message for each permission. For permissions that are not yet added or enabled, turn on the toggle and enter the message. When the app runs, this message appears inside the standard alert dialog, between your app name and the action buttons. For permissions that are already added and cannot be turned off, leaving the message empty will use the hint text shown in the permission dialog. ![Adding permission message](https://docs.flutterflow.io/assets/images/add-permission-6b0d8904542d74f1c2325f87ea5108ea.png) ### Adding a custom permission Sometimes you might add a feature, such as a custom widget or custom action, that requires a permission that is not listed here. For example, you may add a speech recognition feature to your project. In that case, you can add the required permission and message for Android and/or iOS from here. To add a custom permission: 1. Select **Settings & Integrations** from the left navigation menu. 2. Under **Project Setup**, select **Permissions**. 3. Click **+ Add Permission**. 4. Enter the **iOS Permission key** value, such as *NSSpeechRecognitionUsageDescription* or *NSMicrophoneUsageDescription*. 5. Enter the **Android Permission name** value, such as *RECORD_AUDIO* or *CAMERA*. 6. Enter the **Permission Message** that describes exactly how the data is used. 7. Click the Done icon on the right.

:::note[Adding translations for permission messages] You can also add multilingual permission messages by following the instructions [**here**](https://docs.flutterflow.io/concepts/localization). ::: ### Request Permission [Action] Using this action, you can request permission before accessing the user's private information, such as location, voice, contacts, and photos. This action is helpful when you add a custom widget or action that accesses the user's personal information and does not have a built-in permission mechanism. :::note - Request permission only works on mobile platforms. - No dialog is shown for the *Bluetooth* permission. ::: **Allow permission**

**Reject permission**

#### Adding Request Permission action To add this action: 1. Add a new action and select **Request Permissions** under **Alerts/Notifications**. 2. Set the **Permission Type**. Only permissions with a configured permission message appear here. 3. Add a [conditional action](https://docs.flutterflow.io/resources/functions/conditional-logic#conditional-actions) to check the result. Set the condition variable to **Permission > Permission name** for the permission you requested. 4. Add the next actions under **TRUE** if permission is granted, or under **FALSE** if permission is denied. Then click **Close**.
## Platforms By default, the generated project can run on Android, iOS, and the Web without any additional effort. However, to run your app on desktop, you need to enable a platform (e.g., macOS, Windows, Linux) from this page. ### Advanced Android Settings - **Kotlin Version**: There are various situations where you may need to modify or configure the Kotlin version in your Android project. This could include updating to the latest version, adapting the version to accommodate a specific library or tool, or other specific requirements. To change the default version, enter the value here. If you enter a version lower than 2.2.20, FlutterFlow Studio uses 2.2.20 instead. - **Minimum SDK Version**: This defines the lowest version of Android that your app can run on. Setting a higher minimum SDK version ensures your app can use newer APIs and features but may limit the devices that can install it. The default is 24 (Android 7.0), which is also the lowest value supported. If you enter a lower value, FlutterFlow Studio shows a warning and uses 24 instead. - **Compile SDK Version**: This refers to the version of Android that your code is compiled against. It determines the APIs your app can use. To change it, enter the desired SDK version here. - **Target SDK Version**: This is the version of Android that your app is intended to run on. It helps Android ensure forward compatibility by applying certain behavior changes only if the target SDK is high enough. To adjust this, enter the desired version here. ### Advanced iOS Settings - **Disable iPad Support:** If the app is specifically designed for an iPhone and doesn't provide a good user experience on an iPad, you might want to turn on this setting. - **Minimum iOS Version**: This specifies the lowest version of iOS that your app can run on. The default is 15.0, which is also the lowest value supported. If you enter a lower version, FlutterFlow Studio shows a warning and uses 15.0 instead. - **Disable Swift Package Manager**: By default, Flutter uses Swift Package Manager for compatible iOS and macOS plugins and CocoaPods for the remaining plugins. Enable this setting to install every iOS and macOS plugin with CocoaPods. Use it if a plugin, a custom pod, or a Podfile hook in your project requires CocoaPods. This setting is off by default. :::note Some projects already use only CocoaPods, so this setting doesn't change their builds. This includes projects that use Firebase Analytics, push notifications, or a custom Firebase Apple SDK version. The setting stays available in these projects, and FlutterFlow Studio preserves your selection if you later remove those features. ::: :::note If you [unlocked native build files](https://docs.flutterflow.io/concepts/custom-code/configuration-files), FlutterFlow Studio can't update them for you. Make sure the minimums in those files are at least Android API 24 and iOS 15. ::: ### Advanced Web Settings - **Use Original Engine Initialization**: This setting uses the original Flutter web engine initialization, which can sometimes improve loading times in deployed web apps. Enable this option if you experience performance issues with the custom initialization process. - **Use CanvasKit**: CanvasKit provides better performance and fidelity for rendering on the web by leveraging WebAssembly. This setting can improve the visual quality and performance of your app, especially for complex graphics and animations. Enable this option to use CanvasKit for rendering on the web. :::caution While FlutterFlow Studio can generate project code for **macOS** and **Windows**, these platform targets are **currently in Alpha** and provided as-is. FlutterFlow Studio does not provide infrastructure for building, debugging, or running apps on these platforms, and our **Support team is unable to assist** with issues related to macOS or Windows builds. However, the generated code can still be opened, built, and debugged using standard Flutter tooling such as Android Studio or VS Code. This applies only to the deployment platform options, not to the FlutterFlow Studio Desktop application itself. ::: ## Multiple Languages To support multiple languages in your app, refer to the [localization guide](https://docs.flutterflow.io/concepts/localization). ## Walkthroughs A walkthrough in app development is a guided tour of the app's features and functionality, typically presented to the user when they first launch the app. It is designed to help new users understand how to use the app and navigate its various sections. For example, consider a news article app. When a new user opens the app for the first time, they might be greeted with a series of pop-ups that highlight key features such as watching article videos, subscribing to article updates, and filtering articles by tags.

The steps to create and display a walkthrough in your app are as follows: 1. [Create walkthrough](#1-create-walkthrough) 2. [Start walkthrough](#2-start-walkthrough-action) 3. [Get notified on walkthrough skipped and completed](#3-get-notified-on-walkthrough-skipped-and-completed) ### 1. Create walkthrough To create a walkthrough: 1. Navigate to **Settings and Integrations** > **General** > **Walkthroughs**, then click **Create New**. 2. Enter the **Name** and **Description**, then select the **Page** on which you want to show the walkthrough. The name you enter will be used to initiate the walkthrough later. 3. Next, add the steps for your walkthrough. Each step acts as a separate screen or popup that animates to highlight the UI element. To add steps: 1. Click on the **+ Add Step**. 2. Choose the widget to highlight by clicking **Widget Unset**. In the right-side preview, select the desired widget and click **Confirm**. 3. When the widget is in focus, you may want to present information about it; this could be simple text or a custom component (e.g., text with an arrow). You have complete control over what you want to display via a [component](https://docs.flutterflow.io/resources/ui/components). Click the diamond icon to create a new component and then set it to **Content**. 4. You can also choose where the content appears by setting the **Content Alignment**. 5. Choose a **Focus Shape** for the widget—either **Circle** or **Rectangle**. 6. Pick an **Overlay Color** that you want to display when the widget is highlighted. 7. By default, we also add a skip button on the screen, and you can align it using the **Skip Alignment** option. 8. Add additional steps by repeating the process for all UI elements you wish to feature. 4. To preview the walkthrough, click the **Start Preview** button and use the arrows to navigate through the steps. 5. To rearrange the steps, enable the **Reorder** option and then use the arrows to adjust their sequence. 6. Click **Add Walkthrough** to save.

### 2. Start Walkthrough [Action] After creating a walkthrough, you can display it on a page using the Start Walkthrough action. Follow the steps below to add this action on page load. 1. Walkthroughs are generally presented immediately upon page load. Therefore, open the page where you would like the walkthrough to be shown. 2. Select **Actions** from the Properties panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Ensure **On Page Load** is selected and click **+ Add Action**. 4. On the right side, search and select the **Walkthrough > Start Walkthrough** (under *Widget/UI Interactions*) action. 5. Click **Select Walkthrough** and choose the walkthrough you created.

### 3. Get notified on walkthrough skipped and completed Sometimes, you might want to get a callback to know whether the walkthrough is skipped or completed. For example, you could set up a callback to gather analytics or trigger a specific action once the walkthrough is finished, such as directing the user to a new page or enabling certain features of the app. When a walkthrough is added on a page, you'll see the following types of actions, also called callbacks, and you can choose any of them to add actions under it. - **On Walkthrough Complete**: Actions added here run when the user finishes all the steps of the walkthrough. - **On Walkthrough Skip**: Actions added here run when the user chooses to skip the walkthrough. ### Video guide If you prefer watching a video tutorial, here's the one for you:

### FAQs
How do I fix a walkthrough that is misaligned or not focusing on the correct widget?

This issue typically arises when a widget's animation and the walkthrough start simultaneously. As the walkthrough initiates, it captures the widget's initial position before the animation completes. Consequently, after the animation concludes, the widget may have shifted to a different location, leading to misalignment. ![Misaligned focus example](https://docs.flutterflow.io/assets/images/misaligned-focus-example-6d9b679571907534c9414fbf5e9640d2.png) To resolve this, simply add a delay ([Wait](https://docs.flutterflow.io/resources/time-based-logic/wait-action) action) before initiating the walkthrough. Make sure the wait duration is equal to or greater than the duration of the animation. ![fix-align-issues](https://docs.flutterflow.io/assets/images/fix-align-issues-584e5e3b4e0a4f7fd89b3cb1cfc08470.avif)

My widget is not highlighting on a scrollable page. What should I do?

We are aware of a limitation where widgets that are not visible on a page (i.e., you need to scroll down to see them) may not be highlighted. We are actively working to resolve this issue. As a temporary workaround, you can try placing the widget in an area that is visible without scrolling. We appreciate your patience and hope to have a fix soon!

# Pinning Projects to Stable FlutterFlow Studio Versions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/settings/flutterflow-version-management Learn how to manage the FlutterFlow Studio version used for your project. FlutterFlow Studio is constantly evolving to provide new features, address bugs, and keep up-to-date with Flutter and third-party packages. However, frequent updates can introduce unwanted changes that break existing projects—especially those that rely on custom code with external dependencies. To mitigate these issues, FlutterFlow Studio offers a **version management** system that allows you to pin your project to a particular [*stable release*](#stable-release) of FlutterFlow Studio. Projects pinned to a stable release will **not automatically receive the latest FlutterFlow Studio updates**, giving you more control over your development workflow. However, pinning to a stable release means that you will not be able to use the latest features, and there may be bugs that are not fixed until subsequent releases. **We only recommend doing this if you have a complex app with custom code dependencies.** :::note Currently, the ability to pin a FlutterFlow Studio project to a stable version is only available to **Enterprise** users. ::: ## When should you pin your project to a stable version? Pinning your project to a stable version of FlutterFlow Studio offers the following benefits: - **Prevents Unexpected Breakages:** FlutterFlow Studio updates can introduce errors into your project—particularly when you have custom code. Pinning to a stable release reduces the risk of unexpected changes to your project. - **Gives Control Over Update Timing:** FlutterFlow Studio updates might occur at inopportune times (e.g. right before you plan to release a new version of your application). Pinning your project to a stable version allows you to choose **when** to move your project to a newer release. ## Key Concepts To understand FlutterFlow Studio's version management system, it's important to understand **Semantic Versioning**. FlutterFlow Studio tends to release a new version of the product each week. When a new version is released, the overall version number is incremented. The version number consists of three parts: - **Major Version:** Incremented when introducing substantial changes that significantly alter the product. - **Minor Version:** Incremented for changes that notably enhance or modify the FlutterFlow Studio development experience—such as upgrading to a new Flutter version, making substantial modifications to generated code or project structure, or introducing major new features. - **Patch Version:** Incremented with routine releases that include bug fixes and minor improvements, ensuring stability without introducing breaking changes to the generated code or project structure. ![semantic_versioning](https://docs.flutterflow.io/assets/images/semantic-versioning-3f848e936e19cadc1ed2794d526f90a6.png) You can see what version of FlutterFlow Studio you are using by looking at the top left hand corner of the builder. ![version-in-builder](https://docs.flutterflow.io/assets/images/version-in-builder-71d2a435efdc7c2bf6b31f4fdb98aa4c.png) #### Standard Release A **Standard Release** of FlutterFlow Studio is released approximately every week. However, this is subject to change based on user needs. When your project is **not pinned** to a stable release (default behavior), you will automatically use the **latest standard release.** #### Stable Release A **Stable Release** of FlutterFlow Studio is published monthly if any of the following conditions are met: - Significant changes have been made to project code generation. - The underlying Flutter version or Pubspec dependencies in generated projects have been updated. - Updates affecting the project structure have been introduced (e.g., the addition of a new widget type). Each stable release is assigned a unique **Major.Minor** version number. Projects that have not been edited in a FlutterFlow Studio version with a **Major.Minor** version higher than the stable release can be pinned to that stable version. :::note Each stable release will be supported for **6 months** before you are forced to upgrade to the next stable version. ::: ## Pinning Your Project To pin your project, navigate to **Settings and Integrations > General > App Details >Version Pinning** section and select the stable release you want to lock into. ![pin-version](https://docs.flutterflow.io/assets/images/pin-version-cdb7d124a32829412c61bf793850b532.avif) ### Modifying the Pinned Version You have several options when it comes to modifying pinned version of your project: - **Upgrade to more recent Stable Version**: When a new stable version is released, you will see it as an option in the dropdown shown above. You can upgrade the pinned version to a more recent stable version whenever it becomes available. Newer stable versions will have higher numbers (i.e., 5.1 is newer than 5.0) - **Set to *Latest Version* (Unpinned):** You can unpin your project by setting it to the *Latest Version* which will use the latest [standard release](#standard-release). - **Opt-in to the *Next Stable*:** Your project may be on a standard version that does not have a corresponding stable version (i.e., you are on 5.0.1 but the 5.0 stable will correspond to 5.0.4). In that case, you can choose to opt-in to the *Next Stable Version*. If it is already available, it will be pinned to that version immediately. :::caution[Pinning and Unpinning Cannot Be Reversed] Once you unpin a project or pin it to a later version, this action cannot be undone. If you're unsure whether a newer FlutterFlow Studio version will be compatible with your project, we recommend creating a new branch and updating the pinned version within that branch first. This allows you to preview changes before applying them to your main project. ::: ### Accessing the Proper Stable Version As mentioned above, once you update your project to a stable version, you can only edit the project using that version of FlutterFlow Studio. - **For Web**: You will be automatically redirected to the URL for the stable version that your project is pinned to when you open a project from the FlutterFlow Studio dashboard (i.e., navigating to app.flutterflow.io or enterprise-[region].flutterflow.io). - **For Desktop**: You will [**install**](https://www.flutterflow.io/desktop) the dedicated desktop application for the pinned stable release. The desktop app for stable releases won’t auto-update, you will need to install a new version when you upgrade your project to a new stable version. ## Recommended FlutterFlow Studio Version Workflow If you have a complex app with custom code that depends on specific versions of package dependencies, it may be helpful to pin your project to a specific version. This is the workflow we recommend for managing the version of your projects. 1. If you think your project should be pinned to a stable release, choose to [pin a currently available stable version (if any)](#modifying-the-pinned-version). 2. When a new stable version is released, you can choose when you would like to upgrade based on your own release schedule and development process. For instance, you might wait until you're not actively developing a new feature, or you could check the release notes first to see if there are must-have features that would prompt you to upgrade sooner. 3. When you’re ready to upgrade, commit all your changes on main to save your progress. Create a new branch from the main branch, [update the pinned version](#modifying-the-pinned-version), and test all functionalities to ensure compatibility. If any modifications are needed, make those changes in the new branch. 4. Run your app on the platforms you support—using a simulator, emulator, or physical device to ensure everything works as intended. See the [Local Run documentation](https://docs.flutterflow.io/testing/local-run/) for details. 5. If everything looks good, you can merge the new branch into the main branch. However, to merge branches successfully, ensure that both the main branch and the new branch are pinned to the same FlutterFlow Studio version! If for some reason your app is not working as expected, you can choose to leave or close the branch until you are ready to make the modifications needed to support the latest FlutterFlow Studio version (i.e. upgrade dependencies/custom code). :::tip See the video [**here**](https://youtu.be/8Y1uyCC_dXE) for guidance on updating [**dependencies**](https://docs.flutterflow.io/concepts/custom-code#manage-dependencies). ::: ## Version Management with Libraries [Libraries](https://docs.flutterflow.io/resources/projects/libraries) have their own versions. Like projects, libraries edited in FlutterFlow Studio can only be used in FlutterFlow Studio versions greater than or equal to the version it was last edited in. To ensure that new versions of libraries used in a pinned project are compatible with a pinned project, we recommend pinning all libraries used in a pinned project to the same (or lower) Flutterflow version as the pinned project. Library projects can also be pinned to a specific version, ensuring that all library versions use that FlutterFlow Studio release until the pinned version is changed. :::note - Pinned projects cannot add a library with the version set to 'current' or to a library version that has been edited on a later release of FlutterFlow Studio. - Projects cannot be pinned if they contain a library with the version set to 'current' or to a library version that has been edited on a later release of FlutterFlow Studio. ::: :::tip When you import a library into a project or another library, the library’s version must be lower than or equal to the version used for the project it’s being imported into; otherwise, you will encounter an error. ::: ## FAQs
Can I edit my project in multiple versions of FlutterFlow Studio?

No. If your project is not pinned to a specific version, you’ll always use the latest FlutterFlow Studio release. If your project is pinned to a specific version of FlutterFlow Studio, you will be prompted to edit the project in that version.

How often are new stable versions released?

We aim to release new stable versions of FlutterFlow Studio approximately once a month.

How can I see what's included in a new stable version?

We’re currently working on displaying release notes directly in the product, so you can easily review what’s been added or changed in each new stable version.

What if there are bugs in the FlutterFlow Studio version I’m using?

If critical bugs arise, we may provide hotfixes or patches for older FlutterFlow Studio versions. However, some fixes depend on updating the underlying Flutter framework or related dependencies, which isn’t always feasible for older versions. This is a risk of staying on an older version of FlutterFlow Studio as opposed to always using the latest.

Can I change the pinned version to be different for various branches in my project?

Yes, you can pin different versions for different branches. We recommend first creating a new branch, updating it to a later version, making any necessary changes, and verifying that everything works as expected before merging it into your main branch. However, to merge branches successfully, ensure that both the main branch and the new branch are pinned to the same FlutterFlow Studio version.

What happens if there is no stable version available for me to pin my project to?

If your project was created and edited on a [standard release](#standard-release) that does not correspond to a [stable version](#stable-release), you may not see a stable version available. Instead, you can choose to opt-in to the [*next stable release*](#pinning-your-project). If set to the next stable release, a project will immediately be pinned when opened when a new stable release becomes available.

What is the recommended approach if I have multiple projects and libraries that I am working on?

If you choose to pin your project to a stable version of FlutterFlow Studio, we recommend pinning all your projects and dependencies to the same version - and trying to upgrade all projects to the next version around the same time. This makes it easier to ensure compatibilities between projects and libraries that depend on each other. Additionally, this makes it easier to have a single FlutterFlow Studio desktop environment that you are working within.

# Project API > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/settings/project-apis The FlutterFlow Studio Project APIs allow you to programmatically read, write, and validate YAML configuration files through REST endpoints. Using these APIs, you can automate project management tasks, integrate continuous integration and delivery (CI/CD) workflows, and apply bulk configuration updates without manual interactions with the FlutterFlow Studio user interface. The FlutterFlow Studio **Project APIs** allow you to programmatically read, write, and validate YAML configuration files through REST endpoints. Using these APIs, you can automate project management tasks, integrate continuous integration and delivery (CI/CD) workflows, and apply bulk configuration updates without manual interactions with the FlutterFlow Studio user interface. :::caution The Project API is currently in beta and may undergo changes that could affect functionality or compatibility. ::: :::note[Prerequisites] Before using the Project YAML API, make sure you have the following: - **HTTP Client**: Use a tool like `curl`, [**Postman**](https://www.postman.com/), or an HTTP library in your preferred programming language (e.g., `axios`, `requests`). - **Project Access**: You must have read access for GET/validation operations and an editor access for making updates to the project. - **Paid Plan**: You need a paid [**FlutterFlow Studio subscription plan**](https://www.flutterflow.io/pricing). ::: ## YAML Overview ### What are FlutterFlow Studio Project YAMLs? YAML (YAML Ain't Markup Language) is a human-readable data serialization format commonly used for configuration files. In FlutterFlow Studio, **Project YAMLs represent the complete structural definition of your app,** essentially exposing the full project schema that powers your FlutterFlow Studio app. ### What's Included in the Project Schema? FlutterFlow Studio's YAML files contain a comprehensive representation of your entire project, including: - **UI Components & Pages**: Widget trees, page layouts, component hierarchies, and styling configurations. - **App Configuration**: Settings like app details, authentication methods, integrations (AdMob, Firebase, etc.) - **Data Structures**: Database collections, API schemas, app state variables, and custom data types. - **Business Logic**: Actions, functions, conditional logic, and workflow definitions. - **Assets & Resources**: Custom code files, image references, fonts, and other project assets. - **Project Organization**: Folder structures, component libraries, and project metadata. ### YAML vs. FlutterFlow Studio UI Every change you make in the FlutterFlow Studio visual editor — from dragging a widget onto a page to configuring a database collection, is ultimately stored as structured data in these YAML files. The FlutterFlow Studio UI provides an intuitive visual interface for editing this underlying schema, while the Project API gives you direct programmatic access to the same data. ### File Structure FlutterFlow Studio automatically partitions your project into logical YAML files for optimal performance and organization. Each file represents a specific aspect of your project (e.g., `app-state`, `ad-mob`, individual pages, collections, etc.), making it easy to target specific updates without affecting the entire project. ## Base URL FlutterFlow Studio provides different API endpoints for various environments. Use the appropriate base URL below depending on your needs: **Production** ```jsx https://api.flutterflow.io/v2/ ``` **Beta/Staging** ```jsx https://api.flutterflow.io/v2-staging/ ``` **Enterprise** **India** ```jsx https://api-enterprise-india.flutterflow.io/v2/ ``` **APAC** ```jsx https://api-enterprise-apac.flutterflow.io/v2/ ``` **US Central** ```jsx https://api-enterprise-us-central.flutterflow.io/v2/ ``` **Europe** ```jsx https://api-enterprise-europe.flutterflow.io/v2/ ``` ## Authentication All API endpoints require authentication using a Bearer token. You'll need to include your FlutterFlow Studio API token in the Authorization header of each request. See [how to get the API Token](https://docs.flutterflow.io/accounts-billing/account-management#how-do-i-generate-an-api-token). ```jsx Authorization: Bearer YOUR_API_TOKEN_HERE ``` ## API Endpoints Below is a list of available API endpoints with their methods and usage descriptions. | Endpoint | Method | Purpose | | --------------------------- | ------ | --------------------------------------------- | | `/listPartitionedFileNames` | GET | List available YAML file names for a project. | | `/l/listProjects` | POST | Retrieve metadata for all projects. | | `/projectYamls` | GET | Export/download YAML files from a project. | | `/validateProjectYaml` | POST | Validate YAML content before applying changes. | | `/updateProjectByYaml` | POST | Update project configuration via YAML. | ### List File Names Before you read or update project files, you need to know what YAML files are available. This endpoint returns a full list of file names associated with your FlutterFlow Studio project. #### Endpoint `GET /listPartitionedFileNames` #### Query Parameters `projectId` (required): The ID of the FlutterFlow Studio project #### Response ```jsx { "success":true, "reason":null, "value":{ "versionInfo": { "partitionerVersion": 6, "projectSchemaFingerprint": "abc123" }, "fileNames": [ "folders", "app-details", "collections/id-yr7z6g5a", "page/id-Scaffold_l9g6ilb6/page-widget-tree-outline/node/id-Column_174wuhc4", "custom-file/id-MAIN/custom-file-code", ... ] } } ``` The `fileNames` array lists out all the available YAML files. The `versionInfo` section provides metadata about the schema version and its unique fingerprint. If any part of `versionInfo` changes, it indicates that the API or the structure of the YAML responses has been updated. #### Example Usage ```jsx curl -X GET \ 'https://api.flutterflow.io/v2/listPartitionedFileNames?projectId=your-project-id' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` ### List Projects This endpoint retrieves a list of FlutterFlow Studio projects associated with your account, including detailed metadata such as project name, owner email, team info, collaboration settings, and versioning data. #### Endpoint `POST /l/listProjects` #### Request Body ```jsx { "project_type": "ALL", "deserialize_response": true } ``` - **`project_type: "ALL"`**: Use "ALL" to include personal, team, and shared projects, or "TEAM_RESOURCE" to include only team-associated projects. - **`deserialize_response: true`**: Ensures the response is returned as human-readable JSON instead of a base64-encoded protobuf. :::tip It’s recommended to use the default options: `"ALL"` for `project_type` and `true` for `deserialize_response` for the most complete and readable results. ::: #### Response Returns a JSON object containing an array of projects under the `entries` key. Each entry contains the project ID and rich metadata, including collaborators, app icons, sessions, and branching information. ```jsx { "success": true, "reason": null, "value": { "entries": [ { "id": "XXXXXXXXXXXXXXX", "project": { "name": "Sample Project A", "ownerEmail": "user1@example.com", "createdAt": "2024-08-08T11:01:12.427Z", "updatedAt": "2024-08-08T11:01:18.669Z", "teamRef": { "path": "teams/TEAM_ID_1" }, "mainBranchRef": { "path": "projects/sample-project-id" }, "numBranches": 2, "otherMembers": { "USER_XYZ": { "email": "editor1@example.com", "accessLevel": "EDITOR" } }, "activeSessions": { "SESSION_ID_1": { "lastSuccessfulUpdate": "2024-08-06T18:41:56.569Z" } }, "totalNumUpdates": 2177 } } ] } } ``` #### Example Usage ```jsx curl 'https://api.flutterflow.io/v2/l/listProjects' \ -H 'authorization: Bearer YOUR_API_TOKEN' \ --data-raw '{ "project_type": "ALL", "deserialize_response": true }' ``` ### Download Project YAML You can download specific or all YAML configuration files from your FlutterFlow Studio project. This helps in understanding the current structure of the file before modifying it. #### Endpoint `GET /projectYamls` #### Query Parameters - `projectId` (required): The ID of the FlutterFlow Studio project - `fileName` (optional): Specific file to export (without extension). If not provided, all files are exported. #### Response Returns a zip file encoded as a base64 string. You will need to manually decode this base64 data into a downloadable .zip file. To do so, copy the value of `projectYamlBytes` and then you can use online tools such as [base64.guru](https://base64.guru/converter/decode/file) or [b64encode.com](https://b64encode.com/tools/base64-to-zip/) to convert and download the files. ```jsx { "success":true, "reason":null, "value":{ "versionInfo": { "partitionerVersion": 6, "projectSchemaFingerprint": "abc123" }, "projectYamlBytes": "UEsDBAoAAAAAAKxV..." } } ``` #### Example Usage ```jsx # Export all YAML files curl -X GET \ 'https://api.flutterflow.io/v2/projectYamls?projectId=your-project-id' \ -H 'Authorization: Bearer YOUR_API_TOKEN' # Export specific file curl -X GET \ 'https://api.flutterflow.io/v2/projectYamls?projectId=your-project-id&fileName=ad-mob' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` ### Validate Project YAML You must validate the YAML content before applying changes to ensure it's properly formatted and contains valid values. #### Endpoint `POST /validateProjectYaml` #### Request Body ```jsx { "projectId": "your-project-id", "fileKey": "ad-mob", "fileContent": "showTestAds: false\nappId: \"your-app-id\"" } ``` :::note - In the `fileContent` object, you must provide the **entire content** of the file. - The YAML content must be passed as a **single-line string** with correct formatting and appropriate escaping for new lines and indentation. For example, in the following `fileContent` object, you see the actual multiline YAML content, which is not allowed ❌. ```jsx { "projectId": "ecommerce-flow-app-ie7nl6", "fileKey": "app-state", "fileContent": "fields: - parameter: identifier: name: myAppState key: hg7j8z0y dataType: scalarType: String description: "Stores the current user session state" persisted: false" } ``` Now, here’s how the YAML content should be passed (i.e., as single line string ✅). ```jsx { "projectId": "ecommerce-flow-app-ie7nl6", "fileKey": "app-state", "fileContent": "fields:\n - parameter:\n identifier:\n name: myAppState\n key: hg7j8z0y\n dataType:\n scalarType: String\n description: \"Stores the current user session state\"\n persisted: false" } ``` ::: #### Response - **Success (200):** YAML is valid - `{"success": true, "reason": null, "value": ""}` - **Error with validation details:** ```jsx { "validationErrors": [ { "message": "Expected bool value", "fileKey": "ad-mob", "yamlLocation": { "line": 1, "column": 15 } } ] } ``` #### Example Usage ```jsx curl -X POST \ 'https://api.flutterflow.io/v2/validateProjectYaml' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "projectId": "your-project-id", "fileKey": "ad-mob", "fileContent": "showTestAds: false" }' ``` ### Update Project YAML This endpoint allows you to overwrite existing files in your FlutterFlow Studio project by submitting updated YAML content. #### Endpoint `POST /updateProjectByYaml` #### Request Body ```jsx { "projectId": "your-project-id", "fileKeyToContent": { "ad-mob": "showTestAds: false", } } ``` :::note - In the `fileKeyToContent` object, you must provide the **entire content** of the file. - The YAML content must be passed as a **single-line string** with correct formatting and appropriate escaping for newlines and indentation. For example, in the following `fileKeyToContent` object, you see the actual multiline YAML content, which is not allowed ❌. ```jsx { "projectId": "ecommerce-flow-app-ie7nl6", "fileKeyToContent": { "app-state": "fields: - parameter: identifier: name: myAppState key: hg7j8z0y dataType: scalarType: String description: "Stores the current user session state" persisted: false" } } ``` Now, here’s how the YAML content should be passed (i.e., as single line string ✅). ```jsx { "projectId": "ecommerce-flow-app-ie7nl6", "fileKeyToContent": { "app-state": "fields:\n - parameter:\n identifier:\n name: myAppState\n key: hg7j8z0y\n dataType:\n scalarType: String\n description: \"Stores the current user session state\"\n persisted: false" } } ``` ::: #### Response - **Success (200):** `{"success": true, "reason": null, "value": ""}` - **Error (400):** Validation errors or malformed request. - **Error (403):** Insufficient permissions or project locked. - **Error (404):** Project or user not found. #### Example Usage This example updates the `ad-mob` file and adds/updates app state variables. ```jsx curl -X POST \ 'https://api.flutterflow.io/v2/updateProjectByYaml' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "projectId": "your-project-id", "fileKeyToContent": { "ad-mob": "showTestAds: false", "app-state": "fields:\n - parameter:\n identifier:\n name: myAppState\n key: hg7j8z0y\n dataType:\n scalarType: String\n description: \"Stores the current user session state\"\n persisted: false\n - parameter:\n identifier:\n name: userPreferences\n key: abc123xy\n dataType:\n scalarType: JSON\n description: \"User settings and preferences\"\n persisted: true" } }' ``` ## API Usage Example Let’s walk through a practical example of updating an app state variable using the Project APIs. :::note You can download and use Postman Collection to quickly test all FlutterFlow Studio Project APIs with pre-filled headers, parameters, and sample requests. ::: First, we use the `/listPartitionedFileNames` endpoint to check if the `app-state` file exists in the project. Once confirmed, we call the `/projectYamls` endpoint to download the YAML file. The API returns a base64-encoded string representing a zip file, which we decode and download using tools like [Base64 to ZIP](https://b64encode.com/tools/base64-to-zip/).

Next, we open the `app-state.yaml` file and update the `enableDarkMode` variable by setting its `persisted` value to `true`. We then convert the updated YAML into a properly escaped single line string and validate it using the `/validateProjectYaml` endpoint. If validation succeeds, we send the final update using the `/updateProjectByYaml` endpoint.

## Error Handling This section outlines how the API handles errors, including common HTTP response codes and detailed validation feedback for YAML processing issues. ### Common Error Responses This table outlines the most common HTTP status codes and their meanings, helping you identify and resolve API issues more effectively. | Status Code | Description | Example Response | | ----------- | -------------------------------------------- | -------------------------------------------------------- | | 400 | Bad Request - Invalid JSON or malformed YAML | `"Failed to update project: ad-mob:Expected bool value"` | | 403 | Forbidden - Insufficient permissions | `"You do not have write access to this project"` | | 404 | Not Found - Project or user doesn't exist | `"Project not found"` | | 500 | Internal Server Error | `"Unknown error"` | ### Validation Errors When YAML validation fails, you'll receive detailed error information: ```jsx { "validationErrors": [ { "message": "Unknown field name 'showTestAdsasssdaf'", "fileKey": "ad-mob", "yamlLocation": { "line": 1, "column": 1 } } ] } ``` ## Best Practices - **Always Validate First**: Before updating project YAMLs, use the validation endpoint to ensure your changes are valid: ```jsx # 1. Validate the YAML curl -X POST 'https://api.flutterflow.io/v2/validateProjectYaml' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{"projectId": "project-id", "fileKey": "ad-mob", "fileContent": "showTestAds: false"}' # 2. If validation passes, apply the changes curl -X POST 'https://api.flutterflow.io/v2/updateProjectByYaml' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{"projectId": "project-id", "fileKeyToContent": {"ad-mob": "showTestAds: false"}}' ``` - **Handle Project Locks**: Projects may be temporarily locked during other operations. If you receive a 403 error mentioning `Project is locked due to ongoing changes. Please try again later.`, wait and retry. - **Batch Updates**: You can update multiple files in a single request by including multiple entries in `fileKeyToContent`: ```jsx { "projectId": "your-project-id", "fileKeyToContent": { "ad-mob": "showTestAds: false", "app-settings": "appName: \"Updated Name\"", "authentication": "enableEmailAuth: true" } } ``` ## Rate Limits Please be mindful of API rate limits. If you're making many requests, implement appropriate delays between calls to avoid being rate-limited. # Libraries > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/libraries Learn how to share and reuse entire FlutterFlow Studio projects using libraries. Libraries enable you to share and reuse entire FlutterFlow Studio projects as dependencies across multiple projects. This allows teams and developers to modularize their apps by creating shared libraries that include components, API calls, custom code, and more. By using libraries, development becomes more efficient and scalable. :::note A **Dependency** refers to an external library or resource that your project relies on to function correctly. When you create a new FlutterFlow Studio project, certain dependencies are automatically added to support the generated code. Also, when you use a [**Custom Widget**](https://docs.flutterflow.io/concepts/custom-code/custom-widgets), you are essentially adding dependencies to your project. Libraries take this concept further by allowing you to add entire FlutterFlow Studio projects as dependencies. ::: Imagine you're building an e-commerce app, and different teams are working on various features. One team develops a complex payment system. By using the Libraries, they can publish the payment system as a reusable library and allow other teams to easily import and integrate it into multiple projects without duplicating development efforts. ![libraries.avif](https://docs.flutterflow.io/assets/images/libraries-4e9c4d418929a4bbff1bef0c0df29fae.avif) ### Importance of Libraries Previously, FlutterFlow Studio offered several methods to share resources between projects, such as team code libraries, design systems, API libraries, and by leveraging marketplace items. However, these methods had limitations, including the inability to share custom data types or custom functions alongside components or API calls and the absence of version control. With Libraries, you can publish the complete FlutterFlow Studio project as a library and import it as a dependency into other projects. :::tip[possible use cases] - **Modular Development**: Build large-scale apps by separating them into smaller, independently managed projects (e.g., UI library, backend integrations, etc.). - **Team Collaboration**: Share reusable UI components, custom functions, or API integrations across multiple apps within a team. - **Community Sharing**: Publish libraries that can be imported and reused by the broader FlutterFlow community. ::: ## Publishing a Library To make the resources in your project available for others to use, publish your project as Library. When you publish your project as a Library, your project will become a **Library Project**, and [certain features](#disabled-features-in-a-library) will no longer be available. :::note When you publish your project as Library, it can not be reverted. If you want to restore your project so that it is no longer a Library, you can clone the project. However, things like your deployment and Firestore settings will be cleared. If you want to preserve the state of your project before turning it into a Library, you should clone it first and then publish. ::: To publish a FlutterFlow Studio project as a library, start by creating a FlutterFlow Studio project as you normally would, then follow these steps:

:::note - You can only publish libraries if you have access to [**branching**](https://docs.flutterflow.io/collaboration/branching), which is available to users on **Growth** plan and above. - Releases can only be published from the main branch. From any other branch, you can publish a [**prerelease**](#prerelease-versions) to test in-progress work. Each published version is linked to a specific commit, ensuring robust version control. - You must commit your changes before publishing a new version of the library. - It's recommended to include a message that tells users what has changed in the version your are publishing. ::: :::caution To publish a project as a library, it must meet the following requirements: - **No Prior Store Deployment**: The project must not have been deployed to the Google Play Store or Apple App Store. - **No Failed Deployments**: The Publish button remains disabled if a deployment process was started and failed. - **No Errors or Warnings**: All project errors or warnings must be addressed beforehand. - **Main Branch Only**: You can only publish a release from the main branch. Other branches can publish only [prereleases](#prerelease-versions). - [**Paid Plan**](https://www.flutterflow.io/pricing): Subscription to one of the paid plans is required to publish a project as a Library. - **Not Cloned from Marketplace**: The project cannot be a clone of a Marketplace item. ::: ### Disabled Features in a Library When a project is converted into a library, the following features are disabled to ensure compatibility and functionality limitations: - App settings - Supabase - Development environments - Authentication - Push notifications - Mobile deployment - Web deployment - Stripe - Braintree - Razorpay - Google Analytics - OneSignal - Mux ## Importing a Library To import a library project into another FlutterFlow Studio project, you must go **Settings and Integrations** > **Project Setup** > **Project Dependencies** . Here you can specify the library project and version you are importing.

:::note - You can only select a library if you have at least read access on the library project. - For a library project to show in the drop down, you must be added as a collaborator on the project and the library project must have a published version. - You can import publicly accessible libraries by specifying the project ID in the text field when adding a library dependency. - By default, the latest published release of the library is imported, but you can choose to depend on an earlier version if needed. A [prerelease](#prerelease-versions) is never imported by default. - You can also import the `current` version of the library to use the latest state of the library on the main branch - however, this is not recommended. - When importing a library into a project or another library, the library’s version must not be set to 'current' and should be less than or equal to the FlutterFlow Studio version of the project or library it’s being imported into. Learn more about [**managing Library’s FlutterFlow Studio version**](https://docs.flutterflow.io/resources/projects/settings/flutterflow-version-management#version-management-with-libraries). ::: ### Dependency Conflicts A **Dependency Conflict** occurs when two or more libraries added by a project depend on different versions of the same dependency. This creates a situation where the project cannot resolve which version to use, leading to a project error. ![dependency-conflict.avif](https://docs.flutterflow.io/assets/images/dependency-conflict-68c1edda9693988f306551e329bff394.avif) Let's say you are building an eCommerce app that uses multiple libraries for different purposes: - **User Auth Library** is used for handling user authentication. - **Payment Gateway Library** is used for managing the payment gateway. Both library projects depend on a common library called **Components Library** but imports different versions respectively: - **User Auth Library** depends on `Components Library v1.5.0`. - **Payment Gateway Library** depends on `Components Library v2.0.0`. In this scenario, the eCommerce project will detect the dependency conflict because it can't add both `v1.5.0` and `v2.0.0` of the Components Library at the same time. #### Fixing Dependency Conflicts Follow these steps to ensure both libraries rely on the same version of Components Library: 1. **Upgrade both libraries**: If updates are available, start by upgrading both the User Auth Library and Payment Gateway Library to their latest versions. Often, newer versions of libraries are designed to use the latest version of the Components Library, which can help resolve conflicts. 2. **Modify Libraries**: If you have access to the library projects, adjust the dependencies of either User Auth Library or Payment Gateway Library (or both) to use the same version of the Components Library. 3. **Contact Library Maintainers**: If you do not own the library yourself, reach out to the maintainers of the library projects. They may provide guidance, suggest workarounds, or release a version that addresses the conflict. ## Access Library Resources Once the library is imported, following resources are accessible for use: - [Components](https://docs.flutterflow.io/resources/ui/components) - [Data Types & Enums](https://docs.flutterflow.io/resources/data-representation/custom-data-types) - [App State Variables](https://docs.flutterflow.io/resources/data-representation/app-state) - [Constants](https://docs.flutterflow.io/resources/data-representation/constants) - [API Calls](https://docs.flutterflow.io/resources/backend-logic/rest-api) - [Action Blocks](https://docs.flutterflow.io/resources/functions/action-blocks) - [Custom Functions](https://docs.flutterflow.io/concepts/custom-code/custom-functions), [Actions](https://docs.flutterflow.io/resources/functions/action-flow-editor), and [Widgets](https://docs.flutterflow.io/resources/ui/widgets) - [Assets](https://docs.flutterflow.io/resources/projects/settings/general-settings#app-assets) (Note: These are not versioned) - [Code Files](https://docs.flutterflow.io/concepts/custom-code/code-file) :::note - [**Pages**](https://docs.flutterflow.io/resources/ui/pages) and [**Cloud Functions**](https://docs.flutterflow.io/concepts/custom-code/cloud-functions) are still being worked on and may come in future updates. - [**Firestore Collections**](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections) from a library appear in your project as read-only. Learn more in [Library Collections in Your Project](#library-collections-in-your-project). - Creation of [**AI Agents**](https://docs.flutterflow.io/integrations/ai-agents) is not yet supported in the Library project ::: It's important to note that these resources show up where they are instantiated. For example: - **Components** appear in the widget palette. - **API calls** appear when making API calls in the action flow editor. - **Custom Functions** are available when setting up actions or functions within the app. - **Code Files** (Dart files containing classes or enums) become available when [creating instances](https://docs.flutterflow.io/concepts/custom-code/code-file#create-custom-class-instance), allowing you to access their fields and methods. They also appear in the action flow editor when adding [custom class actions](https://docs.flutterflow.io/concepts/custom-code/code-file#set-field-action). This ensures that only relevant resources are shown where they are needed, optimizing performance and discoverability. :::tip[Access Library Components in Custom Code] When your project includes a library dependency, you can use its components—such as Library App State, Library Values, Library Custom Code resources, etc.—in your custom code. Explore the **[Common Custom Code Examples](https://docs.flutterflow.io/concepts/custom-code/common-examples#access-library-components-in-custom-code)** directory for reference. ::: ![access-library-resources.avif](https://docs.flutterflow.io/assets/images/access-library-resources-6cdcb108936bad7eb864b8412170abe6.avif) ## Library Versioning Library versioning allows you to manage different versions of a library project over time. Using versioning, library users can control which version of a library to use in a project, ensuring compatibility and reducing the risk of breaking changes. :::note[Importance of Library Versioning] - **Maintain Backward Compatibility**: It ensures older versions of the library continue to work as expected while introducing new features. - **Roll Back Changes**: In case of bugs or issues in a new version, you can easily revert to a previous stable version. - **Control Updates**: Library users can decide when to upgrade to the latest version, rather than being forced into changes. ::: ### Publish New Version When you're ready to update your library, ensure that all modifications are committed to the main branch of the library project and then publish as per instructions [here](#publishing-a-library). :::tip - While publishing a new version, add a description to highlight what's new or changed in this version. - Each time a new version is published, the version number will automatically increment. ::: ### Import Specific Version When importing a library into a project, you have the flexibility to choose which version of the library to use. By default, the latest version will be selected. ![import-specific-library-version.avif](https://docs.flutterflow.io/assets/images/import-specific-library-version-3c6f3149e6ac482344617db9bada7cf6.avif) ### Update to Latest Version You can easily upgrade to newer versions of the libraries as they become available. :::tip - If a new update causes issues with your existing implementation, you also have the option to revert to a previous version. - Always test your app after upgrading to ensure that the new library version works well with your existing project. ::: ![update-library](https://docs.flutterflow.io/assets/images/update-library-4edeaa44ed91b4f37ecce0b86b1bac00.avif) ### Prerelease Versions A prerelease is a version of a library that you publish from a non-main branch. It lets you test in-progress library work in another project without merging to the main branch or publishing a release. A prerelease version has a label after the version number, such as `1.2.4-checkout-redesign`. #### Publish a Prerelease 1. Open the library project on the branch that has the changes you want to test. 2. Go to **Settings and Integrations > App Settings > Publish as Library**. 3. In the **Version** field, enter a prerelease version. FlutterFlow Studio suggests one for you, based on the next patch version and the branch name (for example, `1.2.4-my-branch`). If you publish again from the same branch, the suggestion includes a numeric suffix (for example, `1.2.4-my-branch.2`). 4. Optionally, enter a **Description** of the changes. 5. Click **Publish Prerelease**. If you have uncommitted changes, the button reads **Commit Changes and Publish** and commits them first. ![Publish a prerelease version of a library](https://docs.flutterflow.io/assets/images/publish-prerelease-d09d032e4ce5a5a6cfe4fee6004bf772.avif) :::note The following rules apply to the version: - On the main branch, you can publish only releases (for example, `1.2.4`). On a non-main branch, you can publish only prereleases. - You can publish each version only once. - The version must be higher than the highest published release of the library. A prerelease ranks lower than the release with the same number. For example, `1.2.4-my-branch` is lower than `1.2.4`. FlutterFlow Studio compares prereleases only against releases. Prereleases from different branches don't block each other or the next release. ::: The published prerelease is listed in the publish history with a **Prerelease** badge. Hover over the badge to see the branch it was published from. #### Test a Prerelease in Another Project Prereleases are hidden by default to prevent accidental selection. 1. In the project that uses the library, go to **Settings and Integrations > Project Setup > Project Dependencies**. 2. Turn on **Show prerelease versions**. This toggle appears only when one of your libraries has a prerelease. 3. In the **Version** column, open the version dropdown for the library and select the prerelease. Prerelease versions appear in a warning color in the dropdown and the dependency list. Hover over the information icon next to a prerelease to see the branch it was published from. ![Select a library prerelease version in Project Dependencies](https://docs.flutterflow.io/assets/images/test-prerelease-in-another-project-27c7981607522975974251f42b3de19c.avif) :::note Prereleases differ from releases in these ways: - FlutterFlow Studio never offers a prerelease through **Upgrade to latest** and never selects one when you add a library without choosing a version. - A library that has published only prereleases has no release to use by default. Select a specific prerelease, or ask the library owner to publish a release. - While a project depends on a prerelease, the project shows a warning that you can dismiss. The warning doesn't prevent you from running or building the app. Before deploying, switch to a release version. ::: ### See Which Projects Use Your Library After you publish at least one version, the **Used By** section appears below **Publish History** on **Settings and Integrations > App Settings > Publish as Library** in the library project. It lists each project that depends on your library, with these columns: - **Project**: The project name. Select it to open the project. - **Version**: The library version the project uses. **Current** means the project uses the library project's current content, including changes you haven't published, rather than a published version. - **Last Edited**: When the project was last edited. The Used By section lists the Vitalize project, library version 0.0.8, and its last-edited time. The list has these limits: - It includes only projects you have access to. FlutterFlow Studio doesn't show other projects, or how many there are. - It includes only projects that depend on the library directly, not projects that use it through another library. - It shows the main project, not its branches. - A project that added your library before this list existed appears after someone opens or saves it. - If the library has more dependents than FlutterFlow Studio can check at once, the list can be incomplete, and a note says so. In the desktop app, selecting a project name opens the project in the editor. To open it in the web editor instead, hold Cmd (Ctrl on Windows) while you select the name. In the browser, the project opens in a new tab. ## Library Pages When you publish a library, all the pages included in the library become available for use in the consumer project. These pages function like any regular project page in your app; they support navigation, parameters, state management, and transitions. Library Pages offers a modular approach to development, making it ideal for large teams and complex, multi-feature apps. For example, instead of recreating common flows like onboarding and payment flows, you can build them in a library once and use them wherever needed. :::tip[Possible Use Cases] - **Super Apps** like Gojek and Uber with distinct modules such as ride booking, shopping, and payments. Each module can be developed as a separate library and imported into a single main project. - **Enterprise Apps** with isolated user journeys for different roles, such as admin and customer. Each role-based flow can be built as its own library and integrated into the core app as needed. - **White-labeled Apps** that share common onboarding flows can benefit from libraries. The onboarding process can be built once as a library and reused across all branded versions of the app. ::: When users import or update the library, they can override the default route names to prevent conflicts between the library and their project. Library pages then appear in navigation actions just like any regular page.

### Library Pages in NavBar Library pages can also be used in the NavBar, allowing users to add reusable flows into the app’s primary navigation structure. For example, in a Super App, you can import ride booking, food delivery, or payment pages from separate libraries and add them directly to the bottom navigation, giving users quick access to each module. :::tip Want to learn more about building modular Super Apps using libraries? Check out our [**blog post**](https://blog.flutterflow.io/scaling-super-apps-modular-architecture-with-flutterflow-libraries/). ::: To display a library page on the NavBar, navigate to **Project Dependencies > FlutterFlow Studio Libraries**, then click on **Pages** for the relevant library to open its details. In the list of pages, locate the desired page and click **Nav Bar Settings**, then enable **Show on NavBar**. You can also customize additional settings, such as label and icon, as needed. To confirm, go to the **Nav Bar & App Bar** section, where you’ll see the library page listed as part of the NavBar items. :::note NavBar settings for regular pages are available directly within the Page Settings panel in the builder. However, for Library pages, these settings are managed through the Library Details dialog. ![NavBar-settings-for-regular-and-library-page](https://docs.flutterflow.io/assets/images/NavBar-settings-for-regular-and-library-page-967f2d0fbad3c9b44fc0eaca26d923ea.avif) :::

## Library Values **Library values** are essentially variables created and used by a library author and intended to have their values set by the library user. These values allow library author to create configurable variables that are useful in different contexts, such as public or client-side API keys, global settings, or other project-specific configurations. These values allow library users to input specific data required for the library to function properly in their project. For example, if someone builds a payment gateway library, they might define Library Values for configuration settings, such as: - Default currency: USD - Region: US - Default Payment method: Card This allows the user importing the library to provide their own payment preferences without modifying the internal code of the library. :::danger **Library Values should not be used to store private or sensitive data**, such as secret API keys or credentials. These values are not currently designed to securely store or handle sensitive information. The use of *client-side* or *publishable* API key is generally acceptable, because the keys often have limited permissions, rate limits, or are intended for public use. For instance, if someone creates a library that connects to a public weather API, they might define a Library Value for the API key. Users of that library can then input their own API key to make it work. ::: :::tip To avoid misuse on any type credential, make sure to apply appropriate restrictions to limit its usage. For example, see how to [**restrict a Google Maps API key**](https://docs.flutterflow.io/best-practices/secure-api-keys#add-restrictions-to-your-api-key) in the Google Cloud Console. ::: ### Create Library Values as Author The library author defines the variable name, data type (e.g., string, enum), whether the variable is nullable, and an optional default value. To create library values, navigate to **Settings and Integrations > App Settings > Publish as Library > Library Values** section and click **+ Add Value**.

#### Use Library Values After setting Library Values, they function just like any other variable in FlutterFlow Studio. You can bind them to components, actions, API calls, or any property that allows you to configure dynamic values across your library project. You can access Library Values via the ****Set from Variable**** menu. :::tip Library values are used only within the library project and are not available for use in the project that imports it. The library user can only set their values. ::: ![access-library-values](https://docs.flutterflow.io/assets/images/access-library-values-f087d40c48ba05c7809df5287da630b3.avif) ### Set Library Values as User To set library values, navigate to **Settings and Integrations > Project Setup > Project Dependencies** page. When you import a library, you'll be prompted to set values for required Library Values. If the library has already been added, click on **View Details**, which will open a dialog and then you can enter a value.

:::tip For different [**development environments**](https://docs.flutterflow.io/testing/dev-environments) (e.g., development vs. production), you can bind Library Values to [**environment values**](https://docs.flutterflow.io/testing/dev-environments#environment-values). For instance, you could have two different Library Values for an API key, such as `DEV_OPENAI_API_KEY` and `PROD_OPENAI_API_KEY`, and bind them to the development and production environments to track API usage separately. ::: ## Libraries with Firebase You can create collections and enable various Firebase features in library projects without connecting a separate Firebase project. In library projects, you won’t see an option to link to a Firebase project. Instead, the project that imports the library handles the actual Firebase connection. Any indexes or security rules defined in the library are recognized by the importing project and deployed accordingly. ### Library Collections in Your Project Firestore collections defined in a library appear in any project that imports the library. To see them, open the Firestore page in the importing project and go to the **Collections** view. - Library collections are listed under the name of their library, after your project's own collections. Subcollections are grouped under their parent collection. - Select a library collection to open its schema. The view shows the collection name, a badge with the library name, and each field's name and data type under **Field Name** and **Data Type**. - Library collection schemas are read-only in the importing project. To change a schema, click **Open Library Project**, which opens the library project in a new tab. - If your project has no collections of its own, the view opens on the first library collection instead of showing **No Collections Created**. The collection schemas remain defined in the library rather than becoming your project's own collection schemas. :::caution[Limitations] Libraries work with Firebase but have **some limitations**. The **Firebase Auth** and **Firebase Storage** are not directly supported in library projects at this time. If you need these features in your library’s functionality, you can include an action that accomplishes this task as a [**callback**](https://docs.flutterflow.io/resources/ui/components/callbacks). ::: If your team has multiple projects that share a common Firebase feature, turning it into a library is a great idea. This ensures the same logic is used and connects to the same Firestore project across all apps. Here are some examples of library projects you can build with Firebase: - **Basic Analytics or Tracking**: A library that logs events to Firestore; useful for aggregating usage data at an application level. - **Configuration or Settings**: A library that serves app-wide configurations (like feature flags, UI themes, or layout choices) is handled in Firebase Remote Config. ## FAQs
What will happen to existing team libraries?

Team code and API libraries will be migrated to library Projects. These projects will be imported as a library with the latest version specified as the version. The components within team design systems will move into their own projects, while design systems will continue to exist but only containing the theme settings.

Do libraries work with Marketplace?

Yes, you can add and import a Marketplace project as a library.

How do libraries work with themes (design systems)?

By default, the design system of the parent project takes precedence over the imported library's design system. If you want to use a library's design system, you must [**select or set the library in the Design System**](https://docs.flutterflow.io/concepts/design-system#adding-design-system) page.

How are API keys shared?

We're working on Library Values, which will allow users to set specific values when they import a library. This feature will be available soon.

How does nested dependencies work?

Projects can import libraries that themselves have imported other Libraries as dependencies. However, if the project and the library share the same dependency, the version must match exactly to avoid conflicts.

Why do I get collision errors when importing a duplicated project as a library?

When you duplicate a project and publish it as a library, the unique identifiers (keys) for components and other resources are not automatically changed. If you then import this library back into the original project, it causes key collisions between the original and duplicated resources. To help with this, FlutterFlow Studio shows a dialog that offers to automatically delete the original resources in your base project and update all references to point to the library versions. If you prefer to resolve this manually, you can duplicate individual components within the library after importing, this will generate new keys and avoid the collision.

# Refactor Project > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/projects/refactor-project Learn how to refactor your project in FlutterFlow Studio. :::tip[PLANS] Refactor Project is only available on the Paid Plans. Check our [**pricing plans**](https://flutterflow.io/pricing). ::: **Refactor Project** is a developer‑focused mode that opens your FlutterFlow Studio project as a set of YAML files so you can perform large-scale edits in a single, consistent operation. For example, if you want to use a custom data type from a Library and update all references, you don’t have to manually edit each page or component. With this mode enabled, you can update all references at once using a single refactor pass. It makes managing large projects easier and more reliable. You can make changes across hundreds of references in just seconds, saving time and effort compared to manual edits. It also lets you preview changes and dismiss anything you don’t want to update. :::tip[possible use cases] - **Type Refactoring**: Rename a custom data type (e.g., `OrderDetails` → `OrderInfo`) across all bindings, forms, and logic in a single pass. - **String Replacement**: Find and replace hardcoded (magic) strings like `"admin"`, `"true"`, or `"completed"` to improve clarity and maintainability. - **Library Migration**: Replace a project-based custom data type (e.g., `UserProfile`) with its Library counterpart throughout the app without manually editing each reference. - **Key Updates**: Update outdated keys—for example, replace all instances of `old_api_key` with the new `new_api_key` value. - **Cleanup Unused Items**: Locate and remove unused fields or stale references (e.g., `oldFieldName`) from your YAML files to keep your project clean. ::: :::note You can refactor the project only if you're on a [**paid plan**](https://www.flutterflow.io/pricing). ::: To refactor a project, go to **Toolbar > Developer Menu > Refactor Project**. You’ll need to commit any unsaved changes before entering the refactor view. This opens your project in a YAML-based editor, where you can search, edit, and replace values across multiple files. You can also use **key reference** search by toggling the **key** icon—currently supported for data types, enums, pages, and components. Changes are color-coded: added lines appear in green, and removed lines appear in red. As you make changes, FlutterFlow Studio provides inline YAML validation to help you catch and fix issues in real time. When you're done, click **Commit** to save the changes. After that, test your app to make sure all widgets, actions, and bindings still work as expected. :::tip You can exclude any item from the replacement by right-clicking on it and selecting **Dismiss**. :::

# UI Building Blocks > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/overview When designing user interfaces in FlutterFlow Studio, understanding the fundamental building When designing user interfaces in FlutterFlow Studio, understanding the fundamental building blocks—ranging from atomic to more complex structures—is crucial. The way UI is structured in FlutterFlow Studio closely resembles the concept of **Atomic Design**, a methodology that segments UI into distinct levels of complexity. In **Atomic Design**, we start with the smallest, indivisible components known as "atoms"—these are your basic building blocks. From there, we combine these atoms to form "molecules," which then come together to create "organisms" or larger functional units. By applying this hierarchical structure to FlutterFlow Studio, we streamline the UI development process, making it both efficient and manageable. Now, let’s explore how this structured approach plays out in FlutterFlow Studio, from the simplest elements to the creation of full-fledged interfaces: - **Atoms** - These are the fundamental building blocks that serve as the foundational elements of the UI. - **Example:** `TextField`, `Button`, `Icon`. - **Molecules** - These are groups of atoms bonded together and are the smallest fundamental units of a compound. These form the basic building blocks of pages but can often be used on their own. - **Example:** `EmailSignInField` (which could include an `TextField` atom and an `Icon` atom). - **Organisms** - These are groups of molecules joined together to form a relatively complex, distinct section of an interface. - Example: `LoginComponent` (which could include the `EmailSignInField` molecule, another similar `PasswordSignInField` molecule, and a `SubmitButton` atom). - **Pages** - Pages are complete screens and represent the final visible output that users interact with. They are composed of smaller units that work together to provide a full experience, including all the necessary functionality and design elements. - **Example**: `SignInPage` Now let's apply the above concepts to what we see in FlutterFlow Studio as we create our first [project](https://docs.flutterflow.io/resources/projects). ## Pages In FlutterFlow Studio projects, a **Page** is essentially a new section or feature of your app that combines various UI elements to form a complete screen in the app. When you create a new project in FlutterFlow Studio, an empty page called `HomePage` is the first thing you see on your canvas. How you define your pages defines the flow of the app and user experience for the user. For example, in our [**E-commerce Demo app**](https://bit.ly/ff-docs-demo-v2), after login, the user lands on `ProductListPage` which has a NavigationBar at the bottom that takes the user to different Pages in the app such as `ProfilePage`, etc. :::note Learn more about creating a new [**Page**](https://docs.flutterflow.io/resources/ui/pages) and using its [**Page Elements**](https://docs.flutterflow.io/resources/ui/pages/scaffold) like AppBar, Drawer, etc. ::: ## Widgets A Page usually contains a combination of widgets and components. ![everything-widget.png](https://docs.flutterflow.io/assets/images/everything-widget-e85b2e0546ad6daf4a5eb16ccff5dac3.png) Let's talk about widgets first, which are the atomic elements or building blocks of the UI structure in FlutterFlow Studio. Each widget can be thought of as an atom or a molecule, depending on its complexity and its parent-child relationship. For example, an atomic widget (such as `TextField`) cannot hold a child element, but molecular widgets (such as `Column` or `Row`) can. :::note Learn more about the [**basic widgets**](https://docs.flutterflow.io/resources/ui/widgets) and how to [**compose widgets**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack) to build more complex UI. ::: ## Components In the idea of atomic design, components in FlutterFlow Studio are similar to "organisms." These organisms are made up of simpler parts called _atoms_ and _molecules_, or simply widgets, which together form useful and reusable parts of the user interface. These components are designed to be reusable, meaning they can be utilized across different screens and projects to provide consistent functionality and aesthetics without the need to recreate them from scratch everytime. :::note Learn more about [**components**](https://docs.flutterflow.io/resources/ui/components) and [**how to use them**](https://docs.flutterflow.io/resources/ui/components/using-components) in pages. ::: ## Classes vs Instances When you add a UI element to your page, you are utilizing widget **classes** and creating **instances** of them. For example, `Icon` is a **widget class**. When you use it in different parts of your application, you're creating an **instance** of the `Icon` widget class and providing different values to it for each use. Think of classes as templates that outline the structure and features of something you want to create multiple times. For instance, in our demo app [EcommerceFlow](https://bit.ly/ff-docs-demo-v2), we have a reusable component called `ProductListCard` with specific characteristics such as image, product information text, and actions it should perform when clicked. Here, we've essentially created a **class**. When you place this `ProductListCard` in different Pages of your app, each one you add is an `instance`. For example, in the `ProductListPage`, we have created an **instance** called `topSellingProductCard` for use in the Top Selling section. Similarly, in the `CategoryProductListPage`, we've created an **instance** called `categoryProductCard`. ![Class-Instance.png](https://docs.flutterflow.io/assets/images/Class-Instance-92597e040b9cfb524243eb8631e8a6d1.png) You can customize each **instance** of your component to perform different actions or to fit different parts of your app, but they all start from the template you created (**the class**). This means you only need to design the `ProductListCard` once and then can reuse and adapt it as needed, simplifying your app development process and ensuring consistency across your project. # Introduction to Pages > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/pages In FlutterFlow Studio, a Page represents a single screen in your app. Under-the-hood pages use a Scaffold, a foundational widget from Flutter that provides a structured layout for a screen within your app. The Scaffold offers essential elements like the AppBar and Body, allowing you to easily build screens. In FlutterFlow Studio, a **Page** represents a single screen in your app. Under-the-hood pages use a **Scaffold**, a [foundational widget from Flutter](https://api.flutter.dev/flutter/material/Scaffold-class.html) that provides a structured layout for a screen within your app. The Scaffold offers essential elements like the AppBar and Body, allowing you to easily build screens. Pages are composed of various UI elements, or widgets. Widgets are added to a page when they are added to the page's **Widget Tree**. :::note[Widget Tree] The **Widget Tree** is a structural representation of how widgets are organized within a Page. To learn more, check out the [**Widget Overview**](https://docs.flutterflow.io/resources/ui/widgets#widget-tree) documentation. ::: In FlutterFlow Studio, pages are automatically configured to handle [routing](https://docs.flutterflow.io/resources/ui/pages/properties#route-settings). Additionally, pages can have [input parameters](https://docs.flutterflow.io/resources/ui/pages/properties#page-parameters) and [state variables](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#page-state). :::note For more details on how to use Scaffold and the various Page Elements in FlutterFlow Studio, see the dedicated **[Page Elements](https://docs.flutterflow.io/resources/ui/pages/scaffold)** guide. ::: ## Creating a Page In FlutterFlow Studio, you can craft a page tailored to your needs and design preferences. Whether you're starting from scratch, using a template, or leveraging AI tools, there are several pathways to achieve the desired functionality and aesthetic of your desired Page. :::tip[Generated Code] When you create a page in FlutterFlow Studio, a `Widget` class and a corresponding `Model` class are automatically generated. You can view these in the Code Viewer. To explore the details of the generated `Model` class, take a closer [**look at the code**](https://docs.flutterflow.io/generated-code/page-model). ::: FlutterFlow Studio allows you to easily create new pages from the **Page Selector** tab in the **Navigation Menu**. ![create-new-page.avif](https://docs.flutterflow.io/assets/images/create-new-page-a5d5b49373456a2bf75da5365f3fbd77.avif) ### Create Empty Page When creating your page in FlutterFlow Studio, one option is to start with an empty page, providing you with a blank canvas. This approach allows you to build your UI from the ground up by composing widgets and components together according to your specific design vision and functional requirements. To create an empty FlutterFlow Studio Page from scratch, follow these steps:

### Create Page from Template FlutterFlow Studio simplifies the process of page creation by offering a variety of popular template use cases. These templates provide a basic structure for your pages, which you can quickly customize with your own styling, widgets, and text. To utilize a template from FlutterFlow Studio, follow these steps:
### Generate with Designer You can quickly create a page with [FlutterFlow Designer](https://designer.flutterflow.io/) by describing what you want in natural language. Designer uses your description along with your project context, to build the page with relevant widgets. This is especially helpful when you're starting from scratch or prototyping ideas rapidly.
### Import from Figma Frame You can quickly turn your Figma designs into functional FlutterFlow Studio pages using **Import from Figma**. Simply provide a Figma Frame URL, and FlutterFlow AI will analyze the design and generate a UI layout that closely matches your mockup. To get started, first [connect your Figma account](https://docs.flutterflow.io/concepts/design-system#import-figma-theme). Then, when creating a new page, select **Import from Figma** from the available options. Paste the Figma Frame URL and click **Import**. FlutterFlow Studio will display a preview of the selected frame. Review the preview, then click **Generate** to create the page. Once completed, the page will appear in the **AI Generation History**, where you can preview and add it to your project. :::caution Currently, FlutterFlow Studio doesn't support importing SVG elements from Figma frames. However, you can manually add the SVGs directly to your project [**assets**](https://docs.flutterflow.io/generated-code/project-structure#assets) after generation is complete, or replace them in Figma with supported image formats like PNG or JPEG. :::
# Properties Panel > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/pages/properties In FlutterFlow Studio, the Properties panel on the right helps you set up and manage your pages. It opens when you select the root element in the Widget Tree (on the left). In FlutterFlow Studio, the Properties panel on the right helps you set up and manage your pages. It opens when you select the root element in the [Widget Tree](https://docs.flutterflow.io/resources/ui/widgets#widget-tree) (on the left). The panel is organized into sections, each focusing on different settings to customize your pages. Here’s what you can typically find and modify in this panel: ![page-properties-panel.png](https://docs.flutterflow.io/assets/images/page-properties-panel-290d268c5c4a072b2ed59dd7dfbe23b2.png) ### Page Parameters This section lets you define and manage parameters that your page can receive from other pages in the app. Parameters are essentially variables that hold values that can be passed between pages. For example, you might pass a user ID from a list page to a detail page to display specific information about that user. :::note[LEARN MORE] Learn more about passing data between pages [**here**](https://docs.flutterflow.io/concepts/navigation/passing-data). ::: ### Route Settings In FlutterFlow Studio, Route Settings are essential for defining how pages within your application are accessed and interacted with. These settings allow you to customize the URL paths for web and mobile deep linking, set meaningful Page Names as unique identifiers, integrate dynamic parameters into your routes, and set access restrictions based on user authentication. ![route-settings-configs.png](https://docs.flutterflow.io/assets/images/route-settings-configs-4f679eabdb838bc859ca009c4a24ff21.png) **Skip On Page Load When Inactive** Ensures that actions are bypassed if the Entry Page or Logged In Page is detected as inactive. This is designed specifically for entry points in the app to prevent unnecessary operations when the page is not fully active, optimizing performance and avoiding redundant executions. :::tip[Generated Code] When this option is enabled, the following code is added to your page’s `initState`: ```js if (RootPageContext.isInactiveRootPage(context)) { return; } // On Page Load Actions added after this ``` ::: **Requires Authentication** When the "Requires Authentication" option is enabled for a page, it ensures that only users who are logged in can access that page. This setting is particularly useful for protecting sensitive or personalized content, as it prevents unauthorized users from viewing or interacting with the page. :::tip[Generated Code] When the Route object is created for this Page, setting `requireAuth: true` ensures that only authenticated users can access this page. If "Requires Authentication" is checked, the app will automatically enforce authentication checks before navigating to this page. This is automatically enabled for **Logged In Page**. ```js FFRoute( name: 'promotionPage', path: '/promotionPage', requireAuth: true, builder: (context, params) => PromotionPageWidget(), ) ``` ::: :::note[LEARN MORE] Learn more about Routing [**here**](https://docs.flutterflow.io/concepts/navigation/overview). ::: ## Advanced Configurations For more advanced customization and functionality within your FlutterFlow Studio projects, the **Properties Panel** offers various configuration settings. These settings allow for modifying appearance, greater interactivity, dynamic data handling, and more tailored user experiences. Here's an overview of these additional configurations: - [Page Properties](#page-scaffold-properties) - [Actions](#actions) - [Backend Query](#backend-query) - [State Management](#state-management) ![advanced-configs.png](https://docs.flutterflow.io/assets/images/advanced-configs-5b53cb0e973f1bde7ae667ca3542f9ba.png) ### Page (Scaffold) Properties This section lets you set the fundamental aspects of a page’s layout and behavior, including: - **Background Color:** This property allows you to set a background color for the entire page. You can choose a color that fits the theme and design of your app. - **Safe Area:** When this toggle is enabled, the page content will be automatically adjusted so it does not overlap with the system status bar, navigation bar, and other critical device UI elements. This ensures that all elements of the page are visible and accessible on different devices. - **Hide Keyboard on Tap:** Enabling this option makes the keyboard retract when the user taps anywhere outside the keyboard area on the screen. This is particularly useful for improving user experience by preventing the keyboard from obscuring content. - **Disable Android Back Button:** When enabled, this toggle prevents the Android back button from affecting the navigation on this particular page. This can be useful in scenarios where you don't want users to navigate back to the previous screen easily, such as in a login or payment screen. ### Actions This section allows you to define and manage interactions or events triggered by user actions. For example, you can configure a button to navigate to another page, submit form data, or call an API. Actions are crucial for creating interactive and functional apps. For Scaffold (Page) actions, you can establish specific behaviors or functions that are triggered by certain events related to the page's lifecycle, such as [**On Page Load**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#on-page-load-action-trigger) or [**On Phone Shake**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#on-phone-shake-action-trigger). :::note[LEARN MORE] To learn about the page lifecycle and other methods exposed by FlutterFlow Studio, [**refer to this resource**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle). ::: ### Backend Query Here, you can configure the page to fetch data from a backend source or database. This is typically done through API calls or direct database queries. Setting up a backend query allows the page to display dynamic content, such as user profiles, product lists, or any other data your app needs to retrieve from a server. :::note[LEARN MORE] To learn more about how to connect to a backend source, refer to our [**Database section**](https://docs.flutterflow.io/resources/backend-query) ::: ### State Management State management configurations are essential for maintaining the state or status of a page across user interactions or app sessions. This can include tracking user inputs, remembering user choices, or preserving the app's state during navigation between pages. :::note[LEARN MORE] Learn how to create and **[manage the update lifecycle](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle)** of Page State variables. ::: # Page Elements > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/pages/scaffold Page elements in FlutterFlow Studio are the key elements that define the structure and functionality of each page in your app. Understanding these elements is crucial for building intuitive and effective user interfaces. From navigational elements like the AppBar and Drawer to interactive components like Floating Action Buttons (FABs), each element plays a specific role in shaping the user experience. Page elements in FlutterFlow Studio are the key elements that define the structure and functionality of each page in your app. Understanding these elements is crucial for building intuitive and effective user interfaces. From navigational elements like the **AppBar** and Drawer to interactive components like **Floating Action Buttons (FABs)**, each element plays a specific role in shaping the user experience. Here's how the `Scaffold` contributes to page design in FlutterFlow Studio: - **[AppBar](https://docs.flutterflow.io/resources/ui/pages/scaffold#appbar)**: Scaffold allows you to easily include an `AppBar` at the top of the page, which can house the title, navigation controls, and other actions. - **[Floating Action Button (FAB)](https://docs.flutterflow.io/resources/ui/pages/scaffold#floating-action-button-fab)**: An action button that is commonly used for primary actions on the screen, like adding a new contact or composing a message. - **[Drawer & End-Drawer](https://docs.flutterflow.io/resources/ui/pages/scaffold#drawers)**: A slide-out menu for app navigation, accessible from the `AppBar` or by swiping from the side. - **Body:** The main content area where you place the widgets for the page. :::note[PLEASE NOTE] In FlutterFlow Studio, you won't find a section explicitly labeled as "Body". For example, in the `ProfileSettingsPage`, the `Column` serves as the root of the widget tree for the body, with the rest of the child widgets assembled underneath. ![scaffold-elements.png](https://docs.flutterflow.io/assets/images/scaffold-elements-91f1c9529e6bb438dd460b27b59dafa5.png) ::: ## AppBar **AppBar** is a widget that displays a toolbar at the top of the screen, typically used for branding, navigation, and actions related to the current screen. It supports a title and icons, and offers customization with a variety of styles and functionalities. The AppBar is divided into the following sections: - **Leading:** Typically holds a **menu** or **back icon** that provides navigation control. By default, if there is a [**drawer**](#drawers) or [**page navigation**](https://docs.flutterflow.io/concepts/navigation/page-navigation) with ["Allow Back Navigation" enabled](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action), a specific icon (such as a menu or back arrow) is displayed. However, you can override this with another [**Icon widget**](https://docs.flutterflow.io/resources/ui/widgets/icons) if desired, allowing for more tailored navigation options. - **Title:** Primarily serves to indicate the content of the active screen or to display the name of the application, aiding users in recognizing their context within the app. This section can also be customized with different widgets for a more tailored visual representation. - **Actions:** Hosts icon buttons for various operations like search, share, and more, situated on the right end. ### Add an AppBar
### Enable Default Button The "Show Default Button" toggle in the **AppBar** Properties Panel controls whether the default leading icon (usually a back arrow or a menu icon) appears when the user can [navigate back](https://docs.flutterflow.io/concepts/navigation/page-navigation) or when a [Drawer](#drawers) is present on the page. However, it's important to note that this default icon won't appear in the FlutterFlow Studio canvas during the design stage. It only becomes visible when the app is running, and the conditions for showing the button are met. If you wish to replace the default icon with another icon in the leading space, follow the [guide on adding an AppBar](#add-an-appbar). :::tip[Generated Code] In the generated code, when this toggle is enabled, [`automaticallyImplyLeading`](https://api.flutter.dev/flutter/material/AppBar/automaticallyImplyLeading.html) property in the **AppBar** widget is set to `true`. This means that the appropriate default button will be displayed if back navigation is enabled or Drawer is detected when you run the app. ::: ## Floating Action Button (FAB) A **Floating Action Button (FAB)** is a distinctive circular button that hovers over content, commonly used for a primary action within an app, like adding a new item or composing a message. ### Extended Property This variant of the `FAB` includes both an icon and a label, making it larger than the standard circular `FAB`. It is useful when you want the action button to convey more information than just the icon can provide, such as text explaining the action ("Add Task", "Create Post", etc.). **Use cases** The **extended** `FAB` is particularly beneficial in applications where the action needs clear and immediate recognition from the user, which cannot be fully achieved by an icon alone. It is also useful in interfaces where there is ample space to accommodate a longer button without cluttering the UI. ![fab-comparison.png](https://docs.flutterflow.io/assets/images/fab-comparison-3b65acd5c5d7265223da2b2e9094fb1d.png) ### Adding a Floating Action Button to your Page
## Drawers **Drawer** is a slide-out menu that can emerge from either side of the screen, typically used for app navigation or placing additional options. It allows users to switch between different sections of an app without cluttering the main interface. ### Add a Drawer to your Page
### End-Drawer Using a similar approach, you can also add an End Drawer to your page. ### Drawer [Action] Using this action, you can open and close the drawers with a tap of a button. For example, opening the drawer from a widget placed outside the Appbar and closing it from the widget placed inside the drawer. #### Types of drawer actions There are three types of actions you can add to the drawer. - **Open Drawer**: Opens the regular drawer. - **Open End Drawer**: Opens the end drawer. - **Close Drawers**: Closes all the open drawers. ## Nav Bar The NavBar (or Navigation Bar) allows you to quickly navigate between pages of your app. It is displayed at the bottom of the screen for convenient access. The items inside the NavBar are represented by an icon, optional text, or both. You can display up to three or five primary or top-level pages (pages that can be accessed from anywhere in your app) inside the NavBar. From the NavBar settings page, you can add the NavBar and make modifications such as changing the display style, reordering icons, customizing its appearance, and more. ### Enable Nav Bar in settings By default, the NavBar is disabled for any project created in FlutterFlow Studio. Before you can add pages to the NavBar, you need to enable it from the FlutterFlow Studio settings. Navigate to **Setting and Integrations > General > NavBar & AppBar** and enable Nav Bar. :::caution Initially, your NavBar will not have any pages in it. You'll see a message instructing you to add at least two pages. Before proceeding, make sure to create at least two pages. If you need help with adding a new page, you can find [**more information here**](https://docs.flutterflow.io/resources/ui/pages#creating-a-page). ::: ![nav-bar.png](https://docs.flutterflow.io/assets/images/nav-bar-3e95a622b810f966bed49041ddfd96b3.png) **Responsive Visibility:** To ensure that your NavBar is visible only on certain screen sizes, you can toggle the device icons based on your design preference. ### Add Pages to your Nav Bar Once enabled, you need to select the pages you want to appear in the navigation bar and then add them. Here's how you can do it:
#### Nav Bar Properties (Property Panel) - **Label:** This label will be displayed on the Nav Bar. - **Nav Bar Icon:** This icon represents the page in the Nav Bar. You can also choose its **size**. :::note The NavBar will only appear on the canvas if you have added at least two pages to it. ::: #### Reordering Nav Bar Items To reorder the Nav Bar items: - Navigate to the **Setting and Integrations > General > NavBar & AppBar > Nav Bar**. - Under the **Re-Order Page Icons**, identify the page that you want to reorder, click on the hamburger icon (icon with three lines ) beside it and drag it in an upward or downward direction.

### Modifying NavBar Style When you enable the NavBar, it initially adopts the Flutter Default Nav Bar style. However, if you need more customization options, you can set the Nav Bar Style dropdown to one of the following: #### Flutter Default Nav Bar This is the standard material style NavBar. You have the option to show or hide labels for both selected and unselected items. ![nav-bar-default.png](https://docs.flutterflow.io/assets/images/nav-bar-default-60c4b4df61a1a36ab816fd9e384e1fad.png) **Styling Properties** | Property | Type | Description | |----------|-------------|-----------------------------------------------------------------------------------------| | **Show Labels (Selected)** | Toggle | Allows you to enable or disable the display of labels for selected items in the `NavBar`. | |**Show Labels (Unselected)** | Toggle | Allows you to enable or disable the display of labels for unselected items in the `NavBar` | | **NavBar Color** | Color Wheel | Sets the background color of the `NavBar` | | **Selected Icon Color** | Color Wheel | Specifies the color of the icons when they are selected. | | **Unselected Icon Color** | Color Wheel | Specifies the color of the icons when they are not selected. | #### Google Nav Bar This modern Google-style NavBar features a subtle animation that reveals the item label (page name) but only displays the label for the selected item. ![nav-bar-google.png](https://docs.flutterflow.io/assets/images/nav-bar-google-335c7e5919226da7956c5f7235554cc4.png) **Styling Properties** - **Nav Bar Color:** Sets the background color of the NavBar. - **Selected Icon & Text Color:** Changes the color of the icon and text when an item is selected. - **Unselected Icon & Text Color:** Sets the color for icons and text when an item is not selected. - **Selected Background Color**: Alters the background color of the selected item. - **Show Unselected Border**: Toggles the visibility of a border around unselected items - **Border Width:** Specifies the width of the border around the NavBar item buttons. - **Border Radius:** Determines the corner roundness of the NavBar item buttons. - **Border Color:** Alters the color of the borders around NavBar item buttons. - **Nav Button Padding:** Adjusts the padding inside each nav button. - **Nav Button Margin:** Controls the margin around each nav button. - **Nav Button Alignment:** Allows customization of how nav buttons align within the NavBar. Options include center, space-between, etc., are given. - **Gap Between Icon and Text:** Specifies the spacing between the icon and text within nav buttons. - **Animation Duration (ms):** Defines how long animations take when switching between items. - **Haptic Feedback:** A toggle that enables or disables haptic feedback when interacting with NavBar items, enhancing the tactile experience. #### Floating Nav Bar This NavBar style appears as a floating element above the pages and shows labels for all items present in the NavBar. ![nav-bar-floating.png](https://docs.flutterflow.io/assets/images/nav-bar-floating-3d935739e7a9ff390c894e9e2dd54a42.png) **Styling Properties** - **Nav Bar Color:** Sets the background color of the NavBar. - **Selected Icon & Text Color:** Specifies the color of the icon and text when an item is selected. - **Unselected Icon & Text Color:** Defines the color for the icons and text when they are not selected. - **Selected Background Color:** Alters the background color of the selected item. - **Width:** Controls the width of the NavBar. - **Border Radius:** Determines the roundness of the NavBar's corners. - **Elevation:** Adjusts the shadow or elevation effect beneath the NavBar, which helps give the NavBar a floating appearance above other content. - **Button Border Radius:** Specifies the radius for the borders of each button within the NavBar. - **Nav Button Margin:** Sets the margin around each nav button - **Nav Button Padding:** Controls the padding inside each nav button.
## SnackBar **SnackBar** is a temporary, lightweight notification that briefly appears at the bottom of the screen to provide feedback about an operation. ### When to Use Snackbar? Here are some common uses of a SnackBar in an app: - **User Feedback:** Notifies users about the success or failure of actions like submitting a form or uploading a file. - **Undo Actions:** Provides a quick option to undo a recently completed action, such as deleting an email or removing an item from a list. - **Informational Alerts:** Displays brief messages about changes or updates, such as synchronization status or network issues, without requiring user interaction. - **Confirmation Messages:** Confirms the completion of tasks that don't need immediate attention, like saving settings or adding a calendar event. ### To show a SnackBar message
### Show SnackBar [Action] Material Design allows you to add an interactive element to the SnackBar notification, allowing users to respond directly from the snack message. #### Add Action Property Typically, a SnackBar can include a single action button. This button is used to offer users an immediate option to interact with the snack message. Common uses include undoing an action that the snack message refers to (like undoing a deletion), retrying a failed task (like reconnecting to a network), or any other quick recovery or response tasks. - **Customization:** The action within a SnackBar is customizable. You can define the button's label, appearance, and the function it executes when pressed. This allows the SnackBar to not only inform users but also engage them in meaningful ways to enhance the user experience. - **Timeouts and Visibility:** The presence of an action can affect the duration the SnackBar is displayed. By default, a SnackBar may auto-dismiss after a few seconds, but if an action button is present, users might need more time to read the message and respond, thus you might consider adjusting the display duration accordingly. ![snackbar-action-props.png](https://docs.flutterflow.io/assets/images/snackbar-action-props-deaac181811c45b593c1d699d548946d.png) Adding actions to SnackBars helps make them not just informative but also interactive, facilitating a more dynamic user interaction model where feedback and actions are closely linked. ![snackbar.png](https://docs.flutterflow.io/assets/images/snackbar-8d480ecbcad24ca94d4199fce66a182a.png) ### Hide SnackBar [Action] Managing multiple SnackBar instances efficiently is crucial because showing them all at once can overwhelm the user interface and confuse the user. To address this, Flutter apps use a queuing system for `SnackBars`: **Snackbar Queue:** When multiple SnackBars are triggered in succession, they are queued to be displayed one after the other rather than all at once. Each `SnackBar` waits for the previous one to disappear before the next one shows up. **Hiding Previous Snackbar:** If you want to immediately replace a currently displayed SnackBar with a new one without waiting for it to auto-dismiss, you can use the **Hide Snackbar** action in FlutterFlow Studio. The action has the following hide scope: - **Current Only:** This option hides only the currently displayed snackbar. - **All (Current and Queue):** This option hides the current snackbar as well as any snackbar in the queue. This can be useful in scenarios where an immediate update to the user feedback is necessary, such as correcting a message or providing new information. By using these methods, you can control the flow of information via SnackBars, ensuring that user feedback is timely, relevant, and not overwhelming. # Page Lifecycle > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/pages/page-lifecycle In FlutterFlow Studio and Flutter, understanding the page lifecycle, or the stages a page goes In FlutterFlow Studio and Flutter, understanding the page lifecycle, or the stages a page goes through from creation to disposal, is essential for managing resources and data effectively. Let's delve into the key moments in the lifecycle of a **Page**: - **Initialization**: This is the first phase where the page is set up. Here, the initial data is loaded. This might involve setting up the necessary state or defaults for the page. - **Rendering**: Here, the page is actually drawn or rendered on the screen. This includes setting up the layout, styles, and any interactive elements. The user can now see the page in its initial [state](#page-state). - **Updating:** After rendering, the page becomes interactive and can respond to user inputs such as clicks, typing, or other gestures. It may re-render parts of the page or the entire page to reflect changes from user interaction or new data. - **Disposal**: When the page is no longer needed, or the user navigates away, this phase is triggered. This is where resources related to the page are released from memory. In FlutterFlow Studio, most of these lifecycle phases are handled internally by FlutterFlow Studio's architecture. However, FlutterFlow Studio exposes some lifecycle methods so that you, as a developer, can decide what additional configurations to load upon initialization and when to re-render the UI based on interactions. ## Page-Level Action Triggers There are several **[Action Triggers](https://docs.flutterflow.io/resources/functions/action-flow-editor#action-triggers)** that are accessible at the root level of a page. :::note[What are Action Triggers?] **Action Triggers** serve as event listeners or handlers that respond to specific events or user interactions within an application. FlutterFlow Studio provides developers with a way to define logic that responds to various events, such as button clicks, page loads, form submissions, or data changes. To learn more, see the **[Action Flow Editor](https://docs.flutterflow.io/resources/functions/action-flow-editor)** section. ::: As you open the [Action Flow Editor](https://docs.flutterflow.io/resources/functions/action-flow-editor) for your Page, you can see the following Action Triggers exposed for your Page. ![actions-triggers.png](https://docs.flutterflow.io/assets/images/actions-triggers-e7a59d7f7e2da33c600e2286251c6dee.png) ### On Page Load [Action Trigger] This allows you to set actions when the page loads or initializes. It enables developers to perform tasks or execute logic at specific points in the page lifecycle, such as fetching data from an API, initializing variables, or updating UI elements. :::tip[Possible use cases] - **Initializing Data:** You can use the **On Page Load** action trigger to initiate API calls, database queries, or read from local storage, setting up the data that the page needs to display. This ensures that all necessary data is ready and available by the time the user sees the page. - **Setting State:** If your page depends on certain state conditions (like toggles, selections, or input fields), you can set these states appropriately as the page loads. - **Running Animations:** Start animations that welcome users or draw attention to certain UI elements on the page. ::: To add an action to **On Page Load** action trigger, follow the steps: :::tip[Generated Code] When you add actions to the **on Page Load** action trigger, they are executed within a `SchedulerBinding.instance.addPostFrameCallback((_)` method. This ensures that the actions run after the widget tree is fully built. For more details, refer to the [**Page: Generated Code**](https://docs.flutterflow.io/generated-code/page-model#onpageload-action-generated-code) document. ::: ### On Phone Shake [Action Trigger] Actions added under this trigger run when the user shakes their phone. This is useful when you want to perform certain tasks or trigger specific actions in response to a phone shake gesture. :::tip[Possible use cases] - **Randomizing content:** Shake the phone to generate a random number, display a random quote, or change the background image. - **Refreshing data:** Shake the phone to trigger a data refresh, such as fetching the latest news articles or updating a live feed. - **Resetting the app state:** Shake the phone to reset the app state, clear form fields, or return to the app's home screen. ::: ### On Shortcut Press [Action Trigger] This action trigger lets you bind keyboard shortcuts to actions. This is incredibly helpful for improving accessibility and enhancing user experience, especially in web and desktop apps. :::tip[Possible use cases] - **Create New Issues in Project Management Apps:** In project management apps like Linear, users can press `C` to quickly open a form for creating a new issue or task. - **Form Submission:** Users can press a key combination (e.g., `Ctrl + Enter`) to submit a form. - **Navigating Between Pages:** Use shortcuts like `Ctrl + Right Arrow` to navigate between pages without using the mouse. ::: :::note[important] - When a keyboard shortcut is created at the page level, it won't trigger if a TextField is in focus, and you also won't be able to type the shortcut key into the TextField. - When a keyboard shortcut is created at the component level, it also won't trigger if a TextField is in focus, but you'll still be able to type the shortcut key into the TextField. - **To avoid conflicts, use shortcuts that users are unlikely to type, such as Command + S, instead of a single key like 'S'.** - There's currently a known issue with Flutter's autofocus functionality. If a TextField inside a component has autofocus enabled, and the component has a keyboard shortcut, the TextField will not autofocus as expected. ::: Implementing keyboard shortcuts is a straightforward process in FlutterFlow Studio. You can define as many shortcuts as you want, each mapped to specific actions that will trigger when the corresponding key combination is pressed. Let's see an example of an eCommerce web app where users can quickly access the cart page by pressing the `C` key. To create a shortcut, use the **On Shortcut Press** action trigger, then enter the keys your app should listen for.

:::caution[Keyboard Shortcuts & Text Fields] When implementing keyboard shortcuts on a page or component with a text field, you may need to ensure the text field ignores those shortcuts. For instance, if you have a shortcut assigned to the letter "C" and a user tries to type "C" in the text field, you likely want the input to capture the keypress without triggering the shortcut. To handle this, you can enable the option on the `TextField` widget to bypass keyboard shortcuts. However, it's generally better to assign more unique combinations, like Cmd + C, which are less likely to conflict with normal typing in a text field. ::: ### On Dispose [Action Trigger] The **On Dispose** action trigger allows you to define actions that execute when a page is navigated away from or removed from memory. It is particularly useful for stopping ongoing operations. Imagine a scenario where [audio recording](https://docs.flutterflow.io/concepts/file-handling/displaying-media#audio-recording) is started when the page loads using the [On Page Load](#on-page-load-action-trigger) action trigger. The recording process runs as long as the user remains on the page. However, when the user navigates away, you need to stop the recording to save resources and ensure the recorded audio is finalized. By using the **On Dispose** action trigger, you can safely stop the recording and save the file. Additionally, if you are using a third-party package that relies on persistent connections or listeners, you can leverage [Custom Actions](https://docs.flutterflow.io/concepts/custom-code/custom-actions) with the On Dispose action trigger to close streams or cancel subscriptions. :::tip[Possible Use Cases] - **Cleaning Up Resources:** Use this action trigger to cancel timers, close database connections, or unsubscribe from streams to prevent memory leaks and unnecessary processing. - For example, real-time applications, such as stock trading platforms, rely on WebSocket connections to fetch live updates. A homepage displaying a live ticker of stock prices would require opening the WebSocket connection on page load and closing it when **On Dispose** runs. Without an On Dispose trigger, the WebSocket connection could remain open unnecessarily, leading to wasted resources and app instability. - **Finalizing Database Transactions**: Commit or roll back database transactions if the user leaves the page before completing the process. - **Logging or Analytics:** Track user behavior or log events (e.g., page exit or time spent on a page) to monitor user engagement and improve the application experience. ::: ![page-on-dispose.avif](https://docs.flutterflow.io/assets/images/page-on-dispose-8025fe786790802aac8cd697c25dabfa.avif) ## Page State :::note[State Variables] A state variable holds information or data about your UI at any given moment. To learn more about **states and state management, [refer to this guide](https://docs.flutterflow.io/concepts/state-management)** ::: **Page state** refers to the information that a page tracks about its current condition or the data it displays. This can include things like which tabs are active, the contents of a form, or any user interactions. Managing state is crucial for dynamic pages that interact with user inputs or load varying data. Page State variables are only accessible within the given Page scope. This type of variable can be useful for storing data that needs to be shared between different widgets on the page, such as form data, a search query, and filtering or sorting options. For example, - In a multistep form, you might use a **Page State** variable to store the current step number or the user's input for each step. - Or, on a search results page, you could use a **Page State** variable to store the search query entered by the user and the current filtering and sorting options applied to the results. This allows you to maintain the state of the page as the user interacts with different widgets and components. When a **Page State** variable changes, you can choose to re-render the page with the updated values, and it will display a new version of the page with these updates. ### Creating a Page State To create a new Page State variable on your page, follow the steps:
While creating a Page State, the following properties are included: - **Is List:** This property determines whether the variable can hold multiple values of the same data type (like a list or array) or just a single value. - **Initial Field Value:** This property sets the default value for the variable when it is first created. It's like setting the starting point or the value that the variable begins with before anything else happens. - **Nullable:** This property determines whether the variable can have a null value. When "**Nullable**" is set to true, it means the variable can be empty or have a null value. This is useful when dealing with optional data or scenarios where the absence of a value is valid. Now, let's apply these concepts to the `searchString` variable in the context of the above example: - Since `searchString` is used to store a single search query entered by the user in the search bar, "**Is List**" is set to false, therefore it can hold only one value at a time. - The default value for `searchString` is set to an empty string (""). This ensures that when the homepage loads, the search bar is initially empty, allowing users to enter their search query. - Since entering a search query is optional and the search bar can be left empty, "**Nullable**" is set to true. This allows the `searchString` variable to be null until the user enters a search query, indicating that no search has been performed yet. :::note You can set the Data Type of your Page State variable to primitive data types such as **String, Integer, Boolean,** or **Double**, or complex built-in data types such as **Enum, Custom Data Type,** or **Document**. To learn more about the available data types, refer to the [**Data Representation Section.**](https://docs.flutterflow.io/resources/data-representation) ::: ### Get Page State value You can access the **Page State** value anywhere on the current page. Any widget can hold the current value of a Page State variable, either to display it in the UI or for transactional logic. You can set the source value of the widget wherever you see the following icon. This icon indicates that you can link the widget's value to a variable. ![Page-State.png](https://docs.flutterflow.io/assets/images/page-state-5f4d542a831409759613be0d2b79a1cf.png) ### Update Page State [Action] Page State values can only be updated via **Actions**. Whenever you want to update the page state, such as through a button click, user interaction, or form update, add an **Update Page State** action.
#### Rebuild on Update When updating page state in FlutterFlow Studio, you'll often come across the **Update Type** property in your Action properties. Here's what it means: **Rebuild Current Page:** This option triggers a re-rendering of the page, ensuring that any changes to the state are reflected in the user interface (UI). **No Rebuild:** Choose this option when you need to update the state without immediately reflecting the changes in the UI. :::tip If you want to rebuild a page without updating any state variables, use the [**Rebuild**](https://docs.flutterflow.io/concepts/state-management#rebuild-action) state action. ::: :::caution[Expensive Rebuilds] Too many rebuilds can impact performance because rebuilding the widget tree frequently consumes resources and may lead to decreased responsiveness and increased battery usage. Therefore, it's essential to consider the trade-offs and use rebuilds judiciously to maintain optimal app performance. To learn more about what happens behind the scenes, refer to the [Generated Page](https://docs.flutterflow.io/generated-code/page-model) section. ::: # Introduction to Widgets > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets Introduction to Widgets Widgets are the building blocks of your app's user interface in FlutterFlow Studio. Each widget represents a fundamental UI element that contributes to the overall layout and functionality of your app. In FlutterFlow Studio, you create your app's UI by combining basic widgets like **Text, Button** and **Container** with more complex, multi-child widgets like **Rows, Column, Lists**. Understanding the parent-child relationship between widgets is crucial, as it forms the foundation of the [**Widget Tree**](#widget-tree), which defines the structure and hierarchy of your app's UI. ## Types of Widgets in FlutterFlow Studio - **Built-in Widgets**: You can choose from a variety of built-in widgets in FlutterFlow Studio. These are discussed throughout this section. - **[Components](https://docs.flutterflow.io/resources/ui/components/creating-components)**: You can also build your own reusable widgets, or Components by assembling multiple widgets using FlutterFlow Studio’s drag-and-drop interface. - **[Custom Widgets](https://docs.flutterflow.io/concepts/custom-code/custom-widgets)**: For scenarios where more complex functionalities are required, FlutterFlow Studio allows you to develop your own Custom Widgets using code. - **[Theme Widgets](https://docs.flutterflow.io/concepts/design-system#theme-widgets)**: Themed widgets can be reused across your app, making it easy to update styles universally. If you decide to change any properties, such as color schemes or fonts, you can update the theme widget instead of modifying each widget individually. ## Widget Tree The Widget Tree is a structural representation of how widgets—ranging from [atomic elements](https://docs.flutterflow.io/resources/ui/overview) like Text and Button to more [complex molecules and organisms](https://docs.flutterflow.io/resources/ui/overview)—organized within a Page. It outlines the parent-child relationships that define the layout and functionality of your UI. This hierarchy is similar to the concept of atomic design, where atoms and molecules combine to form more complex structures, ultimately creating a cohesive interface. :::note[WIDGET TREE BREAKDOWN] ![tree.png](https://docs.flutterflow.io/assets/images/tree-dd5fad754dcf04fe9f4067413e137386.png) The above diagram illustrates a widget tree for an `ExamplePage`. The page is structured using a hierarchy of widgets that define its layout and functionality. - **ExamplePage**: The root of the widget tree, representing the entire Page. - **Column**: Directly under the root, this widget organizes its child widgets vertically. It is the main layout widget for this Page. - **Container**: A molecular widget that contains another widget, providing padding, margins, borders, or color to its child. - **Text**: An atomic widget, this displays a string of text within the `Container`. - **Row**: A molecular widget that arranges its children horizontally. It contains multiple `Icon` widgets. - **Icon**: These are atomic widgets, each representing an `Icon` image. They are repeated here twice under the `Row`. - **Image**: An atomic widget placed directly under the `Column`, used here to display an image. - **Button:** An atomic widget also under the `Column`, used for user interaction. Each widget in this tree plays a specific role in constructing the user interface, from basic elements like `Text` and `Image` to layout structures like `Row`s and `Column`s that organize these elements. Here's how this widget tree would be represented in FlutterFlow Studio: ![widget-tree-new.png](https://docs.flutterflow.io/assets/images/widget-tree-new-083629745aefd437e890ea2f81086844.png) ::: Understanding the widget tree is crucial for developers using FlutterFlow Studio because it helps visualize the composition of the application's interface. It shows how individual widgets (atoms) combine and nest within each other to form more complex widgets (molecules and organisms) and ultimately complete pages. ### Widget categories In FlutterFlow Studio, we have the following categories of widgets: - [Layout Elements](#layout-elements) - [Base Elements](#base-elements) - [Page Elements](#page-elements) - [Form Elements](#form-elements) #### Layout Elements These widgets help organize the structure and layout of your app. They determine how other widgets are arranged and displayed on the screen. Common layout elements include: | Widget | Description | Example | |---------------|---------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------| | **Row** | Arrange its child widgets horizontally | | | **Column** | Organizes its child widgets vertically. | | | **Stack** | Layers its child widgets on top of each other, allowing for overlapping elements. | | | **Container** | Provides a box model for a single child widget, with optional padding, margins, borders, box shadow and background color. | | Find the entire list on this **index page**. #### Base Elements Base elements are the fundamental building blocks for creating the visual and interactive components of your app. Examples include: | Widget | Description | Example | |---------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------| | **[Text](https://docs.flutterflow.io/resources/ui/widgets/text)** | Displays a string of text and allows you to customize fonts, sizes, and styles. | | | [**Image**](https://docs.flutterflow.io/resources/ui/widgets/image) | Displays image. | | | [**Icon**](https://docs.flutterflow.io/resources/ui/widgets/icons) | Displays icon. | | | [**Button**](https://docs.flutterflow.io/resources/ui/widgets/button) | A widget meant to trigger actions and take users to another flow in the app. It can be styled with different colors, borders, and text | | Find the entire list on this **index page**. #### Page Elements In FlutterFlow Studio, the **Page Elements** category consists of widgets like **[AppBar](https://docs.flutterflow.io/resources/ui/pages/scaffold#appbar)**, **[Floating Action Button (FAB)](https://docs.flutterflow.io/resources/ui/pages/scaffold#floating-action-button-fab)**, **[Drawer](https://docs.flutterflow.io/resources/ui/pages/scaffold#drawers)**, and **[End Drawer](https://docs.flutterflow.io/resources/ui/pages/scaffold#end-drawer)**, which are essential for structuring pages and facilitating navigation throughout the app. :::note Learn more about **[Page Elements](https://docs.flutterflow.io/resources/ui/pages/scaffold)** such as **AppBar**, **Snackbar**, **Drawers** etc and how to use them in FlutterFlow Studio. ::: #### Form Elements Form elements are widgets specifically used for creating forms where users can enter data. These are crucial for tasks like user registration, login, and data entry. Examples include: | Widget | Description | Example | |------------------|-------------------------------------------------------------------|--------------------------------------------------------------------------------| | **Text Field** | Allows users to enter text. | Textfield Example | | **Radio Button** | Allows users to select one option from a set. | Radio Button Example | | **Dropdown** | Provides a menu with multiple options where users can select one. | Dropdown Example | Find the entire list on this **index page**. Each category in FlutterFlow Studio serves distinct purposes, helping you design both the appearance and functionality of your app more efficiently. # Properties Panel > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/properties In FlutterFlow Studio, the Properties Panel on the right helps you configure and manage your widgets. It opens when you click on a widget or component in the Widget Tree. In FlutterFlow Studio, the Properties Panel on the right helps you configure and manage your widgets. It opens when you click on a widget or [component](https://docs.flutterflow.io/resources/ui/components) in the [**Widget Tree**](https://docs.flutterflow.io/resources/ui/widgets#widget-tree). Here's a quick demo showing how to add a widget to the canvas, which opens the widget properties panel on the right, allowing you to update the widget's properties:
The panel is divided into sections, each focusing on settings specific to the selected widget. The available options may vary depending on the widget type, with additional advanced configurations available for further customization. ![advanced-configs-widgets.png](https://docs.flutterflow.io/assets/images/advanced-configs-widgets-4fcf0fbd6b6c7ed7551a6df8262671bb.png) ### Widget name When you select any widget, its name appears on the properties panel. The default name for any widget is its type. For example, if you select the Container widget, the name appears as '**Container**'. However, you can use the edit icon on the right to change its name. ![widget-properties.png](https://docs.flutterflow.io/assets/images/widget-properties-5052050595add7f5def91601388644b3.png) ## Actions This section allows you to define and manage interactions or events triggered by user actions. For example, you can configure a button to navigate to another page, submit form data, or call an API. Actions are crucial for creating interactive and functional apps. In the case of widgets, you can add user interactions on action triggers such as **On Tap** or **On Long Press**. The availability of these actions may vary depending on the widget. Actions differ according to the widget selected; on some widgets, you can't apply any actions. ## Backend Query Here, you can configure the page to fetch data from a backend source or database. This is typically done through API calls or direct database queries. Setting up a backend query allows the widget to display dynamic content, such as user profiles, product lists, or any other data your app needs to retrieve from a server. ## Generate Dynamic Children Widgets capable of handling multiple child widgets have an additional tab called **Generate Dynamic Children**. This feature helps you generate multiple child widgets from a list variable. This is particularly useful when you are retrieving data from an API call. Some of the widgets that can handle multiple children include **Column, Row, Stack, ListView, GridView, and PageView**. :::note To learn more about [**Generating Dynamic Children**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/generate-dynamic-children), refer here. ::: ## Animations You can apply animations to a widget to enhance the visual appeal and user experience. Animations can be used to draw attention to important elements, provide feedback on user interactions, or create visually engaging transitions between states. :::note Learn more about adding **[animations](https://docs.flutterflow.io/concepts/animations)** here ::: ## Documentation and Semantic Labels **Documentation** helps developers understand the purpose and function of a widget within the app, making maintenance and future updates easier. **Semantic labels** are crucial for accessibility, allowing screen readers to accurately describe the widget's function to users with visual impairments. ## Additional Flutter Properties The properties panel doesn't show every parameter of the underlying Flutter widget. To set a parameter that isn't available in the panel, use **Additional Flutter Properties** at the bottom. Visual editing, theming, and bindings remain available, so you don't need to rebuild the widget as a [custom widget](https://docs.flutterflow.io/concepts/custom-code/custom-widgets). The section appears for built-in widgets that generate a standard Flutter or third-party widget, such as **Text**, **Container**, **Image**, and **ListView**. It doesn't appear for widgets that FlutterFlow Studio builds with its own wrappers, such as **Button** and **DropDown**. The properties panel already exposes all parameters for those widgets. The section also doesn't appear for components, custom widgets, or widget builders. ### Add a Property To set an additional property: 1. Select the widget in the canvas or the **Widget Tree**. 2. In the properties panel, expand **Additional Flutter Properties**. 3. On the highlighted line, write the parameter as a named Dart argument followed by a comma, for example `softWrap: false,`. 4. To add more parameters, write one per line. The editor shows these parts: - The first line is the generated constructor for the widget, such as `Text(`. - The `...` line stands for the properties that FlutterFlow Studio already sets from the properties panel. - The highlighted lines are the only ones that you can edit. The gutter numbers these lines from 1, and error messages use the same line numbers.
FlutterFlow Studio adds your arguments to the widget's constructor call, before `child` or `children`. :::tip The editor suggests completions as you type. At the start of a line, it suggests the widget's remaining named parameters. After a parameter name, it suggests values such as theme colors and text styles. After a dot, it suggests members of that type. Suggestions require the code analyzer. If it isn't ready, the section shows a message, but you can still type the arguments. ::: :::note Additional Flutter properties apply in the generated code and in [**Test Mode**](https://docs.flutterflow.io/testing/run-your-app#test-mode). They don't appear on the canvas. ::: ### What You Can Write - Use named arguments only, one per line, such as `maxLines: 2,`. Positional arguments aren't supported. - Use only classes and other names available through the generated page's existing imports. - Don't use `key`, `child`, or `children`. FlutterFlow Studio manages these parameters. - Don't set the same parameter twice. - Don't set a parameter that the properties panel already controls, even when that panel property still has its default value. Set it from the panel instead. If an argument breaks one of these rules, or has a syntax or type error, the section shows an error under the editor, and the same error appears in the **Issues** panel. You can't run your app in Test Mode or publish it until you fix the error. To remove an additional property, delete its line from the editor. A widget that already has additional properties always shows the section, so you can review and remove them. # Basic Widgets > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/basic-widgets FlutterFlow Studio offers a range of basic widgets that are the building blocks of a Page or Component. In this guide, we'll cover five fundamental widgets: Container, Text, Icon, Button, and Image. Understanding these widgets is crucial for building any FlutterFlow Studio app. FlutterFlow Studio offers a range of basic widgets that are the building blocks of a Page or Component. In this guide, we'll cover five fundamental widgets: **Container**, **Text, Icon, Button,** and **Image**. Understanding these widgets is crucial for building any FlutterFlow Studio app. ![basic-widgets.png](https://docs.flutterflow.io/assets/images/basic-widgets-a4c8ea362895b6f1a4472cbc0ad025ca.png) Some basic widgets include: - **[Container](https://docs.flutterflow.io/resources/ui/widgets/container)**: The **Container** widget is one of the most commonly used widgets in FlutterFlow Studio. It allows you to create a rectangular or circular box that is allowed to have one single child - any other basic or advanced widget, and you can style it with various properties such as padding, margins, borders, and colors, etc. - **[Text](https://docs.flutterflow.io/resources/ui/widgets/text)**: The **Text** widget is used to display a string of text with single style. It’s a basic yet powerful widget that allows you to customize text appearance, alignment, and behavior. - **[Icon](https://docs.flutterflow.io/resources/ui/widgets/icons)**: The **Icon** widget is used to display an icon from the Material Icons, Font Awesome or your own custom icons set. Icons are essential for building user-friendly interfaces, providing visual cues to users. - **[Button](https://docs.flutterflow.io/resources/ui/widgets/button)**: In FlutterFlow Studio, **Button** widgets are specialized interactive elements that come with built-in visual feedback and default hover properties. - **[Image](https://docs.flutterflow.io/resources/ui/widgets/image)**: The **Image** widget is used to display images in your app. FlutterFlow Studio supports various sources for images, including assets, network URLs, and uploaded files. # Button > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/button The Button widget is a fundamental component in user interface design, utilized extensively across web and mobile applications. It serves as a primary means of user interaction, allowing users to execute actions or commands within an application. Buttons are essential for: The Button widget is a fundamental component in user interface design, utilized extensively across web and mobile applications. It serves as a primary means of user interaction, allowing users to execute actions or commands within an application. Buttons are essential for: - **Initiating Actions:** Whether it's submitting a form, opening a new page, or performing any operational task, buttons trigger these functionalities. - **User Feedback:** Buttons often change visually in response to user actions—like hover effects, changes in color on click, or disabled states—providing immediate visual feedback that confirms an action has been recognized. - **Navigational Purposes:** Buttons can guide users through a site or application, such as moving to the next page of a form or returning to the home page. - **Enhancing User Experience:** Well-designed buttons are crucial for creating a smooth and intuitive user experience. They are designed to be easily recognizable and accessible, facilitating a seamless interaction by clearly communicating their function. When you add a Button widget to your Page or Component and select it, the Properties Panel on the right displays various properties and functionalities: Some significant properties are illustrated below: ### Button Default Styling Settings Define the initial appearance of your button, including its size, color, border, and padding. These settings determine how the button looks under default conditions. ![button.png](https://docs.flutterflow.io/assets/images/button-1fe4d0fc73df7d0734e49fd89437a0d2.png) ### Button Disabled & Hover Settings Customize how your button appears when disabled or when a user hovers over it. These settings allow you to alter the button's color, border, and elevation to indicate its state visually. ![button-disabled.png](https://docs.flutterflow.io/assets/images/button-disabled-799361e254ccd5c50136ed53437068f4.png) Additionally, you can define the style of the text inside the Button and, if enabled, the style of the Icon within the Button. # Container > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/container Learn how to use the Container widget to structure, style, and animate layouts in FlutterFlow Studio. The Container widget is a highly versatile widget that functions much like a multi-purpose box in your app's interface. It is primarily used to decorate, position, and arrange child widgets—smaller components within your app. Containers are useful for dividing the screen into smaller, logical parts, and styling or positioning these parts effectively. For instance, you can use a Container to assign a background color, shape, or specific size to elements like text or buttons. Think of it as placing an item inside a box and then customizing the appearance and placement of that box within the screen layout. ## Container Properties Container properties can be adjusted to customize the appearance and layout of a Container widget. Here's a brief explanation of each: ![container-props.png](https://docs.flutterflow.io/assets/images/container-props-b14a355ea5884fb8ea6cccce91b24908.png) ### Limiting Size Sometimes, you may not set the height and width of the Container explicitly. In that case, the Container sizes itself based on its child widget. This can lead to layout issues where widgets become too large or too small on different devices. To avoid this, you can limit the size of the Container by specifying the Min W, Min H, Max W, and Max H. For example, in a responsive design, you might want a button to grow with the screen size but not exceed a certain width. By setting these properties, you can ensure the button is at least a certain size for usability but does not become too large on bigger screens. - **Min W (Minimum Width) & Min H (Minimum Height):** These set the minimum dimensions the Container can shrink to, in pixels or percentage. - **Max W (Maximum Width) & Max H (Maximum Height):** These set the maximum dimensions the Container can expand to, in pixels or percentage.

### Clip Content This property determines whether the content inside the Container should be clipped if it exceeds the boundaries of the Container. When enabled, anything outside the Container's bounds will not be visible.

## Box Shadow Properties The Box Shadow properties allow you to add and customize a shadow effect for your Container widget. Here's a brief explanation of each property: - **Shadow Color:** The color of the shadow, typically specified in a hex format including an alpha value for transparency, like `#33000000`. You can select from Theme Colors, use a color picker, or input a hex code. - **Blur:** Determines the blur radius of the shadow. A higher value produces a more diffused shadow, while a lower value makes the shadow sharper and more defined. - **Spread:** Controls the spread radius of the shadow. Increasing this value expands the area that the shadow covers, making it appear larger. - **Offset X & Offset Y:** These properties set the horizontal (X) and vertical (Y) displacement of the shadow relative to the widget. **Offset X** shifts the shadow horizontally, and **Offset Y** moves it vertically. Positive values move the shadow right and down, respectively, while negative values move it left and up. Here's a quick demo to show the Box Shadow properties on a Container:

## Gradient Properties The Gradient properties allow you to create and customize a gradient effect for a Container widget. Here's an overview of each property: - **Angle (Degrees):** Sets the orientation of the gradient by specifying the angle in degrees. An angle of **0 degrees** creates a **horizontal** gradient, and **90 degrees** makes it **vertical**. - **Colors:** These are the colors used in the gradient. You can set these colors using Theme Colors, a color picker, or hex codes. Two color values are added by default. - **Add Color:** Use this option to add additional colors to the gradient, further customizing the effect by adjusting their transition points and choosing from Theme Colors, a color picker, or hex codes. - **Transition Point:** These values determine where each color starts transitioning within the gradient. Transition points are values between 0 and 1, set as a fraction of the total gradient distance: ![gradient-cont.png](https://docs.flutterflow.io/assets/images/gradient-cont-0e1fe8041e4c52c057d37f52b40b072d.png) In the example above: - The transition point for Color 1 is set at 0, meaning it starts at the very beginning of the gradient. - The transition point for Color 2 is 0.5, indicating that this color starts transitioning at the halfway point. - The transition point for Color 3 is 1, which places the start of this color's transition at the end of the gradient. ## Background Image Properties The Background Image properties provide options for setting an image as the background of a Container widget. :::note For a detailed guide on configuring common image properties, see [**Common Image Properties**](https://docs.flutterflow.io/resources/ui/widgets/image#common-image-properties). ::: ## Child Properties - **Child Alignment:** This allows you to specify the alignment of child widgets within the Container. The grid indicates possible positions (center, top, bottom, left, right, and so on), and you can adjust the alignment precisely using the X and Y values, which shift the child widget horizontally and vertically within the Container. ## Implicit Animation This property enables the use of implicit animations for changes in the Container’s properties (like size or color). This makes transitions between property changes smoother and visually appealing. Here's an example of a Container's width and color changing without Implicit Animation.

Next, enable **Implicit Animation** for this Container and see the difference:

Implicit Animation properties include: - **Animation Curve:** Specifies how the animation progresses over time. The options are Ease In, Ease In Out, Ease Out, Bounce, Linear, Elastic. - **Duration (ms):** Sets the duration of the animation in milliseconds. A shorter duration makes the animation faster, while a longer duration slows it down. ## Safe Area This toggle ensures that the Container and its contents are positioned within the safe area of the device’s screen, avoiding obscured areas such as notches or rounded corners. This is particularly useful for ensuring good visibility and interactivity across different devices. To enable the safe area, navigate to the Properties panel and turn on the **Safe Area** toggle. ![container-safe-area.png](https://docs.flutterflow.io/assets/images/container-safe-area-1d9fccabd0e7e51be796c6d4f002a4bb.avif) :::tip[Watch the video tutorial] If you prefer watching a video tutorial, watch this guide:

::: # Icons > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/icons Icons are integral elements in user interfaces, providing visual cues that enhance user interaction and aesthetic appeal. They communicate action, represent functionality, and improve navigation efficiency within applications. Icons are integral elements in user interfaces, providing visual cues that enhance user interaction and aesthetic appeal. They communicate action, represent functionality, and improve navigation efficiency within applications. ![icon.png](https://docs.flutterflow.io/assets/images/icon-7d7bad4d005740306b979eabaab82ac2.png) ## Types of Icon widgets FlutterFlow Studio allows a bunch of widgets and components: - **Icon Widget**: The **Icon** widget in FlutterFlow Studio is used for displaying symbols from a variety of available icon packs like Material Icons. It's straightforward to use, allowing for quick integration of visual symbols into your app. - **Icon Button Widget**: The **IconButton** widget combines the functionality of an icon with the capabilities of a button, making it a clickable icon. It's commonly used for actions like opening a menu, submitting a form, or any other interactive task. - **Toggle Icon Widget**: The **ToggleIcon** widget offers a specific functionality where the icon toggles between two states based on a boolean condition. This widget is ideal for "favorite" or "like" buttons, where the icon state changes to represent an active or inactive state. The ToggleIcon reacts to user taps, changing its appearance and also allowing for callback functionality to handle the state change. ## Common Icon Properties Upon selecting the Icon, you can modify properties such as **Icon color** and **Icon size** from the Properties Panel on the right. Additionally, you can set the Icon value by selecting from a vast catalog of **Material Icons** and **FontAwesome** Icons provided by FlutterFlow Studio. :::tip[Custom Icons] You can also upload your own licensed Custom Icons. Check out [**this video**](https://youtu.be/rlGkbnhP75g) to learn more. ::: ## Icon Button Properties The Properties Panel for your IconButton allows you to modify the Icon Properties, Button Styling, Disabled state, and Hovered state properties. It also lets you determine if you want a loading indicator when the icon button is clicked. To get a quick demo of the styling changes, check this out:
## Toggle Icon Properties ToggleIcon is a special component created for you that lets you add a toggle on and toggle off icon, and define a State variable that determines the state of the Toggle icon. The properties are straightforward and include the following: ![toggle.png](https://docs.flutterflow.io/assets/images/toggle-68199f1a71fa7398fa0dbf1febb71a11.png) ### On Toggle [Action] By default, FlutterFlow Studio handles the toggling of the State variable from true to false and vice versa when the button is clicked. However, you can also add another action under the On Toggle action trigger to perform extra tasks. # Image > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/image Images are a fundamental part of modern user interfaces, enhancing visual appeal and user Images are a fundamental part of modern user interfaces, enhancing visual appeal and user engagement. In app design, images can provide context, support content, and guide user interactions. Different types of image widgets cater to various design requirements, ensuring flexibility and aesthetic integration across platforms. - **Image Widget**: The Image Widget is a versatile component used to display images from a variety of sources, including local assets and the internet. It's essential for adding visual elements to your applications, such as logos, icons, and photographs. - **CircleImage Widget**: The CircleImage Widget specifically caters to scenarios where you need to display images in a circular format, commonly used for profile pictures or branding elements. The properties for the Image widget provide various customization options, from sizing and fitting to advanced animations. ## Common Image Properties - **Width & Height:** Specify the dimensions of the image. Values can be in pixels (px) or as a percentage (%) of the parent container's size, allowing for responsive design. - In case of `CircleImage` widget, you can define the **diameter** of the widget instead. - **Border Radius:** Adjusts how rounded the corners of the image are. You can define border radius for TL (Top left), TR (top right), BL (bottom left), and BR (bottom right) separately or for all corners together. A higher value results in more rounded corners. :::caution[CIRCLEIMAGE] This option is not available for `CircleImage` widget since it is circular in shape. ::: ### Image Type Specifies the source of the image. Options include: - **Network:** Enter the URL of the image in the Path input field. This is used for images hosted online. - **Cached:** Determines whether the image should be cached for performance optimization. When toggled on, it stores the image locally to speed up load times on subsequent views. - When cached is enabled for `Image` widget & `CircleImage` widget, you can also define the **Fade in/out duration** (when blur hash is not enabled). This setting is not available for Background Image of Container. - **Asset:** Click the Upload Image + button to upload an image from your computer or select from previously uploaded assets. When this option is selected, you can enable the **Set Dark Mode** toggle to specify a separate background image for dark mode environments, enhancing the visual experience under different lighting conditions. - **Uploaded File:** Selecting this option allows for dynamic handling of image data within your app, accommodating images that users upload during app usage. This makes it suitable for applications requiring user-specific or user-generated content. Set this to use **Widget State > Uploaded File** to manage the image as part of the app's state. ### Box Fit Determines how this widget should take up the available space. The options are:
![image-boxfit.png](https://docs.flutterflow.io/assets/images/image-boxfit-74c8424b34088f4d083e1b7bc4483797.png)
Example of a horizontal & vertical image in different BoxFit options
- **Fill:** Scale the image to completely fill the container, which might distort the image. - **Contain:** Scale the image to fit within the container without distorting it, which might leave some empty space. - **Cover:** Scale the image to completely cover the container without distorting it, potentially cropping some parts of the image. - **Fit Width:** Scale the image to fit the width of the container, possibly leaving empty space vertically. - **Fit Height:** Scale the image to fit the height of the container, possibly leaving empty space horizontally. - **None:** No scaling or adjustment, showing the image in its original size. - **Scale Down:** Center the widget and scale it down until it fits within the available space. ### Image Alignment Controls the alignment of the image within the container. This grid allows you to position the image precisely within the container, with options to align it to the center, top, bottom, left, right, and combinations of these. - **X & Y:** Adjusts the fine positioning of the background image along the X (horizontal) and Y (vertical) axes. This is useful for making precise adjustments to the image placement.
## Advanced Image Functionalities - **Show Error Image on Failure:** When enabled, displays an error image if the main image fails to load. This helps maintain a good user experience even when image retrieval issues occur. - **Use Blur Hash:** When enabled, displays a blurred placeholder image while the main image is loading, based on a hash value representing the original image. This can enhance the perceived performance of image loading. - **Make Expandable:** When enabled, the image can be expanded, usually to a larger view or a full-screen mode, upon user interaction. - **Use Hero Animation:** Enables a hero animation effect when transitioning between screens. This can make the image appear to "fly" between screens for a smoother visual transition. # Text > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/text Text is a fundamental element in any user interface. It conveys information and guides users through interactions. In app development, presenting text effectively can significantly enhance the user experience by making information accessible and interactions intuitive. Two common widgets used for displaying text in FlutterFlow Studio are the Text widget and the RichText widget. Each serves a distinct purpose and offers different capabilities for integrating text into an application. Text is a fundamental element in any user interface. It conveys information and guides users through interactions. In app development, presenting text effectively can significantly enhance the user experience by making information accessible and interactions intuitive. Two common widgets used for displaying text in FlutterFlow Studio are the Text widget and the RichText widget. Each serves a distinct purpose and offers different capabilities for integrating text into an application. ## Text Widget The Text widget is used to display a piece of text on the screen. It is one of the most commonly used widgets in app development. ![text-example.png](https://docs.flutterflow.io/assets/images/text-example-5dbb41a06e4e1625e516f25bc8b51682.png) For example, in this screen, the Text widget is used to present different pieces of information clearly and effectively. The Text widgets display the product name, "Men's Harrington Jacket," its price, "$148," and a detailed description of the product. These Text widgets are styled differently to emphasize specific pieces of information. The Text widget can be found under the **Base Elements** tab in the **Widget Palette**. You can either drag it to your desired location on the screen or insert it directly via the widget tree. Once the Text widget is selected, the Properties Panel on the right side becomes active, allowing you to customize its style. Here, you can adjust attributes such as font size, color, alignment, and more to tailor the appearance to your design needs. ## RichText Widget The **RichText** widget offers more formatting options than the basic Text widget. It allows you to mix multiple styles within a single text sequence, enabling the creation of stylized textual content. This widget uses a tree of **TextSpan** objects to define the rich formatting options, including different fonts, sizes, and colors for various parts of the text. RichText is particularly useful for text-heavy applications that need inline styling and linking, such as in a formatted article or a document viewer. The RichText widget can be found under the **Base Elements** tab in the **Widget Palette**. You can either drag it to your desired location on the screen or insert it directly via the widget tree. ![richtext-eg.png](https://docs.flutterflow.io/assets/images/richtext-eg-fb12340204efef65ec066cab09b82894.png) When the RichText widget is added to your widget tree, FlutterFlow Studio automatically creates two RichTextSpan child objects. You can modify the text value and styling of each object to create multiple styles within your paragraph. Static text entered in a RichTextSpan is translatable and appears in the Languages table. In contrast, text assembled with the [**Combine Text** function](https://docs.flutterflow.io/resources/functions/utility#combine-text) does not appear in the Languages table or **Translate All**. To modify the RichTextSpan objects, see the quick demo below:
## Common Text Styling Properties ![text-props.png](https://docs.flutterflow.io/assets/images/text-props-6a4106562a78bb5e4db8d8c6fef14e1b.png) :::tip For consistency, we recommend defining your Typography and custom text styles from **Theme Settings > Typography & Icons** before creating any screens. ::: A few things to note: - **Line Height:** Sets the height of the text (e.g., a value of 1.5 makes the line height 50% larger than the font size). - **Text Align:** Defines how text is positioned within a container, such as left-aligned, right-aligned, centered, or justified. ## Advanced Properties for Text Widget - **Max Lines:** This property specifies the maximum number of lines that the text can occupy. If the content exceeds the set number of lines, it will be truncated or end with an ellipsis, depending on the configuration. This is useful for maintaining a clean and consistent layout where text space is limited.

- **Auto Size:** The `Auto Size` option allows the `Text` widget to automatically reduce its font size to fit within its parent widget. This ensures that the text remains legible without overflowing its container, making it especially useful for responsive designs where the display may vary across different devices. **Configure Parent Widget Dimensions** To enable `Auto Size`, the `Text` widget must be inside a widget that has both a defined width and height. Without these constraints, the font size cannot be adjusted automatically. 1. Select the `Text` widget. 2. Check its parent widget. 3. Ensure both width and height are explicitly defined. :::caution Without defined dimensions, the `Auto Size` feature may not behave as expected. ::: **Behavior Scenarios** The following examples illustrate how `Auto Size` behaves under different container configurations: - When the container width is set to `infinity`, the height is set to `100px`, and `Auto Size` is disabled, the text may overflow beyond the container. - When the container width is set to `infinity`, the height is set to `100px`, and `Auto Size` is enabled, the font size adjusts to fit the defined height. - When the container width is set to `30%`, no height is defined, and `Auto Size` is enabled, the feature has no visible effect because the height constraint is missing. - When the container width is set to `70%`, the height is set to `50px`, and `Auto Size` is enabled, the text is resized to the minimum allowed font size to remain within the container. ![](https://docs.flutterflow.io/assets/images/20250430121459696014-760e4e8b93b65d720b5f8c3af1d34a4d.png) :::tip Use `Auto Size` with percentage-based dimensions for better responsiveness. For example, set the container width to `30%` and enable `Auto Size` to allow the text size to adjust as the screen size changes. ::: :::note The `Auto Size` feature has a minimum font size threshold. If the container becomes too small, text may clip or overflow when resizing is no longer possible. :::

### Setting Text Overflow Replacement You may want to limit the number of characters shown inside the Text widget and control how the remaining text appears when it exceeds the limit. :::note[Important] This option is only available when the Text value is set from a variable. ::: To set the text overflow replacement: 1. Select the **Text** widget, go to **Properties Panel > Text Properties**, and enter a value for **Max Character** to limit the number of characters. 2. Set the **Text Overflow Replacement** to the behavior you want: - **Unspecified**: Uses the default overflow behavior. - **Clip**: Cuts off the extra text without showing any visual indicator. - **Ellipsis (...)**: Replaces the extra text with an ellipsis. - **Fade**: Fades out the overflowing text at the edge. - **Visible**: Allows the overflowing text to remain visible. Use this carefully, as it may overlap nearby widgets. ![overflow-options](https://docs.flutterflow.io/assets/images/overflow-options-44269329548d29d23fed90738c3cc615.avif) ### Adding Gradient Color :::caution[Conditional Properties] Note that enabling the Gradient option disables Auto Size and Max Lines for your Text widget. ::: Adding a gradient color to the text gives it a modern look and feel. You can either use our ready-made templates or create one from scratch. Here's how you do it: 1. Select the **Text** widget, go to **Properties Panel > Text Properties**, and enable the **Gradient** toggle. 2. To add your own colors: 1. Select the **Type**: **Linear** or **Radial**. **Linear** distributes the colors horizontally, while **Radial** spreads the colors in a circular pattern. 2. If you choose **Linear**, specify the **Direction**. If you choose **Radial**, specify the **Radius**. 3. Add, remove, or customize the existing colors. :::note You can also add gradient colors from a preset template as shown in the video demo. :::

## Formatting numbers You may want to format large numbers for better readability. Displaying a number like 2,354,000 or 4,356,634,444 instead of 2354000 or 4356634444 enhances the user experience. For instance, it's clearer to show the population as 1,200,000 rather than 1200000 and currency values like $2K or $5M instead of $2000 or $5000000. ### Types of formatting Below are the types of formatting that we support: - **Decimal**: Shows numbers in decimal format (e.g., 1,200,000 and 1.200.000). - **Percent**: Shows numbers in percentage format (e.g., 28%, 99.99%). - **Scientific**: Shows numbers in scientific format (e.g., 1e3, 1E6). - **Compact**: Shows numbers in compact format (e.g., 2.1K, 2.3M, 5B). - **Compact Long**: Shows numbers in compact long format (e.g., 2.1 thousand, 2.3 million, 5 billion). - **Custom**: If the given formatting options do not fit your requirement, you can specify a custom format. ### Format a number Use the instructions below to format a number: 1. Select the **Text** widget, go to [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) > **Set from Variable**, and display the value from a variable of type **Integer** or **Double** (e.g., **App State > App State Variable Name**). 2. After selecting a variable, set **Available Options** to **Number Format** and **Number Format Options** to the required [type](#types-of-formatting). 1. If you choose **Decimal**, you must set the **Decimal Type** as well. Decimal values can be shown in two ways: `1,200` with a comma or `1.200` with a period. 1. Select **Automatic** to show the decimal value based on the user's country. 2. Select **Period for Decimal** to show the decimal value with a period (e.g., `1.200`). 3. Select **Comma for Decimal** to show the decimal value with a comma (e.g., `1,200`). 2. If you choose **Custom**: 1. Find the **Custom Format** box, and enter your format. For example, entering `###,###.###` will convert the number `123456.789` into `123,456.789`, and `000.00` will convert the number `12.786` into `012.79`. 2. In the **Locale** input box, enter the locale in which you want to display the number. If you leave this property empty, the locale is automatically set based on the user's location. Learn more about how to format a number [here](https://pub.dev/documentation/intl/latest/intl/NumberFormat-class.html). 3. To display this number as currency, enable the **Display as Currency** toggle and specify the **Currency Symbol**. 4. Click **Confirm**.

# Rows, Column & Stack > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack In Flutter, Rows, Columns, and Stacks are fundamental layout widgets that In Flutter, `Rows`, `Columns`, and `Stacks` are fundamental layout widgets that help you structure the UI by organizing other widgets in different visual arrangements. Here's how each one works: - **Row**: A `Row` arranges its child widgets in a horizontal line. This is useful when you want to place elements side by side across the screen. - **Column**: A `Column` organizes its child widgets vertically, stacking them from top to bottom. This is ideal for placing elements that need to appear in a vertical sequence, such as a list of messages in a chat app or entries in a form. - **Stack**: A `Stack` layers its child widgets on top of each other, allowing for overlapping elements. In a `Stack`, widgets can be positioned absolutely relative to the edges of the `Stack`, giving you control over the exact location of each element. Each of these widgets serves different purposes and choosing between them depends on how you need to arrange your UI components: ![row-col-stack.png](https://docs.flutterflow.io/assets/images/row-col-stack-43692a7d10f09d07ddb08295cc2b1055.png) :::tip[Minimum Layout Nesting] Use the minimum amount of rows/columns necessary to achieve your layout to avoid unnecessary complexity. No page or component should nest more than 10 levels deep. Reaching this limit likely signals the need for **[converting a part of the widget tree into components](https://docs.flutterflow.io/resources/ui/components/creating-components#convert-to-a-component)**. ::: ## Common Property: Alignment ### Main Axis The main axis is the primary direction in which child widgets are laid out in a `Row` or `Column`. **Row:** The main axis runs **horizontally**. Child widgets are arranged from left to right. FlutterFlow Studio allows you to set Row's Main Axis property to the following types:
![row-main-axis.png](https://docs.flutterflow.io/assets/images/row-main-axis-51a849d58cd39f3daaf64557e0845bcb.png)
Row's Main Axis property has the following types: Start, End, Center, SpaceEvenly, SpaceAround, SpaceBetween
**Column:** The main axis runs **vertically**. Child widgets are laid out from top to bottom. FlutterFlow Studio allows you to set Column's Main Axis property to the following types:
![column-main-axis.png](https://docs.flutterflow.io/assets/images/column-main-axis-cd42d005444cf97750bc8e10eba404aa.png)
Column's Main Axis property has the following types: Start, End, Center, SpaceEvenly, SpaceAround, SpaceBetween
Manipulating the main axis allows you to control how widgets are spaced and how they should expand or align in relation to each other along this primary direction. ### Cross Axis The cross axis is **perpendicular to the main axis** and controls the alignment and spacing of widgets across this secondary direction. It has the following types: Start, Center, End. **Row:** The cross axis runs **vertically**. It determines how child widgets are aligned from top to bottom within the row.
![row-cross.png](https://docs.flutterflow.io/assets/images/row-cross-9645c4fc85c933db44b7be3eca57c44b.png)
Cross Axis types for Row. Main Axis of Row is set to Center.
**Column:** The cross axis runs **horizontally**. It controls how child widgets align from left to right within the column.
![column-cross.png](https://docs.flutterflow.io/assets/images/column-cross-b398b7ef4db1839e86e06f7c581e8c0b.png)
Cross Axis types for Column. Main Axis of Column is set to Center
### Stack Alignment For `Stacks`, the concept of main and cross axes is less applicable because widgets are aligned relative to the entire area of the `Stack`. In FlutterFlow Studio you can control the `Stack` children's alignment using the `Stack` property called _Default Child Alignment_ which positions the children using `X` and `Y` coordinates. ![stack-align.png](https://docs.flutterflow.io/assets/images/stack-align-691158330abdc58c1e7f1b408fccd82b.png) Understanding these axes and their properties is essential for effectively designing layouts that behave as expected on different screen sizes and orientations, ensuring a robust and flexible UI. ## Expansion & Flex (for Row & Column) When widgets are placed inside a Row or Column in a layout, they gain access to an additional property called **Expansion** & **Flex**. This property controls how a widget behaves in terms of taking up available space within its parent Row or Column. #### Expanded The Expansion properties are as follows: - **Default:** Make the widget NOT fill space along the main axis (horizontal for Row, vertical for Column), therefore taking the minimum space required by its contents. - **Flexible:** Allow the widget to take up to the available space along the main axis (horizontal for Row, vertical for Column). You can think of this as giving it a "Max Width" equal to the amount of available space. The widget can take up less space if it is smaller, but otherwise will be constrained to the available width. :::caution[Understanding Layouts] Flexible will be **disabled** if the child widget is in a Row with unbounded width or Column with unbounded height. ::: - **Expanded:** Make the widget fill the space along the main axis (horizontal for Row, vertical for Column). :::tip[Using Expanded & Flexible in an Example] ![expanded.png](https://docs.flutterflow.io/assets/images/expanded-eda87a69753adc7cf7fb3649c71c4105.png) 1. **Default Behavior:** Here, you see two child widgets displayed next to each other, each occupying only the necessary space to show its content without any expansion. 2. **Expanded Widget Usage:** The first child widget (highlighted in red) is wrapped with an **Expanded** widget. This causes it to take up all the remaining space in the container after accounting for the space required by the other widgets. Here, the first child stretches to fill all the extra space, pushing the other widgets to the side or shrinking them to their minimum size. 3. **All Expanded Widgets:** In this example, all child widgets are set to **Expanded**. This configuration divides the container's space equally among all child widgets, regardless of their intrinsic size. Each widget stretches to fill an equal portion of the container. 4. **All Flexible Widgets:** In the last example, each child widget is wrapped with a **Flexible** widget. This allows the widgets to expand to fill the available space but unlike **Expanded**, they can also shrink below their allocated space if necessary, based on the flex factors and the minimum space required by each widget. If all have the same flex factor, they will divide the space equally but are able to shrink if the content size demands less space. ::: Let's understand Flexible concept with another example: :::tip[Flexible Concept] ![flexible.png](https://docs.flutterflow.io/assets/images/flexible-5eeaab35dab266c5eb63c3af8b47162d.png) - In the left image, Child 2 (in purple) and Child 3 (in green) retain their intrinsic sizes due to **default settings**, causing their content to appear cut off when the container's width is limited. They cannot adapt to smaller spaces, leading to potential content clipping. This highlights the limitations of default settings in confined spaces where dynamic resizing would improve content visibility. - In contrast, the right image uses the **Flexible widget** for Child 2 and Child 3, allowing them to adjust dynamically to the container's width constraints. Instead of sticking to their original sizes, these widgets can shrink or expand, making the layout responsive and ensuring content remains visible and well-aligned, regardless of screen size changes. This adaptability is crucial for maintaining accessibility and visual coherence in diverse display environments. ::: #### Flex Additionally, you can utilize Flex factors to determine the flexibility of a widget within its parent container. A Flex factor is an integer assigned to a child widget, indicating its proportional size compared to other children in the same parent. The space a child occupies is determined by its Flex factor in relation to the total Flex factors of all siblings in the layout. :::note[Default Behavior] If no flex factor is provided, the child will not expand to fill extra space in the parent container. It will occupy only the space required for its content unless styled otherwise. ::: When you assign a flex factor, the widget can expand to fill any available space in the parent container. For instance, in a Row or Column, if one widget has a flex factor of 1 and another has a flex factor of 2, the second widget will take up twice as much space as the first. :::tip[Flex Example] ![flex.png](https://docs.flutterflow.io/assets/images/flex-686dc14f7db4be8620279b395f21bb97.png) - Child 2 (purple) with a higher Flex factor (8) consistently occupies a larger portion of space, showing how a higher number increases the space allocation relative to other widgets. - Child 3 (green) has varying Flex factors (1 and 4), illustrating how increasing the Flex factor allows the widget to occupy more space, albeit still less than Child 2 due to its lower Flex factor. ::: Find a video tutorial about Expanded & Flexible:
## Scrollability Scrollability for **Row or Column** widgets in FlutterFlow Studio determines whether the content within these layouts can extend beyond the visible boundaries of the screen or container, enabling horizontal or vertical scrolling: - **Allow Scrolling:** When enabled, this allows the content to exceed the device or parent container’s screen limits, making the overflow content accessible through scrolling. - **Do Not Allow Scrolling:** If disabled, the content that exceeds the boundaries of the screen or its parent container will not be accessible through scrolling. This setting forces the content to fit within the available visible space, hiding overflow content or potentially causing layout issues. :::tip[Generated Code] In the generated Flutter code, enabling scrollability simply involves wrapping the Row or Column in a `SingleChildScrollView()`. This widget adjusts its child's size and position based on the incoming constraints and the scrolling movement, effectively managing overflow by introducing scrollable behavior. ::: ## Spacing - **Items Spacing:** This field sets the space between each child widget within the Row or Column. You can specify a static numerical value that determines the pixel spacing between adjacent children or set it from a variable. :::tip[Items Spacing vs Padding] Prefer “Items Spacing” set on the parent row or column instead of padding on individual elements. This ensures consistency, especially on non-dynamically generated lists. ::: - **Apply to Start & End:** When toggled on, this applies the specified item spacing to the beginning and the end of the Row or Column. This effectively adds padding at the start and end of the layout in addition to between the items. - **Start Spacing and End Spacing:** These properties allow for additional specific spacing at the start and end of the Row or Column, respectively. This is useful for fine-tuning the layout to ensure content is visually balanced within the container or to provide clear margins. # Lists & Grids > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid In FlutterFlow Studio, ListView and GridView are versatile widgets designed for displaying lists and grids of elements, respectively. Both are highly customizable and optimized for dynamic content, making them essential for any app that requires scrolling through a collection of items such as images, text, or interactive elements. In FlutterFlow Studio, `ListView` and `GridView` are versatile widgets designed for displaying lists and grids of elements, respectively. Both are highly customizable and optimized for dynamic content, making them essential for any app that requires scrolling through a collection of items such as images, text, or interactive elements. ## ListView Widget ListView is a scrollable list of widgets arranged linearly. It is ideal for scenarios where items need to be displayed one after another, either **vertically or horizontally**. It is particularly useful for efficiently rendering long lists. Only the items visible on the screen are rendered, enhancing performance for lists with many elements. You can customize the ListView using the following properties: ### Axis The **Axis** property sets the orientation of the ListView. Select **Vertical** or **Horizontal**, depending on how you want the list to scroll. ![listview-axis.png](https://docs.flutterflow.io/assets/images/listview-axis-9b98370a7ac7fe23dc7df200f0a8c10c.png) ### Spacing - **Items Spacing:** Defines the space, in pixels, between individual items in the ListView. :::tip[Items Spacing vs Padding] For static lists, set **Items Spacing** on the parent row or column instead of adding padding to individual elements. This helps maintain consistent spacing. ::: - **Apply to Start & End:** Applies the item spacing to the beginning and end of the ListView, in addition to the spacing between items. - **Start Spacing and End Spacing:** Sets additional spacing at the beginning and end of the ListView independently from the spacing between items. ### Advanced Properties {#advanced-functionalities} - **Shrink Wrap:** When enabled, the ListView sizes itself to the combined size of its children, so it does not take up more space than necessary. This is useful for lists whose items fit within the available constraints. - **Primary:** If set to true, the ListView will act as the primary scrolling view in the context. This usually affects how the view interacts with other scrolling views and whether it stretches to fill the viewport. [**See more info here**](#primary-property). - **Reverse:** When enabled, this property reverses the order in which items appear in the ListView. For a vertical list, items start from the bottom; for a horizontal list, they start from the right. ![listview-reverse.png](https://docs.flutterflow.io/assets/images/listview-reverse-87c139dec023d5c05aec91c5c21e0735.png) - **Scroll Physics:** Controls how the ListView responds when users drag and release it, including whether they can scroll it. Choose the behavior that fits the surrounding page, especially when the ListView is nested inside another scrollable widget. - **Start at End:** Opens the ListView at its end without changing the order of its items. The first item remains at the start; the initial scroll position changes. For example, a support conversation ordered from oldest to newest can open with the latest message visible. Use **Reverse** instead when you need to change the direction in which items are displayed. ### ListView Scroll Triggers Select the ListView and open its **Actions** tab to configure these triggers: - **On Scroll Start:** Runs when the ListView reaches its start. For example, reveal a date filter when someone returns to the top of an expense history. - **On Scroll End:** Runs when the ListView reaches its end. For example, request the next page of support tickets when someone reaches the bottom of a custom paginated list, then append the returned tickets. Check that a request is not already running and that more results exist before loading another page. - **On Scroll Direction Changed:** Runs when the user reverses scroll direction. Use the ListView's **Scroll Direction** value to branch on **Towards Start** or **Towards End**. For example, show a compact category filter when someone scrolls back toward the start of a product list, and hide it when they resume scrolling toward the end. :::tip The [**built-in infinite scroll**](#adding-infinite-scroll) option already loads additional query results as the user scrolls. Use **On Scroll End** for a custom loading flow only when you need to manage those requests yourself. ::: ### Reading the Scroll Position In the variable picker, expand **List View** to find these values: - **Scroll Offset:** The number of pixels scrolled from the start. For example, show a **Back to top** button when this value exceeds 400 pixels. - **Max Scroll Extent:** The farthest scroll offset available, in pixels. Compare it with **Scroll Offset** to tell how close the user is to the end. This value can be zero if the content does not scroll. Both values are pixel distances, not item indexes.
![The List View variable picker showing Scroll Offset and Max Scroll Extent.](https://docs.flutterflow.io/assets/images/listview-scroll-position-4cf35b73beb450a28a716b0a94e9fdf3.avif) ### Reorderable List Enable this option to allow users to reorder items in the list. On web and desktop, FlutterFlow Studio adds drag handles. On mobile, users can reorder an item by long-pressing it. :::note[Note] Reordering does not automatically persist the updated item order. Use the **On Reorder** action trigger to define how the new order should be saved. ::: :::danger[Contents of a Reorderable List] A **Reorderable ListView** must have dynamic children; otherwise, enabling this option will cause an error. ::: Follow these steps to set up a Reorderable ListView: #### Using an App State Variable 1. Create an App State variable containing a few items of type `String`, and display them in the ListView. 2. Select the ListView, go to **Properties Panel > ListView Properties**, and enable **Reorderable**. 3. Open the **Actions** section in the properties panel and then open the **Action Flow Editor**. 4. Select the **On Reorder** action trigger. Actions added under this trigger run after a user repositions an item in the interface. 5. Create a custom action that updates the item's position in the source list. Add three arguments for the list, the **Old Index**, and the **New Index**. You can access the old and new index values from **Set Variable > Reorderable ListView**. 6. Use the following custom code: ```jsx // Define a function called `reorderItems` that returns a Future // containing a reordered list of strings. Future> reorderItems( List list, int oldIndex, int newIndex, ) async { // If the item is being moved further down the list, adjust the // destination index because removing the item shifts the indices. if (oldIndex < newIndex) { newIndex -= 1; } // Remove the item from its original position. final item = list.removeAt(oldIndex); // Insert the item at its new position. list.insert(newIndex, item); // Return the updated list. return list; } ``` 7. Use the list returned by the custom action to update the original list with the **Update App State** action.

#### Reordering Items in a Firestore Query To reorder items retrieved from a Firestore collection query, follow the previous steps with these changes. :::danger[Caution] Reordering items in a Firestore query is best suited for smaller lists. For larger datasets, this method can be inefficient and might lead to performance issues. Additionally, frequent writes and updates to Firestore can increase costs significantly. ::: 1. Create an `order` field in the collection. 2. Order the collection query by the `order` field. 3. Ensure that infinite scroll is disabled. 4. Replace the custom action code with the following code: ```jsx Future reorderFirebaseItems( List list, int oldIndex, int newIndex, ) async { // If the item is being moved down the list, we adjust the newIndex. if (oldIndex < newIndex) { newIndex -= 1; } // Remove the item from its current position in the list. final PlaylistRecord item = list.removeAt(oldIndex); // Insert the item into its new position. list.insert(newIndex, item); // Create a batch to combine multiple Firestore operations into one. final batch = FirebaseFirestore.instance.batch(); // Iterate through the list and update the order field for each document in Firestore. for (int i = 0; i < list.length; i++) { final PlaylistRecord doc = list[i]; // Update the 'order' field of the document with its new index. // This assumes that you have an 'order' field in Firestore where you store the order of the items. batch.update(doc.reference, { 'order': i }); } // Commit all the batched operations to Firestore. return await batch.commit(); } ```

## ListTile Widget The `ListTile` widget provides a standardized horizontal row containing elements such as a title, subtitle, and interactive icons at either end. It is commonly used in menus, drawers, and other collections with a consistent item structure. Using ListTile saves time compared to building custom rows while maintaining visual consistency. :::tip[When to Use ListTile Over Custom Components] Use ListTile when you need a simple layout with standard elements and interactions. It is ideal for: - Lists where items have a uniform structure. - Quick assembly of functional interfaces without needing complex customization. - Scenarios requiring integrated touch feedback and accessibility features, which ListTile provides by default. ::: You can customize the **Title**, **Subtitle**, and **Icon** properties from the properties panel. ![list-tile.png](https://docs.flutterflow.io/assets/images/list-tile-20d6ffe0e8f7e0dbcc14be9a912a365d.png) :::note To learn how to customize the Text widgets in this component, refer to the [**Text widget documentation**](https://docs.flutterflow.io/resources/ui/widgets/text). ::: ### Convert to a SlidableListTile You can convert a ListTile into a slidable version and add actions that users can reveal by swiping the tile to the left. The following demo shows how to enable the slidable functionality and configure its actions:
## GridView Widget GridView provides a scrollable grid of widgets. Use it to display items in a grid pattern, such as a photo gallery or board game layout. Like [ListView](#listview-widget), GridView only renders the visible items, making it efficient for displaying large collections of elements. GridView supports multiple configurations for column count, spacing, child aspect ratio, and scroll direction, offering robust customization options for diverse layout needs. ![gridview.png](https://docs.flutterflow.io/assets/images/gridview-with-vertical-scroll-fb6c3c5ddbc3afaff6c3d16cd126aad3.avif) Here's a quick demo showing how to add a GridView widget and modify its properties:

### Staggered View :::tip[Grid View vs Staggered View] **GridView** arranges its children in a fixed-size grid, while **StaggeredView** supports children of varying sizes. Use StaggeredView for more flexible layouts, such as a Pinterest-style arrangement. ![staggeredView](https://docs.flutterflow.io/assets/images/staggeredView-bda380985a09f3a676211368bdb80f0c.png) ::: ### Advanced Properties - **Shrink Wrap:** By default, the GridView widget takes up all the available space in its main axis. That means if the Axis property is set to Vertical, GridView will occupy all vertical space on the screen. Similarly, if the Axis is set to Horizontal, then GridView will reserve all the horizontal space. - **Primary:** When set, this indicates whether the GridView is the primary scrollable widget in the layout. A primary GridView handles the scroll interactions, usually necessary when there's only one scrolling view in the viewport. [**See more info here**](#primary-property). :::tip[Video Tutorial] Watch the following video tutorial:
::: ## Adding Infinite Scroll Infinite scroll automatically loads new items as you scroll down the list. It initially displays a limited number of items, such as 15 or 25, and then loads subsequent items before the user reaches the end. A circular progress indicator appears at the end of the list while new items load.

![infinite-scroll-behind-the-scene](https://docs.flutterflow.io/assets/images/infinite-scroll-behind-the-scene-1b6bd07b667db80d647f87163bda627d.avif) Infinite scroll improves the user experience by reducing the initial loading time and loading additional items only when required. You can enable infinite scroll for items retrieved from the following sources: - [Infinite scroll on a list from a Firestore collection or Supabase table](#infinite-scroll-on-a-list-from-a-firestore-collection-or-supabase-table) - [Infinite scroll on a list from an API call](#infinite-scroll-on-a-list-from-an-api-call) ### Infinite Scroll on a List from a Firestore Collection or Supabase Table You can enable infinite scroll for a ListView that retrieves records from a Firestore collection or a Supabase table. FlutterFlow Studio loads the records in pages and requests the next page as the user scrolls. To enable infinite scroll: 1. Select the ListView and open the **Backend Query** section in the **Properties Panel**. 2. Add a [collection or table query](https://docs.flutterflow.io/resources/backend-query/query-collection), or open an existing one: - For Firestore, select **Query Collection** and **List of Documents**. - For Supabase, select **Supabase Query** and **List of Rows**. 3. Configure any required filters. 4. Configure the ordering: - For Firestore, add any ordering required for the list. - For Supabase, ensure the imported table schema includes a primary key. Under **Ordering**, add an order using the primary-key field, such as `id`, and select **Increasing** or **Decreasing**. This gives FlutterFlow Studio a stable, unique order for loading each page and prevents rows from repeating or being skipped. 5. Turn on **Enable Infinite Scroll**. 6. Set the **Page Size**. This determines how many records FlutterFlow Studio loads per page. The default value is 25. 7. Click **Confirm**. For Firestore queries, enabling infinite scroll also enables **Listen For Changes**. This updates documents already displayed when their data changes, but it does not add or remove list items when documents are created or deleted. Disable **Listen For Changes** if real-time updates are not required. **Firestore** ![A Firestore collection query with infinite scroll enabled.](https://docs.flutterflow.io/assets/images/enable-infinite-list-549d024dfed5872c92d4d9c0592b602b.avif) **Supabase** ![A Supabase List of Rows query ordered by its primary key with infinite scroll enabled.](https://docs.flutterflow.io/assets/images/enable-infinite-list-supabase-9c4cf9852b83bcfc157c5972747b6e8d.avif) ### Infinite Scroll on a List from an API Call To use infinite scroll with an API call, you need an endpoint that supports pagination through at least one query parameter, such as `page`, `offset`, or `limit`. #### Pagination Variables When you add a paginated API call in the builder and enable infinite scroll, FlutterFlow Studio provides the following pagination variables in the **Set Variable** menu. You can pass these values to your API parameters. ![pagination-variables](https://docs.flutterflow.io/assets/images/pagination-variables-8727bf8adc499d137778add31c3545d7.avif) 1. **Next Page Index:** Pass this variable to the query parameter that accepts the page number. Its default value is `0`, and it increases by one as you scroll until the list reaches the end. 2. **# (Number of) Loaded Items:** Contains the number of items returned by the paginated API call. 3. **Last Response:** Provides data from the previous response that you can use to retrieve the next set of results. :::tip For query parameters such as `limit`, `per_page`, or `size`, set **Number of Loaded Items** to a **Specific Value**, such as `15` or `20`. ::: To configure infinite scroll for an API call, complete these steps: #### 1. Add a Paginated API Call A paginated API returns results in chunks. Most paginated APIs use query parameters to determine how many items to retrieve and where to begin. For example, [`https://reqres.in/api/users?per_page=20&page=1`](https://reqres.in/api/users?per_page=20&page=1) uses the `per_page` parameter to request 20 items and the `page` parameter to request the first page. This is called page-based pagination. See [how to configure query parameters for an API call](https://docs.flutterflow.io/resources/backend-logic/rest-api#passing-query-parameters). #### 2. Pass a Pagination Variable to an API Call In this step, add a ListTile inside a ListView and configure the ListView to display data returned by the paginated API. 1. Query the API and display its data. 2. Set the relevant API query parameter using a pagination variable.

## Primary Property When this property is true and even if the content inside the scrollable widget, such as ListView, or GridView, doesn't overflow the visible area, the user can still attempt to scroll it. The content might move slightly and then bounce back, especially noticeable on iOS with the bounce effect. :::tip In situations where you have multiple scrollable widgets nested within each other, only one should typically be set as primary. ::: In most cases, the outermost scrollable widget (usually the one that takes up the most space or the full screen) is set as primary, while inner scrollables are not. For example, when you have a widget structure like this Column > ListView, you should keep the Column as primary and ListView as non-primary.

## Pull-to-Refresh on ListView or GridView Pull-to-refresh allows users to refresh content manually by pulling down a scrollable area, such as a list. When the content is pulled down far enough and released, the app fetches the latest data. To enable pull-to-refresh: 1. Select your scrollable widget, such as `ListView`, `GridView`, or `StaggeredView`. 2. Open the **Backend Query** section in the properties panel. 3. Turn on **Enable Pull to Refresh**.

:::note To enable pull-to-refresh for Firestore documents, first enable **Single Time Query**. ![enable-infinite-list](https://docs.flutterflow.io/assets/images/enable-infinite-list-549d024dfed5872c92d4d9c0592b602b.avif) ::: ## Scroll To [Action] Use this action to move a scrollable widget to its beginning or end. :::note Before adding this action, make sure you have a scrollable widget, such as a **ListView**, **StaggeredView**, or **GridView**, with enough items to enable scrolling. ::: Follow the steps below to add this action to any widget. 1. Select the widget, such as a FloatingActionButton, on which you want to add the action. 2. Open **Actions** in the properties panel and click **+ Add Action**. 3. Search for and select the **Scroll To** action under *Widget/UI Interactions*. 4. Under **Scrollable Widget to Control**, select the scrollable widget on your page, such as a ListView. 5. Set **Scroll To** to either **Beginning** or **End**. 6. Specify the **Duration** in milliseconds. For example, `1000 ms = 1 second`. This determines how long the scroll animation takes to complete. :::tip If you expect the list to be long, consider setting a shorter duration. ::: ![scroll-to-action](https://docs.flutterflow.io/assets/images/scroll-to-action-ff83144eb2ee3b0e95b423be2c0a6db7.avif) ## Scroll To Index [Action] Use **Scroll To Index** when you need to move to a particular item in a ListView. Unlike **Scroll To**, which moves to the beginning or end of a scrollable widget, this action takes an item index. 1. Select the widget that will initiate the scroll, such as a button next to a section picker, and add an action from its **Actions** tab. 2. Search for and select **Scroll To Index**. 3. Under **Scrollable Widgets to Control**, select the **ListView** and set the target **Index**. Indexes start at `0`, so `0` is the first item and `4` is the fifth. 4. Set **Alignment** to choose where the target item appears in the visible part of the list. For example, **Start** aligns it with the beginning of the visible area. 5. Turn on **Animate** for a smooth scroll, or turn it off to jump directly to the item. When animation is on, set **Duration (ms)** and, optionally, **Curve** to control its speed and easing. For example, in a list of lessons, set **Index** to `4` on a **Go to lesson 5** button. Tapping it scrolls to the fifth lesson. The lesson must already be loaded in the list. ![Scroll To Index action configured for a ListView, with Index, Alignment, Animate, Duration, and Curve settings.](https://docs.flutterflow.io/assets/images/scroll-to-index-action-b66cc8320845a4351eec70c74f4c3eb3.avif) # Generate Dynamic Children > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/generate-dynamic-children Widgets capable of handling multiple child widgets have an additional functionality called Widgets capable of handling multiple child widgets have an additional functionality called Generate Dynamic Children that helps you generate multiple child widgets from a `List` variable. This is particularly useful when you are retrieving data from an API call, Firebase Query, or a State variable that holds a List of items. Some of the widgets that can handle multiple children include **[Column, Row, Stack](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack), [ListView, GridView](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid),** and **[PageView](https://docs.flutterflow.io/concepts/navigation/pageview)**. In the following example, we will use an `AppState` called `categoryList` that holds a List of Product Categories and set the variable to the categoryList widget that is a ListView. :::note In the demo app, we have predefined custom `DataTypes`. One such DataType is "**Category**," which includes the fields `categoryImg` and `categoryName`. In our App State, **categoryList** is a `List` that holds multiple Category objects. We use this list variable as the value source for our `ListView` widget. :::

The value is stored in a variable (in this example, `allCategoriesList`) and can be used to populate any scrollable view. In our example, we populate the `ListView` widget, which creates multiple instances, each holding a Column with a circular Container and Text. :::tip[What are Instances? ] Learn about **[Instances](https://docs.flutterflow.io/resources/ui/overview#classes-vs-instances)** and how it compares with **Classes** in this [**document**](https://docs.flutterflow.io/resources/ui/overview#classes-vs-instances). ::: To make changes, you need to **modify only the first child** and set the variable sources to the first child widgets. These changes will be applied to all children widgets in the `ListView`. The number of children will match the length of the List variable unless you have set a limit in the **Max Items** option under the **Generating Dynamic Children** tab. Let's see a quick demo to set the variable source of the first child widgets:
# Chart > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/chart Learn about chart types and how to customize the Chart widget in FlutterFlow Studio. The **Chart** widget presents data visually, making complex information easier to understand and compare. ## Chart Types You can add the following types of charts: 1. [Line Chart](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/line-chart) 2. [Bar Chart](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/bar-chart) 3. [Pie Chart](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/pie-chart) ## Customizing the Chart {#customizing-chart} Use the options under **Chart Properties** in the Properties panel to customize the widget's appearance and behavior. :::note Available properties vary by chart type. Axis settings apply to line and bar charts, while pie charts use section-specific settings. ::: ### Show Legend A legend helps users identify each data series by displaying its name next to its color. To show and customize the legend: 1. Select the **Chart** widget from the widget tree or the canvas area. 2. Open **Chart Data** and enter a **Legend** name for each data series. 3. Under **Chart Properties**, enable **Show Legend**. 4. Open **Legend Properties** to adjust the legend's size, position, background, border, padding, text, and indicator. ![Chart legend settings](https://docs.flutterflow.io/assets/images/legend-59a9d67cbdaad7aad2f0cc6972e67213.webp) ### Change the Background Color The **Chart** widget uses a white background by default. To change it, select the **Chart** widget and choose a color from **Chart Properties > Background Color**.

### Show the Grid Enable **Show Grid** under **Chart Properties** to display grid lines behind the chart data. ### Show the Border Enable **Show Border** under **Chart Properties** to display a border around the chart. Use **Border Color** and **Border Width** to customize its appearance. ### Show the Tooltip Enable **Show Tooltip** under **Chart Properties** to display the Y-axis value when users interact with the chart. Use **Tooltip Background Color** to customize the tooltip background.

### Set Axis Bounds Use **Axis Bounds** under **Chart Properties** to control the range displayed on the chart: - **Min X** and **Max X:** Set where the X-axis starts and ends. These options apply only to line charts. - **Min Y** and **Max Y:** Set where the Y-axis starts and ends. Select the **Chart** widget, open **Chart Properties > Axis Bounds**, and enter the required values. :::note If you leave these fields unset, FlutterFlow Studio determines the axis bounds from the minimum and maximum values in your data. ::: ![Chart axis bounds settings](https://docs.flutterflow.io/assets/images/chart-axis-bound-ec57ed0abfce0eb25109924861c6724b.avif) ### Customize the X-axis Use **X Axis Properties** to configure the axis title and labels: - **Text:** Adds an axis title, such as *Day*, *Week*, or *Month*. You can enter static text or set the value from a variable, then customize its appearance. - **Show Label:** Displays numbers or labels along the X-axis. - **Label Interval:** Controls the spacing between displayed values. - **Label Format Type:** Formats numeric labels. To format larger numbers, select **Number** and configure the **Number Format Options**. :::note For line charts, X-axis numbers are based on **Min X** and **Max X** when [**axis bounds**](#set-axis-bounds) are set; otherwise, FlutterFlow Studio uses the range of the chart data. Bar charts display the labels configured for their data series. ::: This example shows how to customize the X-axis title and labels.

### Customize the Y-axis Use **Y Axis Properties** to configure the axis title and labels: - **Text:** Adds an axis title, such as *Sales*, *Users*, or *Progress*. You can enter static text or set the value from a variable, then customize its appearance. - **Show Label:** Displays numbers along the Y-axis. - **Label Interval:** Controls the spacing between displayed values. - **Label Format Type:** Formats numeric labels. To format larger numbers, select **Number** and configure the **Number Format Options**. :::note Y-axis numbers are based on **Min Y** and **Max Y** when [**axis bounds**](#set-axis-bounds) are set; otherwise, FlutterFlow Studio uses the range of the chart data. ::: This example shows how to customize the Y-axis title and labels.

# Line Chart > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/line-chart Learn how to add a Line Chart widget in your FlutterFlow Studio project. A Line Chart connects data points with a continuous line and is typically used to visualize changes over time. For example, use it to present progress in a format that is easier to understand than a table of values. ## Adding a Line Chart {#adding-line-chart} To add a **Line Chart** widget to your project: 1. Add the **Chart** widget from **Base Elements** or the widget tree. The Line Chart is the default chart type. 2. In the properties panel, open **Chart Data** and then expand **[Line] Chart Data 1**. 3. Choose a **Data Source**: - **Firestore Documents:** Select the document list under **Data** and then choose the **X Value Field** and **Y Value Field**. - **Numbers Lists:** Set the **X Data** and **Y Data** lists. You can also provide **X Labels** and **Y Labels**. 4. To display another line, click **Add Data** and configure the additional line. 5. Under **Chart Properties**, adjust the chart's **Width** and **Height** as needed. :::tip[Using Firestore Documents] To use **Firestore Documents**, [**query a collection**](https://docs.flutterflow.io/resources/backend-query/query-collection) directly on the **Chart** widget or on a top-level widget such as a [**Page**](https://docs.flutterflow.io/resources/ui/pages) or [**Column**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack). :::

## Customizing the Line {#customizing-line} Select the **Chart** widget, open **Chart Data**, then expand **Line Properties**. Configure the line using these options: - **Line Color:** Sets the line color. - **Line Thickness:** Sets the width of the line. - **Dashed Line:** Displays the line using a dashed pattern. - **Curved Lines:** Connects data points with a smooth curve. Disable this option to use straight lines. - **Prevent Overshooting:** Keeps curved lines from extending beyond the actual data values. - **Show Dots:** Displays a dot at each data point. - **Fill Below Line:** Fills the area below the line. Use **Fill Color** to set the fill color.

## Customizing the Chart {#customizing-chart} You can [customize the chart](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/chart#customizing-chart) to match your design by changing the background color, setting axis bounds, showing grid lines, displaying borders, and more. # Bar Chart > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/bar-chart Learn how to add a Bar Chart widget in your FlutterFlow Studio project. A Bar Chart uses rectangular bars to compare values across categories. The height of each bar represents its value. For example, use it to compare income and expenses across different years. ## Adding a Bar Chart {#adding-bar-chart} To add a **Bar Chart** widget to your project: 1. Add the **Chart** widget from **Base Elements** or the widget tree. 2. In the properties panel, set **Chart Type** to **Bar**. 3. Open **Chart Data**, then expand **[Bar] Chart Data 1**. 4. Choose a **Data Source**: - **Firestore Documents:** Select the document list under **Data**, then choose the **Bar Labels Field** and **Bar Values Field**. - **Numbers Lists:** Set the **Bar Labels** and **Bar Values** lists. 5. To display another data series, click **Add Data** and configure its **Bar Values**. New data series appear side by side unless **Stack Bars** is enabled. 6. Under **Chart Properties**, adjust the chart's **Width** and **Height** as needed. :::tip[Using Firestore Documents] To use **Firestore Documents**, [**query a collection**](https://docs.flutterflow.io/resources/backend-query/query-collection) directly on the **Chart** widget or on a top-level widget such as a [**Page**](https://docs.flutterflow.io/resources/ui/pages) or [**Column**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack). :::

## Customizing the Bars {#customizing-bars} ### Customizing an Individual Data Series {#customize-bar-for-an-individual-chart-data} Select the **Chart** widget, open **Chart Data**, then expand **Bar Properties** for the selected data series. Configure it using these options: - **Bar Color:** Sets the bar color for the selected data series. - **Border Width:** Sets the width of the border around each bar. - **Border Color:** Sets the color of the bar borders.

### Customizing All Bars {#customize-all-bars} Select the **Chart** widget and open **Bar Styling Properties**. Configure all bars using these options: - **Bar Width:** Sets the width of each bar. - **Group Spacing:** Sets the space between groups of bars. - **Bar Spacing:** Sets the space between adjacent bars within a group. - **Stack Bars:** Combines multiple data series into stacked bars instead of displaying them side by side. - **Main Axis Alignment:** Controls how the bars are distributed along the chart's horizontal axis. - **Axis Bounds:** Sets the lower and upper bounds of the Y-axis using **Min Y** and **Max Y**.

## Customizing the Chart {#customizing-chart} You can [customize the chart](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/chart#customizing-chart) to match your design by changing the background color, setting axis bounds, showing grid lines, displaying borders, and more. # Pie Chart > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/pie-chart Learn how to add a Pie Chart widget in your FlutterFlow Studio project. A Pie Chart divides a circle into sections to show how values are distributed across categories. For example, use it to compare the distribution of different pet types in a survey. ## Adding a Pie Chart To add a **Pie Chart** widget to your project: 1. Add the **Chart** widget from **Base Elements** or the widget tree. 2. In the properties panel, set **Chart Type** to **Pie**. 3. Open **Chart Data**, then expand **[Pie] Chart Data 1**. 4. Choose a **Data Source**: - **Firestore Documents:** Select the document list under **Data**, then choose the **Legend Labels Field** and **Section Values Field**. - **Numbers Lists:** Set the **Legend Labels** and **Section Values** lists. The number of labels must match the number of values. - **Single Value:** Set the **Section Value**, then click **Add Data** for each additional section. 5. Under **Pie Chart Properties**, click **Add Color** under **Pie Chart Color**. Add at least one color for each section so every section has a distinct color. 6. Under **Chart Properties**, adjust the chart's **Width** and **Height** as needed. :::tip[Using Firestore Documents] To use **Firestore Documents**, [**query a collection**](https://docs.flutterflow.io/resources/backend-query/query-collection) directly on the **Chart** widget or on a top-level widget such as a [**Page**](https://docs.flutterflow.io/resources/ui/pages) or [**Column**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack). :::

## Customizing the Sections Select the **Chart** widget, open **Chart Data**, then expand **Pie Chart Properties**. Configure the sections using these options: - **Pie Chart Radius:** Sets the overall size of the pie chart. - **Section Borders:** Use **Border Color** and **Border Width** to style the border around each section. - **Pie Chart Colors:** Sets the color of each section. Click **Add Color** to add more colors or use the delete icon to remove one. - **Width and Height:** Set the overall chart dimensions under **Chart Properties**. - **Show Legend:** Displays a legend that associates each section label with its color. - **Donut Hole Radius:** Adds an inner circle and sets its size, turning the pie chart into a donut chart. - **Donut Hole Color:** Sets the color of the inner circle. - **Section Spacing:** Sets the space between adjacent sections. - **Start Angle:** Sets the angle at which the first section begins. - **Section Label Type:** Choose **None** to hide labels, **Value** to display the section values, or **Percent** to display their percentage of the total. When labels are enabled, use **Label Position**, **Label Format Type**, and **Section Label Style** to configure the theme text style, font family, font weight, font size, text color, alignment, and shadows.

## Customizing the Chart You can [customize the chart](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/chart#customizing-chart) to match your design by changing the background color, showing and styling the legend, displaying borders, and more. # AspectRatio > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/aspect-ratio Learn how to add an AspectRatio widget in your FlutterFlow Studio app. The `AspectRatio` widget lets you maintain a consistent width-to-height ratio for its child widget. Instead of setting fixed pixel dimensions, you define a ratio, and the widget calculates the height automatically based on the available width. This keeps your UI proportionally consistent across all screen sizes without manual math. Use it whenever a child widget needs to maintain a predictable shape, regardless of the device — media thumbnails, video players, hero images, or uniform card layouts.

In the widget tree, AspectRatio sits as a wrapper around a single child widget, typically an `Image` or `Video player`. The structure looks like this: ``` Container └── AspectRatio └── Image ``` AspectRatio controls the bounding box. Whatever child you place inside fills that box. ## Configuring the Ratio Select the AspectRatio widget to open its properties panel. Under **Aspect Ratio**, you'll find a **Ratio** dropdown. ### Preset Ratios The **Aspect Ratio** widget ships with seven presets covering the most common layout needs: | Preset | Decimal | Best For | | --- | --- | --- | | 1:1 | 1.0 | Profile pictures, avatars, square thumbnails | | 4:3 | 1.333 | Standard photos, product images | | 3:2 | 1.5 | Photography, editorial cards | | 16:9 | 1.778 | Video players, YouTube thumbnails, hero banners | | 9:16 | 0.563 | Vertical video (Reels, Shorts, Stories) | | 3:4 | 0.75 | Portrait photos, book covers | | 2:3 | 0.667 | Posters, portrait cards | ### Custom Value If none of the presets fit your design, select **Custom** from the dropdown. A **Value** field appears where you enter the ratio as a decimal number. The formula is simple: divide width by height. - A 5:4 ratio → enter `1.25` - A 21:9 ultra-wide ratio → enter `2.333` - A 4:5 Instagram portrait → enter `0.8` #### Dynamic Ratio with Variable Binding The **Value** field supports variable binding. This lets you drive the ratio dynamically at runtime. **Example use case:** You're building a media feed that shows both landscape videos and portrait photos. Store the ratio as an `double` field in your data model and bind the AspectRatio's value to it. When the feed loads, each card adopts the correct shape automatically — no hardcoded layouts needed. ## Constraint Warning When AspectRatio is placed inside a parent that provides tight constraints in both dimensions, meaning the parent has already fixed both the width and height, the widget displays a warning. **What it means:** AspectRatio works by taking the available width and calculating height from the ratio. If the parent has locked the height too, there is no room for AspectRatio to do its job. The ratio is ignored, and the child simply fills the parent's fixed dimensions. **Common triggers:** - Nesting it inside a `Container` that has both a fixed width and fixed height set - Placing AspectRatio inside a `Row` without wrapping it in an `Expanded` or `SizedBox` - Putting it inside a `Column` with `MainAxisSize` set in a way that squeezes available space **How to fix it:** - Remove the fixed height from the parent `Container` and let AspectRatio drive the height. - If inside a `Row`, wrap AspectRatio in an `Expanded` widget so it receives unconstrained width first. # Badge > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/badge The Badge widget displays a small indicator over a child widget. It commonly shows a numeric count, but it can also display short text. For example, use it to show the number of unread notifications or items in a shopping cart. The **Badge** widget displays a small indicator over a child widget. It commonly shows a numeric count, but it can also display short text. For example, use it to show the number of unread notifications or items in a shopping cart. ![Badges displaying notification and shopping cart counts](https://docs.flutterflow.io/assets/images/img_3-cb5b5453c62028011d19f823b3e07cd9.png) ## Adding the Badge Widget To add the Badge widget: 1. Drag the **Badge** widget from the **Base Elements** section to the desired location, such as the **Actions** section of an AppBar. 2. Add a child widget, such as an **IconButton**, and customize it as needed. 3. Under **Badge Properties**, adjust **Padding** to position the badge over the child widget.

## Customizing the Badge Widget Select the **Badge** widget and use **Badge Properties** to customize its content, appearance, and behavior: - **Text:** Sets the text displayed in the badge, typically a number. You can enter a fixed value or set it dynamically from a variable, then expand **Text** to customize the text style. - **Show Badge:** Controls whether the badge is visible. Set this option from a variable to show the badge only when users need to see it. - **Badge Color:** Sets the badge's background color. - **Elevation:** Controls the badge's visual depth and shadow prominence. Use `0` to remove the shadow. - **Position (Start or End):** Positions the badge on the start or end side of its child widget. - **Padding:** Adjusts the space around the badge to fine-tune its position over the child widget. - **Animate:** Controls whether the badge animates when its value changes. # Barcode > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/barcode The Barcode widget converts a value into a scannable 1D or 2D barcode, such as a QR code. Use it for product identifiers, inventory labels, URLs, tickets, or onboarding links. The **Barcode** widget converts a value into a scannable 1D or 2D barcode, such as a QR code. Use it for product identifiers, inventory labels, URLs, tickets, or onboarding links. Users can scan the generated code with a camera app or supported barcode scanner. You can also let users scan codes inside your FlutterFlow Studio app with the [**Scan Barcode / QR Code** action](#scan-barcode--qr-code-action). ![barcode-qr-code-scanning](https://docs.flutterflow.io/assets/images/barcode-qr-code-scanning-b3f50d9d1cf6f52e17b3628ab1966507.webp) ## Adding the Barcode Widget To add and configure a barcode: 1. Add the **Barcode** widget from the **Base Elements** section of the Widget Palette. 2. Set **Barcode Dimensions** to **1D Barcode** for linear formats or **2D Barcode** for formats such as QR Code, PDF417, Data Matrix, Aztec, and RM4SCC. 3. Choose a **Barcode Type**. The available types depend on the selected **Barcode Dimensions** option. See [**Barcode Types**](#barcode-types) for a brief description of each option. 4. Enter the data to encode under **Barcode Value**, or use **Set from Variable** to supply a dynamic value from your app state, backend, or another source. Ensure that the value matches the requirements of the selected barcode type. For example, UPC formats accept specific numeric values, while QR codes can contain text or URLs. ### Barcode Types When **1D Barcode** is selected, you can use the following types: | Type | Common use | | --- | --- | | **ITF-16** | Encodes 16-digit numeric values for packaging and distribution. | | **ITF-14** | Identifies cartons and shipping containers using a 14-digit GTIN. | | **EAN 13** | Identifies retail products internationally using 13 digits. | | **EAN 8** | Provides a compact eight-digit product code for small packages. | | **EAN 5** | Adds a five-digit supplemental code, commonly used for book prices. | | **EAN 2** | Adds a two-digit supplemental code, often used for magazine issues. | | **ISBN** | Encodes an International Standard Book Number for books and publications. | | **Code 39** | Encodes uppercase letters, numbers, and a limited set of symbols. | | **Code 93** | Provides a denser, more reliable alternative to Code 39. | | **UPC-A** | Identifies retail products in North America using 12 digits. | | **UPC-E** | Provides a compact version of UPC-A for smaller packages. | | **Code 128** | Encodes letters, numbers, and symbols in a compact format. | | **GS1-128** | Encodes supply-chain data such as product, batch, and expiration details. | | **Telepen** | Encodes numeric or ASCII data, commonly for inventory and library systems. | | **Codabar** | Encodes numbers and a few symbols for libraries, blood banks, and logistics. | | **Interleaved 2 of 5 (ITF)** | Encodes pairs of digits for warehouse, distribution, and packaging labels. | When **2D Barcode** is selected, the following types are available: | Type | Common use | | --- | --- | | **RM4SCC** | Encodes postal routing information for Royal Mail. FlutterFlow Studio lists this format under **2D Barcode**. | | **QR-Code** | Stores text, URLs, contact details, and other data for quick scanning. | | **PDF417** | Stores larger amounts of data on IDs, tickets, and transport documents. | | **Data Matrix** | Encodes data in a compact square code for small items and industrial parts. | | **Aztec** | Stores data in a compact code that does not require a surrounding blank area. |

## Customizing the Barcode Widget Select the **Barcode** widget and use the Properties panel to customize its appearance: - **Width and Height:** Set the widget's dimensions. - **Foreground Color:** Set the color of the barcode lines or pattern. - **Background Color:** Set the color behind the barcode. - **Show Text:** Display the encoded value below a 1D barcode. This option is not available for 2D barcodes. ## Scan Barcode / QR Code [Action] The **Scan Barcode / QR Code** action opens a camera interface that lets users scan a code and use its value in your app. To configure the action: 1. Select the widget that should start the scan and open the [**Action Flow Editor**](https://docs.flutterflow.io/resources/functions/action-flow-editor). 2. Add the **Scan Barcode / QR Code** action to the desired trigger. 3. Enable **Barcode Mode** to display a barcode-style scanner overlay, or leave it disabled to display a QR code-style scanner overlay. 4. Optionally, customize the **Cancel Button Text**. The default text is **Cancel**. 5. Enter an **Output Variable Name** to store the scanned value. You can access it in subsequent actions by selecting **Set from Variable > Action Outputs**. # Blur > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/blur Learn how to use the Blur widget in your FlutterFlow Studio app. The **Blur** widget applies a blur effect to its child or to the content behind it. Use it to soften images, obscure sensitive content, or create effects such as frosted glass. ## Adding the Blur Widget To add a blur effect: 1. Add the **Blur** widget from the **Base Elements** section of the Widget Palette. 2. Add the widget you want to blur as its child. 3. Select the **Blur** widget and configure its settings under **Blur Properties** in the Properties panel.

## Blurring the Background By default, the Blur widget applies the effect to its child. Enable **Backdrop** to blur the content behind the widget instead. This is useful for creating frosted-glass panels, overlays, and translucent navigation elements. :::tip For a frosted-glass effect, place a semi-transparent widget inside the Blur widget and enable **Backdrop**. :::

## Customizing the Blur Widget Select the **Blur** widget and use the following settings under **Blur Properties**: - **Sigma X:** Controls the horizontal blur strength. - **Sigma Y:** Controls the vertical blur strength. - **Backdrop:** Applies the blur to the content behind the widget instead of its child. - **Should Apply Blur:** Turns the effect on or off. Use **Set from Variable** to control it dynamically using app state, backend data, or another source. - **Apply Clip:** Clips the blurred area to a rectangular or circular shape. Disable this option when you do not want to clip the blur. - **Border Radius:** Rounds the corners of the rectangular clip. This setting is available when **Apply Clip** uses the rectangular shape. Higher **Sigma X** and **Sigma Y** values produce a stronger blur. Setting both values to `0` removes the blur. # Calendar > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/calendar Learn how to use the Calendar widget in your FlutterFlow Studio project. The **Calendar** widget allows users to view and select dates, making it ideal for booking appointments, managing schedules, displaying events, or filtering records by date. ## Adding a Calendar Widget To add and configure a calendar: 1. Add the **Calendar** widget from the **Base Elements** section of the Widget Palette. 2. In the **Calendar** section, choose a **Style**: **Modern** or **Material**. 3. Set **Selection** to **Single Date** or **Date Range**. 4. Set the initial value for your selection type: - For **Single Date**, use **Initial Date**. - For **Date Range**, use **Initial Range Start** and **Initial Range End**. For example, use **Single Date** for an appointment picker or **Date Range** for a hotel stay. You can set the initial date or range from app state, backend data, an API response, or another dynamic source.

## Using the Selected Date Use the Calendar's widget state to read a selected date, and its event to run actions when a date is selected: - **calendarSelectedDay widget state:** Provides the selected date. Choose **Set from Variable > Widget State > calendarSelectedDay** to use it in a property or action. - **On Date Selected event:** Runs when the user selects a date. Configure it from the Calendar widget's **Actions** tab. For example, use **On Date Selected** to update a list of available appointment times for the date in **calendarSelectedDay**. :::tip For range selection, **calendarSelectedDay** provides start and end values. Choose **Start** or **End** under **Range Part** when using the value. Both values return the same date for single-date selection. ::: ## Customizing the Calendar Widget Select the **Calendar** widget and use the **Calendar** section to customize its appearance and behavior: ### Layout and Navigation - **Icon Colors:** Sets the color of the calendar navigation icons. - **Week View:** Shows one week at a time instead of the full month. - **Start week on Monday:** Starts each week on Monday instead of Sunday. - **Row Height:** Sets the size of each date cell. In the **Modern** style, date cells are square, so this value sets both their width and height. - **Header:** Choose **Label** to show the month and year as text, or **Dropdown** to let users jump to another month or year. - **Months Shown:** Sets how many months appear side by side. Showing multiple months can make date-range selection easier. - **Cell Radius:** Sets the rounding of date cells. The border radius in **Selected Date Style** overrides it for the selected date; the border radius in **Range Style** overrides it for the ends of a selected range. - **Show Outside Days:** Fills the first and last weeks with dates from the previous and next months. - **Fixed Weeks:** Always shows six weeks so the calendar stays the same height when users move between months. - **Show Week Numbers:** Shows the week-of-year number beside each week. - **Show Navigation:** Shows buttons for moving to the previous or next month. Turn it off if actions control the displayed month instead. - **Booked Dates:** Provide a list of `DateTime` values for dates that cannot be selected, such as reserved days. For example, a calendar could show 14, ~~15~~, ~~16~~, 17 when 15 and 16 are booked. ### Date Styles - **Title Style:** Customizes the month and year title. - **Day of Week Style:** Customizes the weekday labels shown above the dates. - **Date Style:** Customizes the appearance of regular dates. - **Selected Date Style:** Customizes the appearance of the currently selected date. - **Range Style:** Customizes the appearance of a selected date range, including the rounding at its ends. - **Today Date Style:** Customizes the appearance of today's date. - **Booked Date Style:** Customizes the appearance of dates provided under **Booked Dates**. - **Inactive Date Style:** Customizes inactive dates, such as dates outside the currently displayed month. # Card > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/card Learn how to add and customize a Card widget in FlutterFlow Studio. The [Card](https://api.flutter.dev/flutter/material/Card-class.html) widget displays related content on a surface with rounded corners and a shadow. Use it for product details, restaurant details, profiles, or other content that should appear as a single item. ![Card widgets used for products and team profiles](https://docs.flutterflow.io/assets/images/card-widget-use-cases-f95354641c0b5fde70a36f7624948459.avif) ## Adding a Card Widget To add a Card widget: 1. Add the **Card** widget from the **Layout Elements** section of the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette). 2. Add a layout widget, such as a **Row** or **Column**, as its child. 3. Add and arrange the content inside the layout widget.

## Card vs Container Use a **Card** when you want a Material-style surface with built-in elevation, rounded corners, and a background color. Use a [**Container**](https://docs.flutterflow.io/resources/ui/widgets/container) when you need more control over dimensions, alignment, borders, gradients, or other decorations. ## Using Cards with Dynamic Data To display repeated records, place a **Card** inside a **ListView** or **GridView**, then [**generate dynamic children**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/generate-dynamic-children) from a list or backend query. Bind the widgets inside the Card to the current item to show information such as a product image, name, price, or user profile. ## Customizing a Card Widget Select the **Card** widget and use the **Card Properties** section to customize its appearance: - **Color:** Sets the card's background color. - **Elevation:** Controls the card's shadow and visual depth. Use `0` to remove the shadow. - **Border Radius:** Rounds the card's corners. Apply one value to every corner or configure each corner separately. # Carousel > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/carousel Learn how to add and customize a Carousel widget in your FlutterFlow Studio project. The **Carousel** widget displays a sequence of images or other content within a limited area. Use it for product highlights, onboarding steps, featured articles, testimonials, and other content that users can browse horizontally or vertically.

## Adding a Carousel Widget To add and configure a Carousel widget: 1. Add the **Carousel** widget from **Layout Elements** in the **Widget Palette**. 2. In the **Properties Panel**, use **Active Page** to select the Carousel Page (slide) you want to preview and edit. 3. Click **+ Add Page** to add a page. To remove one, select its **Carousel Page** in the **Widget Tree** and delete it. 4. Replace the default Image widget or add other widgets to build the content for each page. :::tip Each Carousel page can contain a complete widget tree instead of only an image. For example, you can combine text, buttons, images, and other widgets to create onboarding steps or featured-content cards. :::

## Customizing a Carousel Widget Select the Carousel widget and use the following options in the **Properties Panel**: - **Axis:** Sets whether users move through the pages horizontally or vertically. - **Initial Page Index:** Sets the page displayed when the Carousel loads. Page indexes are zero-based: `0` is the first page, `1` is the second, and so on. - **Loop Carousel Contents:** Allows continuous navigation between the first and last pages. - **Wrap Items in Center Widget:** Centers the content within each Carousel page. - **Viewport Fraction:** Sets how much of the available viewport the focused page occupies. Enter a value from `0` to `1`. - **Shrink Factor:** Scales pages that are not in focus. Enter a value from `0` to `1`, where `1` keeps them at full size and `0.5` displays them at half size. - **Autoplay:** Automatically advances through the pages. Enable **Loop Carousel Contents** if autoplay should continue from the last page back to the first. - **Duration:** Sets the page transition time in milliseconds when autoplay is enabled. - **Delay:** Sets, in milliseconds, how long each page remains visible before autoplay advances. ## Using Dynamic Carousel Pages You can create Carousel pages from a list, such as records returned by a backend query. Select the Carousel widget, open the [**Generate Dynamic Children**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/generate-dynamic-children) tab, and select the list that will provide the Carousel content. Configure the widgets on the generated Carousel page and bind their values to the current list item. FlutterFlow Studio repeats the Carousel page for every item in the list, making this approach useful for product galleries, promotional content, testimonials, or any collection with a variable number of items. ## Triggering Actions on Page Change Use the **On Page Change** trigger to run an action whenever the displayed page changes. For instance, you can update a custom page indicator, save the current page index, or show a message. To add the trigger, select the Carousel widget, open the **Actions** tab in the **Properties Panel**, choose **On Page Change**, and add the action you want to run.

:::tip To use the displayed page index in an action or widget, select **Set from Variable > Widget State > [Carousel name] > Carousel Current Index**. ::: ## Control Carousel [Action] The **Control Carousel** action lets users navigate the Carousel with a button, icon, or another interactive widget instead of relying only on swiping. To configure it: 1. Select the button, icon, or other interactive widget that will control the Carousel. 2. Add an action under the appropriate trigger, such as **On Tap**, and select **Control Carousel**. 3. Select the Carousel you want to control and choose an action type. ### Action Types - **Previous:** Moves to the previous page. - **Next:** Moves to the next page. - **First:** Moves to the first page. - **Last:** Moves to the last page. - **Jump To:** Moves to a specific page using the same zero-based index described above. # Count Controller > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/count-controller Learn how to add, configure, and use a Count Controller widget in your FlutterFlow Studio app. 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. ## Adding a Count Controller Widget To add a Count Controller widget: 1. Add the **Count Button** widget from **Form Elements** in the **Widget Palette**. 2. To configure the count behavior, use the following options: - **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. For an inventory selector, you might set **Initial Count**, **Step Size**, and **Minimum** to `1`, and set **Maximum** to the available stock.

## Accessing the Current Count The Count Controller stores its latest value in its [**widget state**](https://docs.flutterflow.io/concepts/state-management/widget-state). To use the value in another widget or action, select **Set from Variable > Widget State > [Count Controller name]**. You can use this value to calculate a total price, control conditional visibility, pass a quantity to an action, or save the selection to your backend. ## Triggering an Action When the Count Changes Use the **On Count Changed** trigger to run an action whenever the user increases or decreases the value: 1. Select the Count Controller widget and open the **Actions** tab in the **Properties Panel**. 2. Select **On Count Changed** and add the action you want to run. 3. Use the Count Controller's current widget state value wherever the action requires the latest count. ## Customizing a Count Controller Widget Select the Count Controller in the **Widget Tree** or on the canvas, then use the following sections in the **Properties Panel**. ### Style Properties - **Decrement Icon:** Select the icon used to decrease the count, then set its **Icon Size** and **Icon Color**. - **Increment Icon:** Select the icon used to increase the count, then set its **Icon Size** and **Icon Color**. - **Disabled Icon Color:** Sets the color of the decrement icon when the count reaches its minimum value and the increment icon when it reaches its maximum value. - **Count Text Style:** Controls the appearance of the count using **Theme Text Style**, **Font Family**, **Font Weight**, **Font Size**, **Text Color**, **Line Height**, **Letter Spacing**, and **Text Align**. ### Container Properties - **Shape:** Displays the Count Controller in a rectangular or circular container. - **Width and Height:** Sets the container dimensions using pixels or percentages. - **Fill Color:** Sets the container's background color. - **Border Color:** Sets the container border color. - **Border Radius:** Rounds the container corners. You can apply the same value to every corner or configure each corner separately. - **Border Width:** Sets the thickness of the container border. - **Elevation:** Adds a shadow beneath the container to create visual depth. - **Gradient:** Applies a gradient to the container background. # Credit Card Form > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/credit-card-form Learn how to add, use, and customize a Credit Card Form widget in your FlutterFlow Studio app. The **Credit Card Form** widget lets users enter a card number, expiration date, and card verification value (CVV). Use it when accepting credit card payments through the [**Braintree integration**](https://docs.flutterflow.io/integrations/payments/braintree). The form collects the card details required by the payment flow, but it does not process a payment on its own. To complete the transaction, use it with the **Braintree Payment** action. :::caution[Sensitive payment information] Do not store card numbers, expiration dates, or CVVs in app state, databases, logs, or analytics. Configure and process the payment through the [**Braintree payment workflow**](https://docs.flutterflow.io/integrations/payments/braintree). ::: ## Adding a Credit Card Form Widget To add a Credit Card Form widget: 1. From **Form Elements** in the **Widget Palette**, add the widget listed as **CreditCardForm**. 2. Select the widget, then configure the following settings as needed in the **Properties Panel**. - **Obscure Card Number:** Controls whether the card number remains masked during entry. - **Obscure CVV:** Controls whether the CVV remains masked during entry. - **Line Spacing:** Sets the vertical space between the form's input rows.

## Using the Credit Card Form To use the Credit Card Form: 1. Complete the [**Braintree setup**](https://docs.flutterflow.io/integrations/payments/braintree#1-setup-payments-integration) for your project. 2. Add the Credit Card Form and a checkout button to the same page. 3. Add the [**Braintree Payment**](https://docs.flutterflow.io/integrations/payments/braintree#3-trigger-payment-action) action to the button and select **Credit Card** as the payment method. The Braintree Payment action uses the details entered in the form to process the transaction. ## Customizing the Credit Card Form Widget ### Text Style Use **Text Style** to control the font, size, weight, color, and alignment of text in the card fields. ### Input Decoration Properties - **Input Border Type:** Sets the border type to **Outline**, **Underline**, or **None**. - **Filled:** Adds a background fill to the input fields. - **Border Color:** Sets the border color. - **Fill Color:** Sets the input background color when **Filled** is enabled. - **Border Width:** Sets the border thickness. - **Border Radius:** Rounds the field corners. Apply one value to all corners or configure each corner separately. - **Content Padding:** Sets the left, top, right, and bottom spacing between the field content and its border. - **Dense:** Reduces the vertical space used by the input fields for a more compact form. # DataTable > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/datatable Learn how to add, populate, sort, search, select, paginate, and style a DataTable widget in FlutterFlow Studio. The DataTable widget displays structured data in rows and columns. It is useful for presenting datasets such as employee directories, inventories, orders, and reports. The DataTable can be configured with pagination, sorting, searching, row selection, and horizontal scrolling for smaller screens. ![A paginated DataTable displaying employee records](https://docs.flutterflow.io/assets/images/paginated-data-table-fi-241b9c9d3b840863978519b7cbe56f35.avif) ## Adding the DataTable Widget 1. Open the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette) and locate **DataTable** under **Layout Elements**. 2. Drag the widget onto the canvas or add it from the Widget Tree. 3. Configure the two predefined child widgets: - **DataTableHeader** defines a column heading. Select its **Text** widget to change the heading. - **DataTableCell** displays a value in each generated row. It contains a Text widget by default, but you can replace it with another widget. 4. To change the number of columns, select the DataTable and set **Paginated Data Table Properties > Number of Columns**. ![DataTableHeader and DataTableCell widgets identified with arrows](https://docs.flutterflow.io/assets/images/data-table-header-32139061a311a14196747f3a3dccee60.avif) ### Populating the DataTable with Data The following example displays employee records retrieved from Firestore: 1. Retrieve the records by adding a [Query Collection](https://docs.flutterflow.io/resources/backend-query/query-collection) to a parent widget, such as the Page or Column. Alternatively, run a **Query Collection** action when the page loads and store its result in [page state](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#page-state). 2. Select the DataTable and [generate dynamic children](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/generate-dynamic-children) from the retrieved list. 3. Select each **DataTableCell > Text** widget and bind it to the appropriate field in the current record. :::note Retrieve the data from a parent widget or an action instead of querying directly on the DataTable. This keeps the complete list available for operations such as sorting, searching, and row selection. See [**Backend Query**](https://docs.flutterflow.io/resources/backend-query) for more information. :::

:::tip[Tables on smaller screens] Set **Min Width** when the columns need more space than the available width of the screen. This enables horizontal scrolling and prevents cell content from becoming too narrow. See [**Setting a Minimum Width**](#setting-a-minimum-width) for details. ::: ## Searching the DataTable Use [Simple Search](https://docs.flutterflow.io/integrations/search/simple-search) to filter records that are already available on the device: 1. Add a TextField where users can enter a search term. 2. Add the **Simple Search** action to an appropriate TextField event, such as **On Changed** or **On Submit**. 3. Select **Documents** as the search type and use the complete list of records as the source. 4. Set **Search Term** from the TextField's widget state and choose the fields that users can search. 5. Store the search result in page state. 6. When generating the DataTable rows, use a [Conditional Value](https://docs.flutterflow.io/resources/functions/conditional-logic#conditional-value-ifthenelse) to display the complete list when the search term is empty and the filtered list otherwise. 7. When the user clears the TextField, clear the stored search result so the DataTable displays the complete list again. :::caution Simple Search is intended for smaller datasets that have already been retrieved. For large datasets, perform the search through your backend or a dedicated search service. ::: ## Selecting Rows Enable row selection when users need to perform an action on one or more records, such as editing, deleting, or exporting them. 1. Create a [page state](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#creating-a-page-state) variable that stores a list of the selected records. 2. Select the DataTable and enable **Paginated Data Table Properties > Selectable**. 3. On the button that processes the selection, add an [Update Page State](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#update-page-state-action) action. 4. Get the selected indices from **Widget State > DataTable Selected Rows**. Pass them and the list currently generating the DataTable rows to a [custom function](https://docs.flutterflow.io/concepts/custom-code/custom-functions). If the table is filtered or sorted, use that filtered or sorted list rather than the original list. For example, the following function returns the employee records at the selected indices: ```jsx List getSelectedEmployees( List employees, List selectedIndices, ) { /// MODIFY CODE ONLY BELOW THIS LINE return selectedIndices .where((index) => index >= 0 && index < employees.length) .map((index) => employees[index]) .toList(); /// MODIFY CODE ONLY ABOVE THIS LINE } ``` ## Handling DataTable Events Add actions to DataTable events from the **Actions** tab in the Properties Panel. ### On Sort Changed **On Sort Changed** runs when a user selects a column header that has sorting enabled. It provides: - **Sorted Column Index**: The zero-based index of the selected column. For example, `0` represents the first column. - **Is Ascending**: Whether the selected sort direction is ascending. To add sorting: 1. Select each **DataTableHeader** that users can sort and enable **Sortable**. 2. Select the DataTable and add an action under **On Sort Changed**. 3. Pass **Sorted Column Index**, **Is Ascending**, and the list currently generating the DataTable rows to a custom function. 4. Update the page state variable that generates the DataTable rows with the function result. :::note The DataTable reports the selected column and direction but does not sort the records automatically. Your action must update the list used to generate the rows. ::: The following example sorts a copy of the employee list without modifying the input list: ```jsx List sortEmployees( List employees, bool isAscending, int sortColumnIndex, ) { /// MODIFY CODE ONLY BELOW THIS LINE final sortedEmployees = List.from(employees); switch (sortColumnIndex) { case 0: sortedEmployees.sort((a, b) => a.name.compareTo(b.name)); break; case 1: sortedEmployees.sort((a, b) => a.age.compareTo(b.age)); break; case 2: sortedEmployees.sort((a, b) => a.position.compareTo(b.position)); break; } return isAscending ? sortedEmployees : sortedEmployees.reversed.toList(); /// MODIFY CODE ONLY ABOVE THIS LINE } ```

### On Page Changed **On Page Changed** runs when a user navigates to another table page. It provides **Current Row Index**, the zero-based index of the first row on the new table page. For example, when each table page contains 25 rows, the second table page starts at index `25`. For an API that uses offset-based pagination: 1. Add an API call action under **On Page Changed**. 2. Pass **Current Row Index** as the API's `offset` query parameter. 3. Pass the configured rows-per-page value as the API's `limit` query parameter. 4. Use the API result to update the list displayed by the DataTable. See [Query Parameters](https://docs.flutterflow.io/resources/backend-logic/rest-api#query-parameters) for information about passing dynamic values to an API call. ### On Rows Per Page Changed **On Rows Per Page Changed** runs when a user changes how many rows the DataTable displays on each page. For an API-backed DataTable: 1. Select the DataTable and add an action under **On Rows Per Page Changed**. 2. Use the event's rows-per-page value to update the API's `limit` or the corresponding page state variable. 3. Reset the stored pagination offset to `0`. 4. Call the API again and update the list displayed by the DataTable. ## Customizing the DataTable Select the DataTable and use the Properties Panel to configure the following options. ### Paginated Data Table Properties - **Number of Columns** sets the number of columns in the table. - **Number of Rows (Optional)** sets the total number of rows in the DataTable. Leave it unset to use the number of generated rows. - **UI Builder Number of Rows (Optional)** sets how many sample rows appear on the canvas while designing the page. It does not limit the rows displayed in the running app. - **Paginated** displays the rows across multiple pages. Disable it to use a regular DataTable without pagination. - **Hide Paginator** hides the pagination controls. - **Show First And Last Buttons** adds shortcuts to the first and last pages. - **Selectable** allows users to select one or more rows. - **Rebuild Page on Select** appears when **Selectable** is enabled. Enable it to rebuild the page whenever the row selection changes, allowing other widgets that depend on the selection to update immediately. ### Layout Properties - **Table Width** and **Table Height** control the overall table dimensions. You can set these values in pixels or as percentages. - **Header Row Height** controls the height of the column-header row. - **Data Row Height** controls the height of each data row. - **Column Spacing** controls the horizontal space between columns. ### Setting a Minimum Width Under **Layout Properties**, set **Min Width** to define the minimum width of the DataTable. You can enter the value in pixels or as a percentage. If the DataTable's minimum width exceeds the available screen width, the table becomes horizontally scrollable. This prevents column content from being compressed or wrapped excessively on smaller screens.

### Style Properties - **Header Row Color** sets the background color of the header row. - **Row Color** sets the background color of the data rows. - **Alternate Row Color** applies a different background color to alternating rows. - **Sort Icon Color** sets the color of the icon displayed on sortable columns. - **Border Radius** sets the radius of each corner. Use the uniform option to apply the same value to every corner. ### Dividers - Enable **Hide Default Dividers** to remove the DataTable's default row dividers. - Enable **Add Horizontal Dividers** or **Add Vertical Dividers** to add custom separators between rows or columns. After enabling either option, configure its **Color** and **Thickness**. ### Checkbox Colors When **Selectable** is enabled, configure: - **Selected Fill Color** sets the checkbox background when a row is selected. - **Unselected Fill Color** sets the checkbox background when a row is not selected. - **Selected Border Color** sets the checkbox border when a row is selected. - **Unselected Border Color** sets the checkbox border when a row is not selected. - **Check Color** sets the color of the checkmark inside a selected checkbox. ## Best Practices - Keep column headings short and descriptive. - Align numeric values consistently so users can scan and compare them quickly. - Limit the number of visible columns on smaller screens. For complex mobile layouts, consider displaying each record in a **ListView** or **Card** instead. - Choose a rows-per-page value that keeps the table readable without requiring excessive navigation. # Dividers > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/dividers Add a thin horizontal or vertical line, with padding on either side. Customize the color, width Add a thin horizontal or vertical line, with padding on either side. Customize the color, width or height, and style of the divider from the Properties Panel. ## Divider Properties Here are the properties in detail:
![divider.png](https://docs.flutterflow.io/assets/images/divider-7b4c775b67dbc4c100dbe304e2900405.png)
Divider (Horizontal) Properties
![v-divider.png](https://docs.flutterflow.io/assets/images/v-divider-1494face8c703ce035468b4a8d3bf78c.png)
Vertical Divider Properties
- **Line Style**: This property determines the visual pattern of the divider line. Options typically include: - **Solid**: A continuous line. - **Dotted**: A series of dots. - **Dashed**: A series of dashes. - **Dashdotted:** A combination of dashes and dots. - **Color**: Defines the color of the divider line. This can be set using predefined theme colors or custom values to match or contrast with the application's design scheme. - **Thickness**: Specifies the thickness of the divider line, influencing its visual prominence. Thicker lines are more noticeable and can be used to make a bold statement, while thinner lines are subtler. - **Width**: This property sets the horizontal length of the divider. It can be specified in absolute terms (e.g., pixels). - **Height**: For vertical dividers, this property sets the vertical length. Like width, it can also be defined in pixels. - **Indent and End-Indent**: These properties control the spacing from the edges of the container to the start and end points of the divider line, respectively. Indents can be used to fine-tune the placement of the divider within a layout, helping to achieve a balanced or desired aesthetic effect. # Draggable and DragTarget > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/draggable Learn how to build drag-and-drop interactions with the Draggable and DragTarget widgets in FlutterFlow Studio. The **Draggable** and **DragTarget** widgets let users move items from one place to another in your app. Use **Draggable** for the item that can be moved and **DragTarget** for the area where it can be dropped. For example, users can sort items, move tasks between columns, or drag products into a cart. ![A task card moving from a Draggable widget to a highlighted DragTarget area.](https://docs.flutterflow.io/assets/images/draggable-dragtarget-overview-339debc5ec3209e66a697bf776cba1be.png) ## How Draggable and DragTarget Work A drag-and-drop interaction has three parts: 1. The user starts dragging the child of a **Draggable** widget. 2. The Draggable carries its configured data **Value**. 3. A **DragTarget** with a matching data **Type** receives the value and runs the configured actions. The data type controls compatibility between the widgets. The value identifies the dragged item and can be checked before the app updates its state. ## 1. Adding a Draggable Widget 1. Add a **Draggable** widget from the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette). 2. Add the widget that users should drag, such as an **Image**, **Container**, or **Card**, as its child. :::tip The child of a Draggable widget must have its **Width** and **Height** set explicitly. ::: ### Setting the Draggable Data - **Type:** Defines the kind of data carried by the widget. This must match the **Type** configured on the intended DragTarget. - **Value:** Contains the data passed to the DragTarget. The value can be static or set from a variable. For simple interactions, the value can be a string or number that identifies the item. Use a custom data type when the target needs multiple related values, such as a product ID, name, and price.

## 2. Adding a DragTarget Widget 1. Add a **DragTarget** where users should drop an item. 2. Add a child widget to define its visible content and drop area. For example, use a [Container](https://docs.flutterflow.io/resources/ui/widgets/container) to give the target clear boundaries. 3. In the DragTarget properties, set **Type** to the data type used by the corresponding Draggable widgets. The size of the DragTarget determines the area that can detect the dragged item. Make this area large enough to use comfortably, especially on touchscreens.

## 3. Accepting a Draggable Widget A DragTarget accepts data from a Draggable widget when both widgets use the same data **Type**. If their types do not match, the data is rejected and the **On Drag Accept** action does not run. Three Draggable widgets pass data to a String DragTarget. String plant and String spoon are accepted, while Integer 10 is rejected because its type does not match. In this example, the DragTarget accepts the **String** values `plant` and `spoon` but rejects the **Integer** value `10`. To access and process the accepted value: 1. Select the **DragTarget** and open the **Actions** tab. 2. Select **On Drag Accept**. In the action flow, use **Drag Target > Dragged Data** to access the accepted value and process it as needed.

## Handling Drag Events You can use [Action Triggers](https://docs.flutterflow.io/resources/functions/action-triggers) on both widgets to customize the drag-and-drop experience. ### Draggable Events These events are available from the **Actions** tab of the Draggable widget. - **On Drag Started:** Runs when the user starts dragging the widget. - **On Drag Update:** Runs as the widget moves during the drag. - **On Drag Completed:** Runs when a DragTarget accepts the dropped data. - **On Drag Cancelled:** Runs when the item is released without being accepted. - **On Drag End:** Runs when the drag finishes, whether it is completed or cancelled. ### DragTarget Events These events are available from the **Actions** tab of the DragTarget widget. - **On Drag Enter:** Runs when a compatible Draggable enters the target. Use it to highlight the drop area. - **On Drag Exit:** Runs when the dragged item leaves the target. Use it to remove temporary hover feedback. - **On Drag Accept:** Runs when compatible data is dropped and accepted. Use it to inspect the value and update persistent state. ## Customizing the Drag Experience Use the drag events with state variables and conditional styling to make the interaction clear: - Set a temporary state variable with **On Drag Enter** to highlight an active drop area. - Reset the temporary state with **On Drag Exit** when the item leaves the area. - Update persistent app or page state only after **On Drag Accept** runs. - Use **On Drag Started** and **On Drag End** to change the appearance of the draggable item or surrounding interface during the interaction. - Show a message when a dropped value does not meet the target's conditions. Keep hover state separate from the state created after an accepted drop. Resetting persistent state with **On Drag Exit** can undo a completed interaction when the pointer leaves the target. ## Best Practices - Use the simplest data type that contains the information needed after the drop. Use a custom data type when several related values must move together. - Do not rely on color alone to identify an active or valid drop target. Pair color with a border, icon, label, or another visual cue. - For important tasks, provide a tap or button-based alternative to drag and drop. # Expandable > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/expandable An Expandable widget is a user interface component used to show or hide content dynamically. It consists of a header that can be tapped to reveal or collapse additional content. This functionality is particularly useful in interfaces where space is at a premium, such as in mobile applications or complex forms, enabling users to access information on demand without overwhelming the screen with too much content all at once. An Expandable widget is a user interface component used to show or hide content dynamically. It consists of a header that can be tapped to reveal or collapse additional content. This functionality is particularly useful in interfaces where space is at a premium, such as in mobile applications or complex forms, enabling users to access information on demand without overwhelming the screen with too much content all at once. **Default Widget Tree for Expandable Widget** When you add an **Expandable** widget, the default widget tree typically includes: - **Header:** The visible part of the widget when it is both collapsed and expanded. This usually contains a label or icon indicating what the expandable content relates to. - **Collapsed View:** The default state showing minimal content or summarization. - **Expanded View:** Contains more detailed information or additional controls that are visible when the widget is expanded. ![expandable-widget-tree.avif](https://docs.flutterflow.io/assets/images/expandable-widget-tree-7f0f06e1450e64f33575ea6e218275cf.avif) ## Expandable Widget Properties - **Icon Properties:** For Icon Properties, check out the **[Icon](https://docs.flutterflow.io/resources/ui/widgets/icons)** guide. - **Expandable Properties:** - **Active View:** Specifies whether the widget is currently in the collapsed or expanded state. - **Initially Expanded:** Determines if the widget should be expanded by default when the view is first loaded. - **Tap Header to Toggle:** Allows the user to expand or collapse the content by tapping the header. - **Tap Body to Expand/Collapse:** Defines whether tapping on the body of the expanded content can toggle its state. - **Style Properties:** - **Width & Height:** Dimensions of the widget, which can be set to infinity to take full width or height. - **Background Color:** The color behind the expandable content. - **Header Alignment:** Aligns the header content such as left, center, or right. ### Practical Use of Expanded This setup allows for a highly customizable Expandable widget, making it suitable for FAQs, forms, lists, or other content that benefits from a clean, compact initial appearance with options for more detailed information. The ability to fine-tune how and where icons appear, along with the behavior of the widget's expandability, gives developers significant control over user experience and interface design. # Flippable Card > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/flippable-card Learn how to add and customize a FlippableCard widget in your FlutterFlow Studio app. The **FlippableCard** widget displays two sides of content in the same space. It shows the front side by default and flips to the back side when a user taps it. You can use it for flashcards, product details, coupon terms, or other content that users can reveal on demand.

## Adding a FlippableCard Widget To add the FlippableCard widget: 1. Open the [**Widget Palette**](https://docs.flutterflow.io/flutterflow-ui/widget-palette) and add the **FlippableCard** widget from **Layout Elements**. 2. In the **Widget Tree**, select **Card Front**. Customize the default **Container** or replace it with another widget that shows the content you want users to see first. 3. Select the **FlippableCard** widget. In the **Properties Panel**, open **Flippable Card Properties** and enable **Edit Back of Card**. 4. In the **Widget Tree**, select **Card Back**. Customize the default **Container** or replace it with another widget that shows the content users should see after the card flips.

## Customizing Select the **FlippableCard** widget in the **Widget Tree**, then open **Flippable Card Properties** in the **Properties Panel**. ### Editing the Back of the Card Enable **Edit Back of Card** to show and edit the back of the card on the **Canvas**. Disable it to return to the front. This option changes only which side is visible while editing; it does not affect the card's runtime behavior. ### Changing the Flip Direction By default, the card flips horizontally. Use **Flip Direction** to choose one of the following options: - **Horizontal:** Flips the card from left to right or right to left. - **Vertical:** Flips the card from top to bottom or bottom to top. ### Changing the Animation Duration The flip animation lasts `400 ms` by default. Set **Flip Animation Duration** to a shorter duration for a faster animation or a longer duration for a slower one. Enter the duration in milliseconds; for example, `1,000 ms` equals 1 second. ### Disabling Flip on Tap The card flips when tapped by default. Disable **Flip on Tap** if tapping the card should not switch between its front and back sides. ## Best Practices - Use the same dimensions for the front and back sides and test dynamic content to ensure it does not overflow or get clipped. - Make it clear that the card is interactive by using a label, icon, or other visual cue. - Avoid placing essential information only on the back of the card. - Use a short animation duration so the interaction feels responsive. # Markdown > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/markdown Learn how to display and customize Markdown content in your FlutterFlow Studio app. The **Markdown** widget renders formatted content written using [Markdown syntax](https://www.markdownguide.org/basic-syntax/). It supports content such as headings, emphasized text, lists, links, quotes, and code without requiring HTML. Use this widget to display notes, documentation, forum posts, release notes, help content, or other formatted text in your app. ## Adding a Markdown Widget 1. Open the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette) and add the **Markdown** widget from **Base Elements**. 2. Select the widget and open the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel). 3. Under **Data**, enter fixed Markdown content or set the value from a variable. Dynamic content is useful for displaying formatted text from a database, an API response, or generated app content. For example, you can use Markdown to display a privacy policy: ```md # Privacy Policy **Last updated:** September 16, 2026 We use your information to provide and improve our services. ## Information we collect - Account information - App usage data [Contact our privacy team](mailto:privacy@example.com) ```
## Customizing the Markdown Widget ### Making Content Selectable Enable **Selectable** to allow users to select and copy text from the rendered Markdown content. ## Best Practices - Use a consistent heading hierarchy to keep long content easy to scan. - Test long and dynamic content on different screen sizes to prevent clipping or unexpected overflow. - Review Markdown received from external sources before displaying it, especially links. - Use descriptive link text and verify that links work on every target platform. # MediaDisplay > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/media-display Learn how to add and customize a MediaDisplay widget in your FlutterFlow Studio app. The **MediaDisplay** widget displays an image or video using a media URL supplied from a variable. It automatically detects the media type and uses the appropriate image or video behavior, making it useful when the same part of your app can contain either type of media. For example, you can add it to a [ListView](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#listview-widget) to create an activity feed or to a [GridView](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#gridview-widget) to show images and videos together. A variable supplies the media URL to MediaDisplay, which detects whether to display an image or video. ## Adding a MediaDisplay Widget 1. Open the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette) and add the **MediaDisplay** widget from **Base Elements**. 2. Select the widget and open the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel). 3. Under **Media Path**, select **Set from Variable**, then choose the variable that contains the image or video URL. The following walkthrough demonstrates how to add and configure the widget:
### Using Dynamic Media You can set **Media Path** from a database field, API response, state variable, or another variable that contains a media URL. This is useful when each item in a repeating widget displays different media. To display dynamic media in a ListView or GridView: 1. Create a data field that stores the media URL for each record. 2. Add a backend query to the ListView or GridView that returns those records. 3. Place the **MediaDisplay** widget inside the repeating item. 4. Select the **MediaDisplay** widget and choose **Media Path > Set from Variable**. 5. Select the current record, then choose the field that contains its media URL. ## Customizing The settings available for the MediaDisplay widget depend on the type of media it displays. ### Customizing Images When **Media Path** points to an image, use the image settings to control its dimensions, fit, alignment, border, and other appearance options. See [Common Image Properties](https://docs.flutterflow.io/resources/ui/widgets/image#common-image-properties) for details. ### Customizing Videos When **Media Path** points to a video, use the video settings to control playback and appearance. See [VideoPlayer](https://docs.flutterflow.io/concepts/file-handling/displaying-media#videoplayer) for details. ## Best Practices - Use consistent dimensions or aspect ratios when displaying mixed media in a list or grid. - Test the widget with every media type your data can provide. - Make sure dynamically supplied URLs are valid and accessible to your app's users. - Decide how the surrounding layout should handle an empty or invalid media path. - Test loading and scrolling performance when displaying many media items. # MouseRegion > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/mouse-region Learn how to respond to pointer hover events with the MouseRegion widget in FlutterFlow Studio. The **MouseRegion** widget detects when a mouse pointer enters or leaves the area occupied by its child. You can use these events to start an animation, show additional content, or update another part of the interface while the pointer is hovering. :::note MouseRegion interactions are designed for web and desktop apps used with a mouse or a trackpad. Provide a tap-based alternative for touch devices, and do not make essential actions available only on hover. ::: A pointer enters a MouseRegion and triggers On Mouse Enter, then leaves and triggers On Mouse Exit. The following preview shows how a widget can respond when the pointer enters and leaves its MouseRegion:
## Adding a MouseRegion Widget 1. Open the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette) and add the **MouseRegion** widget from **Base Elements**. 2. Add the widget that should respond to hover as the child of **MouseRegion**. 3. Set the child's size and position. The MouseRegion covers the area occupied by its child. 4. Select **MouseRegion** and open the **Actions** tab to configure its [pointer events](#mouseregion-events). The following walkthrough demonstrates how to add MouseRegion and configure its events:
## MouseRegion Events The following events are available from the MouseRegion widget's **Actions** tab: ### On Mouse Enter **On Mouse Enter** runs when the pointer moves into the MouseRegion. Use it to show content, start a [widget animation](https://docs.flutterflow.io/concepts/animations/widget-animations#animation-on-action-trigger), or update a state variable. ### On Mouse Exit **On Mouse Exit** runs when the pointer leaves the MouseRegion. Use it to hide content, stop or reverse an animation, or reset a state variable. ## Customizing Select the **MouseRegion** widget and open **MouseRegion Properties** in the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel). ### Changing the Mouse Cursor Use **Mouse Cursor** to choose the cursor style shown while the pointer is inside the MouseRegion. When the child is clickable, choose a cursor that communicates that interaction. A suitable cursor helps users understand what they can do before they interact. ### Controlling Overlapping MouseRegions Enable **Opaque** when this MouseRegion should prevent MouseRegion widgets behind it from responding to the pointer. This is useful when MouseRegions overlap, such as inside a Stack, and only the region in front should receive hover events. Disable **Opaque** when MouseRegion widgets behind it should remain responsive to the pointer. #### Example: Icon Over a Hoverable Card Suppose a Stack contains a product card that changes elevation on hover and a favorite icon positioned over the card. Both widgets have their own MouseRegion. - Enable **Opaque** on the favorite icon's MouseRegion when hovering over the icon should show its tooltip without also changing the card's elevation. - Disable **Opaque** when hovering over the favorite icon should trigger both the icon and card hover effects. ## Best Practices - Treat hover as an enhancement and provide a tap-based alternative for touch devices. - Keep essential actions and information accessible without requiring hover. - Keep the MouseRegion's size stable while the pointer is inside it to prevent repeated enter and exit events. - Choose a cursor that accurately communicates the interaction. - Test the hover interaction with a mouse and a trackpad. Separately test the tap and keyboard alternatives provided for users who cannot use hover. # PinCode > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/pincode Learn how to collect, validate, and customize PIN and one-time password input with the PinCode widget. The **PinCode** widget provides a row of individual fields for entering a PIN or one-time password (OTP). Use it for flows such as account verification, sign-in, transaction confirmation, or device pairing. You can retrieve the entered code and use it in actions or conditions. FlutterFlow Studio stores this value in the PinCode widget's [Widget State](https://docs.flutterflow.io/concepts/state-management/widget-state). A PinCode widget collects a code, makes it available through Widget State, and sends it to a secure service for verification. :::caution[Handle Codes Securely] Do not expose PINs and OTPs outside the intended input and verification flow. Never include them in snackbars, logs, analytics, or error reports, and do not store them as plain text. Send the entered code to the relevant authentication provider or a secure backend for verification. A client-side comparison alone does not securely verify a code. ::: ## Adding a PinCode Widget 1. Open the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette) and add the **PinCode** widget from **Form Elements**. 2. Select the widget and open the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel). 3. Under **Pin Code Properties**, set **Pin Length** to the number of characters users must enter. The maximum length is `8`. 4. Choose a **Keyboard Type** that matches the expected code. ## PinCode Events The following events are available from the PinCode widget's **Actions** tab. ### On Completed **On Completed** runs when the number of entered characters reaches **Pin Length**. Use it to start a verification request, enable the next step, or update the interface. This event only indicates that every field contains a value. It does not confirm that the entered code is valid. ### On Change **On Change** runs whenever a character is entered or deleted. Use it to update the interface as the value changes. See [On Change](https://docs.flutterflow.io/resources/forms/form-triggers#on-change) for more information. ### On Focus Change **On Focus Change** runs when the PinCode widget gains or loses focus. Use it to update guidance or run validation when the user moves away from the widget. See [On Focus Change](https://docs.flutterflow.io/resources/forms/form-triggers#on-focus-change) for more information. ## Validation Validating a PIN or OTP involves three separate checks: 1. Check that the field is not empty. 2. Check that the code contains the required number of characters. 3. Check that the entered code is correct. ### 1. Require a Code Use a [Form](https://docs.flutterflow.io/resources/forms/form-validation#adding-form-widget) to prevent users from submitting an empty PinCode field: 1. Place the **PinCode** widget inside a **Form** widget. 2. Select the Form and open **Properties Panel > Validation**. 3. Find the PinCode widget, enable its validation, and enter the error message to display when the field is empty. 4. Select the button or control that submits the code and open its **Actions** tab. 5. Add the **Validate Form** action. Under **Select Form to Validate**, choose the Form that contains the PinCode widget. When the user submits the form without entering a code, FlutterFlow Studio displays the error message. ### 2. Confirm the Code Is Complete Before requesting verification, ensure that the user entered every character required by **Pin Length**. You can continue the flow from [**On Completed**](#on-completed), or add a condition that checks whether the entered value contains the required number of characters. ### 3. Verify the Code Send the complete value to your authentication provider or secure backend. Continue the flow only when that service confirms that the code is correct. :::caution Form validation only checks whether the PinCode field is empty. It does not confirm that every field is complete or that the PIN or OTP is correct. ::: ## Customizing Select the **PinCode** widget and open **Pin Code Properties** in the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel). ### Configuring Input - **Pin Length:** Sets the number of characters in the code, up to `8`. - **Keyboard Type:** Uses a numeric keyboard by default. Select **Visible Password** when the code can contain letters and numbers. The keyboard layout can vary by platform. ### Configuring the Entry Animation - **Animation:** Selects the animation used when a character is entered, such as **Slide**. - **Animation Curve:** Controls how the animation speeds up or slows down. Leave it **Unset** to use the default curve. - **Animation Duration (ms):** Sets how long the animation takes in milliseconds. ### Hiding Entered Characters - **Obscure Text:** Replaces each entered character with the selected **Obscuring Character**. - **Obscuring Character:** Selects the character used to hide the entered value. - **Blink When Obscuring:** Adds a brief blink effect when a newly entered character is obscured. - **Blink Duration:** Sets the duration of the obscuring blink in milliseconds. ### Configuring Input Behavior - **Hint Text:** Displays the selected **Hint Character** in each empty field. - **Hint Character:** Selects the character displayed in empty fields when **Hint Text** is enabled. - **Auto Focus:** Focuses the PinCode widget and opens the keyboard when the page loads. Disable it when another element should receive focus first. - **Auto Fill:** Allows supported operating systems to suggest a received verification code. Availability depends on the platform, device settings, and message format. - **Read Only:** Displays the PinCode value without allowing the user to edit it. - **Haptic Feedback:** Provides haptic feedback on supported devices when the user enters a character. ### Aligning the Fields Use **Pin Code Alignment** to position the fields within the available width: - **Start:** Places the fields at the beginning. - **Center:** Centers the fields. - **End:** Places the fields at the end. - **Space Evenly:** Adds equal space before, between, and after the fields. - **Space Around:** Adds space around each field, with smaller spaces at the beginning and end. - **Space Between:** Places equal space between the fields without adding space at the beginning or end. ### Changing Field Shape and Size - Use **Pin Field Shape** to select **Box**, **Circle**, or **Underline**. - Use **Field Width** and **Field Height** to set the dimensions of each field. - When using **Box**, use **Border Radius** to round its corners and **Border Width** to adjust its outline. ### Changing Colors, Fills, and Error Borders Use the following properties to distinguish field states: - **Active Color:** Sets the border color of a field that contains a value. - **Inactive Color:** Sets the border color of an empty field. - **Selected Color:** Sets the border color of the field that currently has focus. - **Background Color:** Sets the background color of the overall PinCode widget, including the area around the individual fields. - **Enable Active Fill:** Determines whether the background of pin fields containing input is filled. When enabled, the next three fill-color properties become available. - **Active Fill Color:** Sets the fill color of a field that contains a value. - **Inactive Fill Color:** Sets the fill color of an empty field. - **Selected Fill Color:** Sets the fill color of the field that currently has focus. - **Error Text Height:** Reserves vertical space for a validation error message. - **Error Border Width:** Sets the width of the field border when validation fails. - **Error Border Color:** Sets the field border color when validation fails. Do not rely on color alone to communicate an error or status. Include clear text guidance or an error message. ### Customizing the Cursor Use **Show Cursor** to show or hide the text cursor and **Cursor Color** to change its color. ### Styling the Entered Text Expand **Pin Code Text Style** to change how entered characters appear: - **Theme Text Style:** Starts with a text style from the project theme. - **Font Family:** Selects the font used for entered characters. - **Font Weight:** Controls the thickness of the characters. - **Styling:** Applies italic, underline, or strikethrough formatting. - **Font Size:** Sets the character size. - **Text Color:** Sets the character color. - **Line Height:** Controls the vertical spacing within each field. - **Letter Spacing:** Adjusts the space around each character. - **Text Align:** Aligns the character inside each field. - **Add Shadow:** Adds and configures a shadow behind the characters. - **Text Overflow Replacement:** Controls how a character is handled when it does not fit inside its field. ## Accessing and Clearing the Value To use the entered code in an action, select **Set from Variable > Widget State**, then choose the PinCode widget. To clear the entered code, the **PinCode** widget must be inside a **Form** widget. You can then add the [Reset Form Field](https://docs.flutterflow.io/resources/forms/reset-form-field) action and select the PinCode widget. Clear sensitive values after verification and when the user requests a new code. ## Best Practices - Verify PINs and OTPs through the relevant authentication provider or a secure backend. - Never expose sensitive codes in snackbars, logs, analytics, or error reports. - Use **Obscure Text** when the code must remain private while it is entered. - Use a numeric keyboard unless the code can contain letters. - Provide clear instructions and validation messages, and do not rely on color alone. - Prevent duplicate verification requests while an earlier request is still in progress. - Clear the value after successful verification, after too many failed attempts, or when the code expires. # ProgressBar > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/progressbar Learn how to display and customize circular or linear progress in FlutterFlow Studio with the ProgressBar widget. The **ProgressBar** widget shows how much of a measurable task has been completed. Use it for file uploads, completed lessons, profile completion, or tasks finished toward a goal. Choose a circular or linear shape, then provide a **Progress Value** between `0.0` and `1.0`. For example, `0.68` displays 68% progress. The same task progress displayed with circular and linear ProgressBar widgets. ## Adding a ProgressBar Widget 1. Add the **ProgressBar** widget from **Base Elements** in the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette). 2. Select the widget and open the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel). 3. Under **Progress Bar Properties**, set **Progress Bar Shape** to **Circular** or **Linear**. 4. Set **Progress Value** to a value between `0.0` and `1.0`, or set it from a variable. 5. Optionally, use **Text** to display a label such as `68%` or `17 of 25`. The following walkthrough demonstrates how to add and configure the widget:
## Setting the Progress Value ### Using a Fixed Value Enter a decimal from `0.0` to `1.0` in **Progress Value**: | Progress Value | Displayed progress | | --- | --- | | `0.0` | 0% | | `0.25` | 25% | | `0.7` | 70% | | `1.0` | 100% | ### Using a Dynamic Value To update the ProgressBar from app data: 1. Select **Set from Variable** beside **Progress Value**. 2. Choose the numeric variable that represents the progress, such as page state, component state, app state, an action output, or backend data. 3. Ensure the resulting value is between `0.0` and `1.0`. If your source stores a percentage as a number between `0` and `100`, divide it by `100` before using it. For example, convert `68` to `0.68`. For completed items, calculate progress as: ```text completedItems / totalItems ``` For example, `17 / 25` produces `0.68`. When the total is `0`, return `0` to avoid dividing by zero. Keep the final value within the `0.0` to `1.0` range. ## Customizing the ProgressBar Select the widget and open **Progress Bar Properties** in the **Properties Panel**. ### Shared Properties - **Progress Bar Shape:** Switches between **Circular** and **Linear**. - **Progress Value:** Sets the completed portion from `0.0` to `1.0`. - **Animate Progress:** Animates the bar from empty to its configured value when it appears. - **Progress Color:** Sets the color of the completed portion. - **Background Color:** Sets the color of the remaining portion. - **Text:** Displays supporting text in the center of the ProgressBar. Use the text-style controls to customize its appearance. ### Circular ProgressBar - **Diameter:** Sets the overall width and height of the circle. Use **PX** for a fixed size or **%** for a size relative to the available space in its parent or on the screen. - **Thickness:** Sets the width of the circular track. - **Start Angle (degree):** Sets where the progress begins. For example, `0` starts at the top, `90` starts at the right, and `180` starts at the bottom. ### Linear ProgressBar - **Width:** Sets the horizontal size of the bar. Use **PX** for a fixed size or **%** for a size relative to the available space in its parent or on the screen. - **Thickness:** Sets the height of the bar. - **End Radius:** Rounds the ends of the bar. Increase the value for more rounded ends. ## Best Practices - Display a meaningful label or percentage when users need the exact progress value. - Do not rely on color alone. Pair it with text that explains what is progressing. - Maintain sufficient contrast between **Progress Color**, **Background Color**, and the surrounding interface. - Keep dynamic values between `0.0` and `1.0` so the displayed progress remains accurate. - Prevent division by zero when calculating progress from completed and total values. - Use a loading indicator instead of an invented percentage when progress cannot be measured. # RatingBar > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/ratingbar Learn how to display a rating or collect one with the RatingBar widget in FlutterFlow Studio. The **RatingBar** widget displays a rating or lets users select one. For example, you can show a product's average rating or ask a customer to rate an order. A read-only RatingBar showing a 4.5-star average beside an interactive RatingBar with a pointer selecting the fourth star. ## Adding a RatingBar Widget 1. Add **RatingBar** from **Form Elements** in the Widget Palette or from the Widget Tree. 2. Select the widget and open **Rating Bar Properties** in the Properties Panel. 3. **Interactive** is enabled by default, allowing users to select a rating. Turn it off to display a rating users cannot change.

## Displaying a Rating With **Interactive** off, set **Rating** to a fixed number or use **Set from Variable** to display a value from your data. For example, bind **Rating** to a course's average score to show it without letting users change it. Decimal values are supported. With five icons, a rating of `1.5` fills one icon and part of the next. Keep the value within the range set by **Icon Count**. ## Collecting a Rating With **Interactive** on, users can choose a rating. The current selection is held in [**widget state**](https://docs.flutterflow.io/concepts/state-management/widget-state). To access the selected rating, use **Set from Variable > Widget State > [RatingBar widget name]**. :::note[Saving a selected rating] **Interactive** lets users change the rating, but their selection is not saved to your data source automatically. To keep the rating for later visits, add an action that writes the selected value to a record, such as a Firestore feedback document. To display that saved rating in an interactive RatingBar, set **Initial Rating** from the record. ::: ## Customizing the RatingBar Select the RatingBar and open **Rating Bar Properties** to set its value and appearance: - **Rating:** With **Interactive** off, sets the displayed rating. Enter a number or use **Set from Variable** to show a value from your data. - **Initial Rating:** With **Interactive** on, sets the rating shown before the user makes a selection. The user can change it. - **Interactive:** Determines whether users can select a rating. Turning it on changes the value field from **Rating** to **Initial Rating**. - **Icon Count:** Sets how many rating icons appear. For a ten-point scale, set this to `10`. - **Icon Size:** Sets the size of each icon. - **Icon Selector:** Changes the icon used for the rating. Choose **Star Rounded** or another icon that suits your use case. - **Rated Color:** Sets the color of the filled portion of the icons. - **Unrated Color:** Sets the color of the unfilled portion. - **Icon Padding:** Sets spacing around each icon. Apply the same padding on all sides or set the top, bottom, left, and right values individually. - **Axis:** Arranges the icons horizontally or vertically. # Signature > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/signature Learn how to capture, upload, save, and clear a signature in FlutterFlow Studio. The **Signature** widget provides a drawing pad where users can sign with a finger, stylus, or mouse. You can clear the drawing, upload it as an image, and save the uploaded image URL in your database. A signature is drawn, uploaded as an image, and referenced by its URL in a database. :::caution A captured signature is sensitive user data. The drawing alone does not verify a user's identity or establish legally valid consent. Design your consent flow for the requirements that apply to your app, and clearly explain how the signature will be used, stored, and deleted. ::: ## Using the Signature Widget ### 1. Adding a Signature Widget To add and size the widget: 1. Add the **Signature** widget from the **Form Elements** section of the **Widget Palette**, or add it from the **Widget Tree**. 2. Select the widget and open the **Properties Panel**. 3. In the **Signature** properties, set its **Width** and **Height**. Give the pad enough space for users to sign comfortably on the smallest supported screen. ![Signature widget selected on an agreement page, with its size and appearance settings outlined in blue.](https://docs.flutterflow.io/assets/images/add-signature-widget-013fb0a390d882cd92fcdf8b6ad30e9a.avif) ### 2. Uploading a Signature The **Upload Signature** action uploads the drawing from a selected Signature widget to Firebase Storage. After the upload succeeds, you can use the uploaded image URL in other widgets or actions. :::note Currently, the **Upload Signature** action supports uploads only to [**Firebase Storage**](https://docs.flutterflow.io/integrations/firebase-storage/storage-rules#deploying-storage-rules). ::: Before starting the upload, make sure the user has drawn a signature. Also disable repeated submission while the upload is running, show progress, and provide a clear error message if it fails. To upload a signature: 1. Select the widget that submits the signature, such as a Button. 2. Open the **Actions** tab and select **+ Add Action**. 3. Select **Upload Signature**. 4. Set **Signature to Upload** to the Signature widget containing the drawing. 5. Optionally, enable **Crop Exported Image** to crop the uploaded image to the area containing the drawing instead of exporting the full Signature widget canvas. If the canvas width or height is unset or infinite, the exported image crops to the minimum size along that axis. The signature is centered in the exported canvas. ![Upload Signature action with the Signature widget selection and Crop Exported Image option outlined in blue.](https://docs.flutterflow.io/assets/images/upload-signature-action-6e9ab945852461781b4450c0dae33ca3.avif) ### 3. Accessing the Signature After the **Upload Signature** action succeeds, access the uploaded image URL from **Widget State > Uploaded Signature URL**. Select this value when setting an Image widget's source or passing the URL to another action. You can also save the URL in a database field so the signature remains available after the page closes. ![Update Page State action with the Uploaded Signature URL field and Widget State option outlined in blue.](https://docs.flutterflow.io/assets/images/uploaded-signature-url-a8dcd48b75c98e6341252f4a6051b476.avif) ## Clearing a Signature The **Clear Signatures** action erases the current drawing from one or more Signature widgets. :::caution This action does not delete an image that has already been uploaded, and it does not clear a URL already stored in your database. ::: To clear a drawing: 1. Select the widget that will clear the pad, such as an IconButton. 2. Open the **Actions** tab and select **+ Add Action**. 3. Select **Clear Signatures**. 4. Under **Signature Fields**, select the Signature widget or widgets to clear. If the signature has already been submitted, separately delete the stored file and clear its database URL. See [**Clearing or Deleting Media**](https://docs.flutterflow.io/concepts/file-handling/clear-delete-media) for the difference between clearing a local value and deleting uploaded media. ## Customizing the Signature Select the Signature widget and use its properties to configure: - **Width** and **Height**: Set the size of the drawing pad. - **Pen Color**: Set the color of the signature stroke. - **Pen Stroke Width**: Set the thickness of the signature stroke. - **Background Color**: Set the background color shown in the Signature widget. - **Export Background Color**: Set the background color of the saved signature PNG. :::note Signature widget colors are set when the widget initializes and do not update afterward. Use a pen color that contrasts clearly with the pad and avoid making the stroke so thin that it becomes difficult to see. ::: ## Best Practices - Explain why the signature is required before asking the user to draw it. - Apply database and storage rules that restrict access to authorized users. - Define how long signatures are retained and provide a deletion process when required. - Pair the signature with relevant consent details, such as the agreement version, user identity, and submission time, when appropriate for your use case. - Provide a clearly labeled way to clear and redraw the signature before submission. - Do not rely on color alone for instructions or error feedback. - Provide an accessible alternative when a user cannot draw a signature with a pointer or touch input. # Slider > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/slider Learn how to add, configure, and read the value of a Slider widget in FlutterFlow Studio. The **Slider** widget lets users select a number within a range by dragging its thumb (the movable handle) along a track. Set **Minimum** and **Maximum** to define the range. For example, use a Slider to adjust audio volume from `0` to `100` or choose a donation amount. A continuous Slider set to 70 out of 100 beside a stepped Slider set to 6 out of 10 in increments of 2. ## Adding a Slider {#adding-slider} 1. Add a **Slider** from **Form Elements** in the Widget Palette or from the Widget Tree. 2. Select the Slider and open **Slider Properties**. Set **Minimum** and **Maximum**, then choose an **Initial Value** within that range. You can set the initial value from a variable; for example, a volume control can start at the user's saved volume level. 3. Add and select a **Text** widget to display the Slider's current value. 4. For its text value, choose **Set from Variable > Widget State > [Slider widget name]**. Select the intended Slider if the page has more than one. Optionally, set the **Number Format Option**, then click **Confirm**. :::note[Displaying vs. saving] The Text widget displays the Slider's current value but does not save it. To keep the value, use an action to read it from **Widget State** and write it to a persisted [**App State variable**](https://docs.flutterflow.io/resources/data-representation/app-state#app-state-properties) or your backend. :::

## Trigger an Action When the Value Changes {#trigger-action-on-change} Use the **On Selected** trigger to run an action when the user changes the Slider value. See [**Form Triggers**](https://docs.flutterflow.io/resources/forms/form-triggers#on-selected) for setup steps. ## Customization Select the Slider in the Widget Tree or on the canvas. Use the **Platform** section for **Platform Type** and **Slider Properties** for the other settings: - **Platform Type:** Choose **Android** or **Adaptive**. Adaptive uses an iOS-style slider on iOS and an Android-style slider on Android. - **Minimum:** Set the lowest selectable value. For a volume control, use `0`. - **Maximum:** Set the highest selectable value. For a volume control, use `100`. - **Step Size:** Limit selection to regular intervals. With a minimum of `0`, a maximum of `10`, and a step size of `2`, users can select `0`, `2`, `4`, `6`, `8`, or `10`. - **Width:** Set the Slider's width. Choose infinity to use the available width, or enter a specific width. - **Active Color:** Set the color of the track between the minimum value and the thumb. - **Inactive Color:** Set the color of the remaining track. - **Show Value:** Display the selected value above the thumb while the user drags it. - **Round Value:** Round the Slider's value. - **Num Decimal Places:** Choose how many decimal places to keep when rounding is on. - **Disable:** Prevent users from moving the Slider. Use the field below this setting to bind its disabled state to a value when needed. # Spacer > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/spacer The Spacer widget fills available space in a Row or Column. Place it before, between, or after other children to control where the empty space appears. The **Spacer** widget fills available space in a **Row** or **Column**. Place it before, between, or after other children to control where the empty space appears. A Spacer filling the available width in a Row and the available height in a Column. To distribute remaining space without a Spacer, set the parent Row or Column's **Main Axis Alignment** to **Space Between**, **Space Around**, or **Space Evenly**. When you add a Spacer, it consumes the remaining space, so these alignment options have no visible effect. Add a Spacer as a child of a Row or Column. Its only setting, **Flex**, accepts a positive whole number and defaults to `1`.
![Two Spacer widgets in a Row, one set to Flex 3 and the other to Flex 1.](https://docs.flutterflow.io/assets/images/spacer-widget-457ac9a558b9e8844c4cb3e46122937a.png)
Two Spacers in a Row
The two Spacers divide the Row's remaining space in a **3:1 ratio**: the Spacer with Flex `3` takes three times as much space as the one with Flex `1`. For a walkthrough, watch the [Spacer video tutorial](https://www.youtube.com/watch?v=7FJgd7QN1zI). # StickyHeader > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/sticky-header The StickyHeader widget keeps a header visible while users scroll through content below it. For example, a search bar can stay in view while users browse a list of results. The **StickyHeader** widget keeps a header visible while users scroll through content below it. For example, a search bar can stay in view while users browse a list of results.

The StickyHeader widget has two sections: - **StickyHeader Header:** Holds the widget that remains visible while the content scrolls, such as a search bar or title. - **StickyHeader Content:** Holds the content below the header, such as a ListView or GridView. :::caution[Scrollable parent] The Column or ListView containing the StickyHeader must handle the main scrolling. Turn on **Primary** for that widget. If you add another ListView or GridView inside **StickyHeader Content**, turn off **Primary** for the inner one. The inner list or grid may still scroll separately. To make an inner ListView scroll with the rest of the page, turn on **Shrink Wrap** and choose a non-scrolling **Scroll Physics** option for it. ::: ## Adding a StickyHeader 1. Add a **Column** or **ListView** to the page. Turn on **Primary** for this Column or ListView so it handles scrolling. If you use a Column, also turn on **Scrollable**. 2. From **Base Elements**, add a **StickyHeader** inside that Column or ListView. 3. Add the widget you want to keep visible inside **StickyHeader Header**. 4. Add the content that users will scroll through inside **StickyHeader Content**. You can use widgets such as a ListView or GridView to display a collection of items. The following demo shows a search bar above a user list:

# SwipeableStack > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/swipeable-stack Learn how to add, control, and customize the SwipeableStack widget in FlutterFlow Studio. The **SwipeableStack** lets users browse a stack of cards by swiping the top card away. You can use it for product choices, photo collections, or profiles.

## Adding a SwipeableStack You can add a fixed set of cards or generate cards from a list of data. To create a fixed set: 1. Add **SwipeableStack** from **Layout Elements** in the [Widget Palette](https://docs.flutterflow.io/flutterflow-ui/widget-palette). 2. Select the SwipeableStack and use **Active Page** in the Properties Panel to choose the card you want to edit. The widget starts with four cards, each shown as a **SwipeableStack Page** in the Widget Tree. 3. Replace the default Image widget on each page with your own card content. For example, add an image and a short description for each product. 4. To add a card, click **+ Add Page** under **Active Page**. To remove one, select its **SwipeableStack Page** in the Widget Tree and press **Delete**.

### Loading Cards From a Backend Query Use a backend query when cards should come from your database. For example, a bookstore can show one card per book without creating a separate page for every item. The four default pages are for a fixed set of cards. For query-backed cards, design one page as the repeated card template. 1. Select the **SwipeableStack** and open **Backend Query** in the Properties Panel. 2. Add a [**collection or table query**](https://docs.flutterflow.io/resources/backend-query/query-collection). 3. Design a **SwipeableStack Page** as the card template. Bind the **Image**, **Text**, and other widgets on that page to fields from the current document or row. FlutterFlow Studio displays a card for each record that the query returns. You only need to design and bind the template card. ## Swipe a Card With Buttons You can let users swipe without dragging a card. For example, use a **Skip** button for a left swipe and a **Save** button for a right swipe. Place the buttons outside the SwipeableStack so they remain visible as cards change. To connect a button: 1. Add a Button to the page, outside the SwipeableStack. 2. Select the Button, open **Actions**, and add an **On Tap** action. 3. In **Define Action**, choose **Swipeable Stack**. Select the **Swipeable Stack to Control**, then choose an option under **Card Swipe Type**. See [Swipeable Stack Action](#swipeable-stack-action) for the available swipe types. 4. To add more swipe buttons, repeat these steps and choose a swipe type for each button. ![The Action Flow Editor with a Swipeable Stack action configured to trigger a left swipe.](https://docs.flutterflow.io/assets/images/swipeable-stack-button-action-c338ad5366830cdfd36eb4fab7bdde67.png) ## Respond to a Swipe Add an action trigger to run a flow when a card is swiped. For example, an **On Right Swipe** flow can save the current product to a favorites list. 1. Select the **SwipeableStack** and open **Actions > Action Flow Editor**. 2. Choose **On Page Swipe** to respond to any direction, or choose **On Left Swipe**, **On Right Swipe**, **On Up Swipe**, or **On Down Swipe** for a specific direction. 3. Add the action you want to run when that trigger fires. ![The SwipeableStack action trigger menu showing On Page Swipe and four directional swipe options.](https://docs.flutterflow.io/assets/images/swipeable-stack-action-triggers-814fa1135731baae6594c3eefa35259e.png) ## Swipeable Stack Action The **Swipeable Stack** action swipes the current card. Set **Card Swipe Type** to one of these options: - **Trigger Left Swipe:** Moves the current card left. - **Trigger Right Swipe:** Moves the current card right. - **Trigger Up Swipe:** Moves the current card up. - **Trigger Down Swipe:** Moves the current card down. ## Customizing the SwipeableStack Select the SwipeableStack and open **SwipeableStack Properties** in the Properties Panel: - **Loop:** Returns to the first card after the last card is swiped. Turn it off if users should reach the end of the stack. - **Allowed Swipe Direction:** Limits swipes to **All**, **Left**, **Right**, **Up**, **Down**, **Horizontal**, or **Vertical**. For example, choose **Horizontal** when cards should move only left or right. - **Card Display Count:** Sets how many cards are visible in the stack at once. - **Next Card Scale:** Sets the size of the card behind the top card. A value below `1` makes it appear smaller. - **Swipe Threshold:** Sets how far a user must drag a card to complete a swipe. The value is between `0` and `1`; a higher value requires a longer drag. - **Max Angle:** Sets how far a card can rotate during a swipe. - **Back Card Offset:** Sets the **Horizontal** and **Vertical** distance between the top card and the cards behind it. - **Card Padding:** Sets the space around each card. Apply the same padding on all sides, or set the top, bottom, left, and right values separately. # Tooltip > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/tooltip Learn how to add text or component tooltips and customize their behavior, position, and appearance in FlutterFlow Studio. The Tooltip widget displays additional information about its child in a small popup. Use it to explain an icon, describe a control, or provide supporting details without adding permanent text to the page. A tooltip can contain a text message or a custom component. :::note Users can hover over the child with a mouse or use the configured tap or long-press interaction on a touch device. Choose an interaction that works with the child's other actions. ::: ![Tooltip showing additional information about a widget](https://docs.flutterflow.io/assets/images/tooltip-5b1d2ec38218cdafa50f67edea29cfd0.png) ## Adding a Tooltip Widget To add a text tooltip to your app: 1. Right-click the widget that needs a tooltip and select **Wrap Widget > Tooltip**. 2. Select **Tooltip** and open the properties panel. 3. Set **Tooltip Type** to **Text**, then enter the message under **Message > Text**. To use a custom layout instead, follow [Using a Component](#using-a-component).
## Customizing Select the Tooltip widget and open the properties panel to customize its content, behavior, position, and appearance. ### Tooltip Content Use a text message for a short explanation or a component for a custom layout. #### Text and Text Styling Set **Tooltip Type** to **Text** and expand **Message** to configure the message and its appearance: - **Text**: Enter the tooltip message, such as `Add Card`. - **Theme Text Style**: Choose a text style from your app's theme. - **Font Family**: Choose the font family for the message. - **Font Weight**: Choose the text weight, such as **400 - Normal**. - **Styling**: Apply italic, underline, or strikethrough formatting. - **Font Size** and **Text Color**: Adjust the text size and color. - **Line Height**: Adjust the spacing between lines of text. - **Letter Spacing**: Adjust the spacing between characters. Use **Text Overflow Replacement** to control how text appears when it doesn't fit in the available space. Leave it as **Unspecified** to use the default overflow behavior. #### Using a Component Use a component to display images, icons, or a custom layout in a tooltip. For example, a shopping app can show a breakdown of customer reviews when users hover over a product rating. Set **Tooltip Type** to **Component** and select the component to display.

#### Passing a Custom Widget Layout When you want to reuse a tooltip component with different widget layouts, use a [Widget Builder parameter](https://docs.flutterflow.io/resources/ui/components/widget-builder). Use this approach to pass a widget layout into the tooltip component. 1. Create a wrapper component and add a parameter of type **Widget Builder**. 2. Place the widget builder in the wrapper's widget tree where the custom content belongs. 3. In the Tooltip widget, set **Tooltip Type** to **Component** and select the wrapper. 4. Supply the content through the wrapper's widget builder parameter.

### Interaction #### Trigger Mode Use **Trigger Mode** to choose whether a tap or a long press opens the tooltip on touch devices. Test the selected interaction with the child widget's other actions. #### Show Tooltip on Focus Enable **Show Tooltip on Focus** to display the tooltip when its child receives keyboard focus. Test it with a child that supports keyboard focus, such as an interactive control. ![Tooltip displayed when its target receives keyboard focus](https://docs.flutterflow.io/assets/images/tooltip-on-focus-453f0549603cce29b11c5d80026cb03a.avif) ### Positioning #### Preferred Direction Set **Preferred Direction** to **Above**, **Below**, **Left**, or **Right** to choose where the tooltip appears relative to its target widget. #### Tail Size The tail is the pointer that connects the tooltip to its target. **Tail Width** sets the width of its base, and **Tail Length** sets how far it extends toward the target. #### Offset Set **Offset** to adjust the gap between the tooltip and its target widget. ![Offset setting controlling the gap between a tooltip and its target](https://docs.flutterflow.io/assets/images/tooltip-offset-47f6819961c5e20b5fa445ec2c8a92d7.png) ### Appearance #### Background Color Set **Background Color** to change the tooltip's background. ![Tooltip with a customized background color](https://docs.flutterflow.io/assets/images/tooltip-bckgrnd-261d7c5f3471b2a857bdac182486ff17.png) #### Border Radius Set **Border Radius** to adjust how rounded the tooltip's corners appear. ![Tooltip with rounded corners](https://docs.flutterflow.io/assets/images/radius-2a4208b0c9e93313f75fc32f37423061.png) #### Elevation Set **Elevation** to adjust the tooltip's shadow and apparent depth. ![Tooltip with an elevation shadow](https://docs.flutterflow.io/assets/images/elevate-tooltip-5d0debf060f2db74d57851f8061f4b6d.png) #### Internal Padding Set **Padding** to adjust the space between the tooltip's content and its edges. Use the mode control to set one value for all sides or configure each side separately. To apply the same padding to every side, use the slider or enter a value. ![Padding around the tooltip content](https://docs.flutterflow.io/assets/images/internal-padding-ef3f97ed1d1ce89d91aa73e095a7ba16.png) #### Shadows Use **Shadows** to configure individual shadows. Click **Add Shadow**, then expand the shadow entry to adjust these properties: - **Color**: Set the shadow color. - **Blur Radius**: Adjust how soft or sharp the shadow appears. - **Offset X**: Shift the shadow horizontally. - **Offset Y**: Shift the shadow vertically. To delete a shadow, click **Remove** on its entry. Use **Add Shadow** again to add another shadow. ### Timing #### Wait Duration Set **Wait Duration (ms)** to adjust the delay before the tooltip appears. For example, `100` means 100 milliseconds. Test the delay with your chosen trigger mode. #### Show Duration Use **Show Duration (ms)** to adjust how long the tooltip remains visible after it is triggered. For example, `1500` means 1.5 seconds. Test dismissal with hover, tap, or long press as appropriate for your app. # Transform > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/transform Learn how to rotate, scale, skew, and move child widgets with the Transform widget in FlutterFlow Studio. The Transform widget rotates, scales, skews, or moves its child widget. Use it to change a widget's appearance or position without changing the surrounding layout. :::note Transform changes how its child is drawn, not the space reserved for it in the layout. A transformed widget can overlap nearby widgets without moving them. ::: ## Adding a Transform Widget To add a Transform widget to your app: 1. Open **+ Add Widget** and drag **Transform** from **Base Elements** onto the Canvas, or add it from the widget tree. 2. Add the widget that you want to transform inside the Transform widget. 3. Select **Transform** and open the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel). 4. Choose a **Transform Type** and configure its properties as described in the following sections.

## Transform Types Choose a transformation from **Transform Type**, then adjust its sliders or numeric fields. For Skew, Scale, and Rotate, the reference point also affects the result. See [Transform Origin and Alignment](#transform-origin-and-alignment). ### Skew Skew slants the child horizontally or vertically: - **Skew X**: Slants the child horizontally. A positive value moves the top side left relative to the bottom side. - **Skew Y**: Slants the child vertically. A positive value moves the left side up relative to the right side. Negative values reverse the direction of the skew. Set both values to `0` to remove the skew. ### Scale Scale makes the child appear larger or smaller. **Scale X** changes its displayed width, and **Scale Y** changes its displayed height. For each axis, `1` keeps the original size, `0.5` halves it, and `2` doubles it. Set both axes to the same value to preserve the child's proportions. ### Rotate Use **Rotate (degree)** to set the rotation angle. Positive values rotate the child clockwise, and negative values rotate it counterclockwise. For example, `90` rotates it a quarter turn clockwise, and `-90` rotates it a quarter turn counterclockwise. A value of `0` leaves the child unrotated. ### Translate Translate moves the child from its original position: - **Translate X**: Positive values move the child right; negative values move it left. - **Translate Y**: Positive values move the child down; negative values move it up. Set both values to `0` to leave the child at its original position. **Translate** doesn't include **Transform Origin and Alignment** settings. ## Transform Origin and Alignment For **Skew**, **Scale**, and **Rotate**, expand **Transform Origin and Alignment** to adjust the reference point around which the transformation happens. It isn't always the center of the widget. Use **Origin Alignment** to select a position in the nine-point grid or enter **X** and **Y** values: - **X**: `-1` represents the left edge, `0` the horizontal center, and `1` the right edge. - **Y**: `-1` represents the top edge, `0` the vertical center, and `1` the bottom edge. Set both **X** and **Y** to `0` to select the center. Set both to `-1` to select the top-left corner. To shift the reference point from the alignment position, use these controls: - **Origin Horizontal Offset**: Use the slider or enter a value to shift the reference point horizontally from the alignment position. Positive values shift it right; negative values shift it left. - **Origin Vertical Offset**: Use the slider or enter a value to shift the reference point vertically from the alignment position. Positive values shift it down; negative values shift it up. Origin offsets are distances in logical pixels, not alignment coordinates. An offset of `0` leaves the reference point at the selected alignment position. For example, rotating around the center turns the child in place, while rotating around a corner keeps that corner fixed. These settings change the transformation's reference point, not the child's alignment within its parent. # Common Widget Properties > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/widget-commonalities Learn how to control common widget properties in FlutterFlow Studio When working with widgets in FlutterFlow Studio, you'll encounter properties and features that are common across multiple widget types. Below is a detailed overview of such properties. ## Visibility Visibility settings in FlutterFlow Studio allow you to dynamically control when and how widgets appear in your app. ### Conditional **Conditional** visibility allows you to control the display of UI elements (widgets) based on specific conditions or criteria. It helps you create dynamic, personalized experiences by showing or hiding certain content. For example, you could display specific features or actions only to users with particular roles, such as showing admin controls exclusively to administrators. :::note The **Show in UI Builder** toggle only affects visibility within the design canvas, giving you a quick preview of how the layout will adjust when this widget is shown or hidden. ::: ![conditional-visibility.avif](https://docs.flutterflow.io/assets/images/conditional-visibility-23ea7b86289e9551c4468ed2b5a872d0.avif) ### Responsive The **Responsive visibility** property allows you to show or hide widgets based on device screen size, such as mobile, tablet, or desktop. By toggling each icon, you can show or hide the widget according to your design needs. For example, you might create two separate navigation menus: - **Desktop Menu**: A wider, left-aligned menu only visible on large screens by enabling the desktop icon and disabling all other screen size icons. - **Mobile Menu**: A compact drawer menu only visible on smaller screens by enabling the phone icon and disabling all other screen size icons. ![responsive-visibility.avif](https://docs.flutterflow.io/assets/images/responsive-visibility-af9fb868f82411dafd2dcf3cf3485c90.avif) ### Opacity The **Opacity** property controls how transparent or visible a widget appears. It accepts a value between 0 and 1, where 0 means fully transparent, 1 is fully opaque, and 0.5 results in semi-transparency. This property enables a wide range of creative UI effects, such as translucent buttons, overlay highlights, or smooth theme transitions. When **Animated Opacity** is enabled, any changes to the opacity value are smoothly animated based on the specified duration and curve, enhancing visual appeal and user experience. ![Opacity.avif](https://docs.flutterflow.io/assets/images/Opacity-ef06ded87e55f159dad15135fdb2aa96.avif) ## Padding **Padding** is the space added inside a widget, between its content and its border (or edge). It ensures the content doesn't touch the borders, creating visual breathing room and contributing to a cleaner, more responsive layout across different screen sizes. To set padding, select the widget, go to the **Padding & Alignment** > **Padding** section in the **Properties Panel**, and enter the values in **pixels (px)**, which represent logical pixels. You can choose from two options: - **Uniform Padding**: Apply the same value to all four sides. - **Independent Padding**: Set different padding values for top, bottom, left, and right.

If you prefer watching a video tutorial, here is the guide for you:

## Alignment **Alignment** determines how a widget is positioned within its parent container. It helps you control where your widget appears—left, right, center, top, bottom, or any point in between. To set alignment, select the widget and go to the **Padding & Alignment** > **Alignment** section in the **Properties Panel**. You'll see a 3×3 grid representing all nine positions: - Top Left - Top Center - Top Right - Center Left - Center (Default) - Center Right - Bottom Left - Bottom Center - Bottom Right Simply click the dot representing where you'd like the widget to be positioned. Alternatively, you can input a specific value (between -1 to 1) for the precise horizontal and vertical alignment. - **X (Horizontal Alignment)** controls the widget’s position along the horizontal axis within its parent. A value of `-1` aligns it to the left, `0` centers it, and `1` aligns it to the right. - **Y (Vertical Alignment)** controls the widget’s position along the vertical axis. A value of `-1` places it at the top, `0` centers it vertically, and `1` places it at the bottom. :::note Values beyond this range will push the widget outside the visible screen area. :::

## Add Testing Value Key A **Value Key** is used to uniquely identify widgets during [**Automated Testing**](https://docs.flutterflow.io/testing/automated-tests) in FlutterFlow Studio. For example, on a Create Account page, you might use descriptive keys like `signupFirstNameField`, `signupEmailField`, `signupPasswordField`, and `signupSubmitButton`. This helps testing tools reliably locate and interact with the correct widgets. For more details, refer to the [complete guide here](https://docs.flutterflow.io/testing/automated-tests). ![test-value-keys.avif](https://docs.flutterflow.io/assets/images/test-value-keys-e38ee305c4a9fb82b6145cb18cd7697c.avif) ## Set Width & Height To adjust a widget's size, click on the widget you wish to resize and navigate to the right-side Properties Panel. There, you can set the size in the following ways: - **PX (Pixels):** Enter a fixed size in pixels for a consistent dimension. - **% (Percentage):** Set the size relative to the screen or parent container. - **∞ (Infinity):** Make the widget expand to fill the available width or height.

You can also drag the handle bars on the right and bottom sides of a selected widget to resize. The measurements appear while resizing to show the current pixel values. ![use-handle-bars-to-resize.avif](https://docs.flutterflow.io/assets/images/use-handle-bars-to-resize-eb13939a7ac53272a5d6fa13aec92187.avif) :::tip[Responsive Width & Height] You can also use a **Responsive Value** to apply different width or height values based on screen size. To set it up, open the **Set from Variable** menu and select **Responsive Value**. Then, assign specific size values for each screen size category, such as mobile (Screen Width < Breakpoint Small), tablet (Screen Width < Breakpoint Medium), and desktop (Screen Width < Breakpoint Large). ::: ## Use Keyboard to Adjust Property Values You can quickly increase or decrease the property value using your keyboard's up and down arrow keys. This allows for precise control without needing to type in new values each time. :::tip Hold down the **Shift** key while pressing the arrow keys to change the value by 10 units at a time. ::: ## Change Color To change the color, navigate to a widget property that allows you to set a color, and then click on the currently selected color. This opens the **Color Picker**, where you have multiple ways to set the desired color: - **Custom Color**: Use the gradient area to select any shade and fine-tune it using: - The **hue slider** (rainbow bar) to adjust the base color. - The **transparency slider** (checkered bar) to control opacity (alpha value). - **Use RGB or HEX**: Manually input a **HEX code** (e.g., `#A489F5`) or set the **RGB values** directly for precise color control. The **Alpha (A)** value defines transparency (e.g., 100% = fully opaque). - **Theme Colors**: Below the picker, you’ll find a list of your app’s predefined **Theme Colors** like Primary, Secondary, and Background. Using theme colors ensures design consistency across your app and makes global updates easier. - **Set from Variable**: You can also dynamically assign a color based on your app logic. For example, changing the background color based on the selected item or theme.

:::tip You can also assign a color using a **String variable** that contains a **CSS-style color value** (e.g., `"#FF5733"`, `"rgba(255, 87, 51, 1)"`, or `"red"`). This is especially useful when colors are stored in a database or returned from an API. Make sure the string format follows valid CSS color syntax, as FlutterFlow Studio uses the [**`from_css_color`**](https://pub.dev/packages/from_css_color) package under the hood to parse these values. This allows you to dynamically theme parts of your app based on user preferences or remote configurations. ![color-from-string.avif](https://docs.flutterflow.io/assets/images/color-from-string-d25dcbcd05a58f64d8dd0bbf5b5add9f.avif) ::: ## Copy Variable If you’ve created a complex variable value (e.g., using Conditional Logic) and want to reuse the same logic elsewhere, you can easily do so by copying the variable. To copy and paste a variable, open the **Set from Variable** menu, click the **three dots**, and select **Copy Variable**. Then go to the target location, open the same menu, click **Paste Variable**, and confirm.

## Bulk Edits Properties You can easily modify the properties of multiple widgets at once. For example, if you want to change the background color of several buttons from blue to green, there's no need to edit each one individually. Simply select all the buttons and update their fill color in one go. To do this, hold down the **Shift** key and click on each widget you want to edit. Once selected, their shared properties will appear in the **Properties Panel**, where you can apply changes.

## Use Images from Unsplash You can easily display high-quality images directly from [Unsplash](https://unsplash.com/) using the Properties Panel. Just click the **search icon**, type in your desired keyword, and select an image from the results. :::tip You can also choose the image size (i.e., Small, Regular, or Full) before adding it, depending on your layout. :::

## UI Builder Display Value For widgets like `Text` and `RichText`, if the content is set from a variable, you can add a placeholder value that appears only in the FlutterFlow Studio builder. This placeholder helps you visualize how the text will look on the canvas, but it won’t appear in the live app, it's replaced by the actual variable at runtime. This is especially helpful for previewing layout, spacing, and alignment without removing or disrupting your variable bindings. ![ui-builder-display-value.avif](https://docs.flutterflow.io/assets/images/ui-builder-display-value-1efc84d1dd78a1725f8ff7e132a509be.avif) ## Adding Border You can add a border to any widget using the following properties: - **Border Color**: Choose a color manually or bind it to a variable. You can select from your theme colors (like `Primary`) or use the color picker. - **Border Width**: Set the thickness of the border in pixels. - **Border Radius**: Adjust how rounded the corners should be using the options below: - **Independent Radius**: Set different radius values for top, bottom, left, and right. - **Uniform Radius**: Apply the same value to all four sides. The slider and numeric input allow you to have precise control. - **Button Padding**: Controls the space inside the widget (between the content and the border). :::tip Use consistent border and padding styles for buttons, cards, and containers to maintain a clean and cohesive UI. :::

# Components > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/components Components in FlutterFlow Studio are reusable widgets. You design a widget once and can reuse it throughout your app Components in FlutterFlow Studio are reusable widgets. You design a widget once and can reuse it throughout your app to save time, ensure consistency, and make it easier to maintain. When you add a component to a [**Page**](https://docs.flutterflow.io/resources/ui/pages), it becomes part of that page's **[Widget Tree](https://docs.flutterflow.io/resources/ui/widgets#widget-tree)**. This allows the component to interact with other widgets, inherit properties, and respond to state changes as part of the page's structure. Components help in several ways: - **Consistency:** Components provide a consistent look and behavior, reducing the likelihood of discrepancies that can occur when the same UI elements are created multiple times. - **Centralized Updates:** By creating a component once and reusing it across different parts of your app, you ensure that any design or functionality changes are made in one place. When that component is updated, all instances of that component across the app automatically reflect those changes. This significantly reduces the effort required to maintain and update the app. :::note[Classes vs. Instances] Learn more about **[Classes and their Instances](https://docs.flutterflow.io/resources/ui/overview)** and what they mean in FlutterFlow Studio. ::: - **Error Reduction:** Since components reduce design duplication, the risk of errors decreases. Fixing an issue in a component means it is fixed everywhere, leading to fewer bugs and inconsistencies. - **Scalability:** As your app grows, maintaining a DRY codebase through components makes it easier to scale. Adding new features or modifying existing ones becomes more straightforward and less prone to introducing errors. :::tip[DRY PRINCIPLE] The **DRY (Don't Repeat Yourself)** principle is a software development concept that emphasizes the importance of reducing repetition within code and design. ::: Leveraging components effectively helps you build a consistent, efficient, and maintainable app. ## Common Use Cases Components can be used in various scenarios to accelerate your app development process. Here are some common use cases: - Design a **standard button once** and reuse it across multiple screens to maintain a cohesive look. - Use components for **card designs** frequently used in your app, such as product cards, user profiles, or news articles. - **Standardize input forms** for tasks like user registration, login, or feedback collection, to ensure a consistent user experience. - Design **pop-up messages or dialogs** that match the overall theme of your app, enhancing visual consistency. - Build interactive elements such as **custom sliders, ratings, or progress bars**, and use them across various parts of your app. - Design sections of a screen that are frequently repeated, such as testimonials, image galleries, or feature highlights, and reuse them to maintain a cohesive layout. Here's an example of commonly used components in the [EcommerceFlow demo](https://bit.ly/ff-docs-demo-v2) app.
![custom-components-demo-list.png](https://docs.flutterflow.io/assets/images/custom-components-demo-list-fd33ff85bc0fec2925c8a7ffba8c15d4.png)
Some of the custom components from the Ecommerce Demo App
# Components > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/components/creating-components Components are reusable widgets you create to meet the specific needs of your app. This approach ensures consistency, saves Components are reusable widgets you create to meet the specific needs of your app. This approach ensures consistency, saves time, and simplifies maintenance across your project. ## Creating a Component from Scratch To create a component from scratch, click the **Add Button** in the **Page Selector** or **Widget Tree** tab. Then choose **Add Component > Create Blank Component**.
## Convert to a Component If you have already built a complex widget in your page, you can convert that entire widget into a component and reuse it throughout your app. To convert a complex widget into a reusable component, right-click on the root widget that contains the entire widget tree you want to convert, then select **Convert to Component.**
## Creating Component from Template FlutterFlow Studio offers multiple popular templates for components across various use cases that you can apply to your project in seconds, saving time.
## Generate with Designer You can quickly create a component with [FlutterFlow Designer](https://designer.flutterflow.io/) by describing what you want in natural language. Designer uses your description along with your project context, to build the component with relevant widgets.
## Import from Figma Frame You can quickly turn your Figma designs into functional FlutterFlow Studio components using **Import from Figma**. Provide a Figma Frame URL, and FlutterFlow AI will analyze the design and generate a UI layout that closely matches your mockup. To get started, first [connect your Figma account](https://docs.flutterflow.io/concepts/design-system#import-figma-theme). Then, when creating a new component, select **Import from Figma** from the available options. Paste the Figma Frame URL and click **Import**. FlutterFlow Studio will display a preview of the selected frame. Review the preview, then click **Generate** to create the component. Once completed, the component will appear in the **AI Generation History**, where you can preview and add it to your project. :::caution Currently, FlutterFlow Studio doesn't support importing SVG elements from Figma frames. However, you can manually add the SVGs directly to your project [**assets**](https://docs.flutterflow.io/generated-code/project-structure#assets) after generation is complete, or replace them in Figma with supported image formats like PNG or JPEG. :::
## Component Properties Panel When you select a component from the widget tree, the Properties panel opens on the right side of the interface. Use it to configure and manage the various aspects of your components. Here’s what you can typically find and modify in this panel: ![components-configurations.png](https://docs.flutterflow.io/assets/images/components-configurations-92b76049a4a278d21dfad82454a6f149.png) ## Component Parameters Component parameters are values that a component receives from its parent entity, such as a page or another component. These parameters allow the component to be dynamic and adaptable based on the context in which it is used. By using parameters, you can customize components for different scenarios without altering the base design or functionality. ### Creating a Component Parameter To create a component parameter, go to the root widget in the component's widget tree.
### Bind the Parameter Once you have created a component parameter, you can link data from the parent entity to your component. Here's a small example of how we can bind the parameters created in `ProfileListItem` to their respective widgets and action triggers.
Aside from standard data types used throughout FlutterFlow Studio, you can also create parameters of the following types: - **Action (callback)**: This allows you to pass actions into the component. The component can then invoke the action, usually referred to as a callback, in its own action flows. Callbacks are often used to handle events, like updating a parent's state when a button has been pressed. [You can learn more about how to use callbacks here.](https://docs.flutterflow.io/resources/ui/components/callbacks) - **Widget Builders**: Widget builders allows you to pass in widgets to be used within the component's widget tree. This is especially useful when you want to dynamically substitute content for part of a component, such as displaying an item in a custom dropdown, or creating a component for some consistent layout. [You can learn more about how to use Widget Builders here.](https://docs.flutterflow.io/resources/ui/components/widget-builder) ### Actions This tab allows you to define and manage interactions or events triggered by user actions. For example, you can configure a button to navigate to another page or execute a callback action from the page using the current component. Adding an action to a component element is exactly the same experience as adding actions to any page element. Here's a quick overview: ![component-actions.png](https://docs.flutterflow.io/assets/images/component-actions-bd0cc8a019bc88f5efc73a08e46b7f6f.png) For component actions, you can establish specific behaviors or functions that are triggered by certain events related to the component's lifecycle, such as **On Initialization**. :::note To learn more about component lifecycle and adding **On Initialization** action to your component [**refer here.**](https://docs.flutterflow.io/resources/ui/components/component-lifecycle) ::: ### State Management Components can have their own internal state variables that track information like form inputs, toggles, or other user interactions. Components can update their state in response to user actions (e.g., clicking a button) or external events (e.g., receiving new data from an API). Effective state management ensures that components dynamically update their UI to reflect changes in state, providing a responsive user experience. :::note Learn how to **[Create a State variable](https://docs.flutterflow.io/resources/ui/components/component-lifecycle#creating-a-component-state)** for your components and how to **[Update them](https://docs.flutterflow.io/resources/ui/components/component-lifecycle#update-component-state-action)**. ::: # Using Components > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/components/using-components Components in FlutterFlow Studio can be added to the widget tree of a page or another component. They help streamline Components in FlutterFlow Studio can be added to the widget tree of a page or another component. They help streamline development by allowing you to reuse design and functionality throughout your app. Components can accept parameters, making them adaptable to specific contexts. Additionally, you can use [callbacks](https://docs.flutterflow.io/resources/ui/components/callbacks) to pass actions from parent entities to child components, enabling dynamic and interactive behavior. You can also use [widget builders](https://docs.flutterflow.io/resources/ui/components/widget-builder) to substitute dynamic content into the component's widget tree. To learn more about creating components, see [Creating a Component](https://docs.flutterflow.io/resources/ui/components/creating-components). ## Add a Component to a Widget Tree To add a component to the widget tree of a page or another component, choose the parent entity where you want to add the new component. Next, you can find the component in the Widget Palette, under the **Components** section.
### Specify Parameter Values In FlutterFlow Studio, each component instance can receive unique values from its parent entity. When you add a component to the widget tree, you can set the parameter values by clicking on the instance of the component and going to the **Properties panel**.
## Setting a Unique Key When you use a component in a dynamically generated list, you can set a unique key. For example, imagine a dynamic list where items change frequently, such as a to-do list where tasks are added and removed. Think of it as giving each task a unique ID number. This is important for a few reasons: - **Tracking Changes:** The **Unique Key** helps the app recognize which tasks are new, completed, or removed, ensuring accurate updates. - **Efficiency:** With unique IDs, the app updates only the tasks that have changed instead of the entire list, improving performance. - **Retaining Details:** When you modify a task and move away from it, the **Unique Key** ensures the changes are remembered and displayed correctly when you return. :::tip If it's a list of documents, the unique key might be the document ID. ::: ![component-unique-id.avif](https://docs.flutterflow.io/assets/images/component-unique-id-03e509dec30fb19e7da5eed06d683939.avif) ## Recursive Components You can create a recursive component, which means the component can include an instance of itself within its own widget tree. This is especially useful for nested content. For example, in social media applications or forums, comments can have replies, and each reply can have further replies. A recursive component can display this nested structure effectively. ![recursive-comp.png](https://docs.flutterflow.io/assets/images/recursive-comp-13c03bf3a4f9d465909348ae5e025ad1.png) # Component Actions & Lifecycle > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/components/component-lifecycle In FlutterFlow Studio, understanding the component lifecycle is crucial for managing state and optimizing your In FlutterFlow Studio, understanding the component lifecycle is crucial for managing state and optimizing your app's performance. Let's delve into the key moments in the lifecycle of a **Component**: - **Creation**: Component instances are created dynamically when they are used within a page or another component. This means that component instances are created as needed, which helps manage resources efficiently and avoid unnecessary overhead. - **Initialization:** Actions defined in the `On Initialization` **Action Trigger** are executed during this phase. For instance, you can initialize local state variables with initial values, or start component animations in this phase. At this stage, component state variables with their default values (if any) are also created. These variables hold data specific to the component, such as form inputs or toggle states, and are essential for managing the component’s internal state. - **Updating:** While in use, the component can receive updated parameters from its parent when the parent rebuilds itself, allowing the component to adjust its behavior and appearance accordingly. When updating state variables inside a component, you can choose to rebuild only the component itself or the entire page containing the given component. This dynamic updating is crucial for maintaining a responsive and interactive user experience. - **Disposal:** When the component is no longer needed, such as when a user navigates away from the page or the component is explicitly removed, it is destroyed. In FlutterFlow Studio, most of these lifecycle stages are handled internally by FlutterFlow Studio's architecture. However, FlutterFlow Studio exposes some lifecycle methods so that you, as a developer, can decide what additional configurations to load upon initialization and when to re-render the UI based on interactions. Let's look at them in the following sections: ## Initialization Action Triggers During the initialization of a **Component**, FlutterFlow Studio exposes the `On Initialization` **Action Trigger** that assists you in loading resources or initializing data when the Component is loaded in a Page or a Component. :::note[What are Action Triggers?] **Action Triggers** serve as event listeners or handlers that respond to specific events or user interactions within an application. FlutterFlow Studio provides developers with a way to define logic that responds to various events, such as button clicks, page loads, form submissions, or data changes. To learn more, see the [**Action Flow Editor**](https://docs.flutterflow.io/resources/functions/action-flow-editor) section. ::: As you open the Action Flow Editor for your Component, you can see the `On Initialization` **Action Trigger** exposed for your **Component**. ### On Initialization [Action Trigger] The `On Initialization` action trigger in FlutterFlow Studio allows you to define actions that should occur when a component loads or is initialized, such as setting up necessary data, state variables, or other initialization tasks. If the component stops being shown in the UI and then becomes visible again, the actions under the **On Initialization** action trigger will run again so any setup tasks are re-executed. For dynamically generated components, such as those in a ListView with a query, each instance will trigger the actions under `On Initialization` action trigger when it is created. ### On Shortcut Press [Action Trigger] Your component can also respond to certain keypress events. For more details on setting this up, see [this section on keyboard shortcuts](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#on-shortcut-press-action-trigger). ### On Dispose [Action Trigger] The **On Dispose** action trigger for components allows you to define actions that execute when the page containing the component is navigated away or removed from memory. It is particularly useful for stopping ongoing operations. Imagine a scenario where a [periodic action](https://docs.flutterflow.io/resources/time-based-logic/periodic-action), such as fetching live weather updates, is started in a component when it is loaded (i.e., [On Initialization](#on-initialization-action-trigger)). The action runs periodically, providing real-time data updates as long as the component is active. However, when the page containing the component is navigated away, you need to stop the periodic action to conserve resources and prevent unnecessary processing. By using the **On Dispose** action trigger, you can safely stop the periodic updates and clean up any associated resources. :::note The **On Dispose** action trigger always runs before the [**parent page’s On Dispose**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#on-dispose-action-trigger). This ensures that the component cleans up its resources first, allowing the parent to finalize its disposal without dependencies on the child. ::: ## Component State :::note[STATE VARIABLES] A state variable holds information or data about your UI at any given moment. To learn more about **states and state management, [refer to this guide.](https://docs.flutterflow.io/concepts/state-management)** ::: **Component state** refers to the information that a component tracks about its current condition or the data it manages internally. This can include data such as whether a button is enabled, the value of a slider, or the entries in a dynamically updated list. Component state variables are only accessible within the current component's scope. This type of variable is particularly useful for storing data that affects how the component behaves or appears, such as toggling UI elements, keeping track of user choices within the component, or caching data pertinent to the component's functionality. For example: - In a custom drop-down menu component, you might use a component state variable to keep track of which item is currently selected. - In a toggle switch component, you could use a component state variable to store the on/off state based on user interaction. This approach ensures that the state of the component is maintained as it interacts with the user or other parts of the application. When a component state variable changes, the component can be re-rendered with the updated values, displaying the latest state of the component with these updates. ### Creating a Component State To create a new **Component State variable** in your component, follow these steps:
When creating Component State, the following properties are included: - **Is List:** This property determines whether the variable can hold multiple values of the same data type (like a list or array) or just a single value. - **Initial Field Value:** This property sets the default value for the variable when it is first created. It's like setting the starting point or the value that the variable begins with before anything else happens. - **Nullable:** This property determines whether the variable can have a null value. When "**Nullable**" is set to true, it means the variable can be empty or have a null value. This is useful when dealing with optional data or scenarios where the absence of a value is valid. Now, apply these concepts to the `isFavourite` variable in the context of the above example: - For the `isFavourite` variable, it is a single value (boolean), so **Is List** would be set to false. - Set the **Initial Field Value** to **false**, indicating that the item is not favorited by default. - Set the **Nullable** property to false, as the variable should always have a boolean value (true or false) and never be null. :::note You can set the **Data Type** of your Component State variable to primitive data types such as **String, Integer, Boolean,** or **Double**, or complex built-in data types such as **Enum, Custom Data Type,** or **Document**. To learn more about the available data types, refer to the [**Data Representation section**](https://docs.flutterflow.io/resources/data-representation). ::: ### Get Component State Value In the following example, we demonstrate how to toggle the heart icon from an outlined to a filled icon based on the `isFavourite` state variable. We introduce a `Conditional Builder` widget that allows us to show a widget tree based on **If/Else If/Else** conditions. The goal is to visually indicate whether a product has been favorited by the user. Follow these steps:
### Update Component State [Action] **Component state** values can only be updated via actions. Whenever you want to update the component state, add an **Update Component State** action from the Action Flow Editor of the component. In the following demo, we open the Action Flow Editor on the parent widget `Conditional Builder` and call the **Update Component State** action to toggle the value of `isFavourite`.
#### Rebuild on Update When updating your component state in FlutterFlow Studio, you'll often come across the **Update Type** property in your action properties. Here's what it means: - **Rebuild Containing Page:** This option triggers a re-rendering of the page containing this component. - **Rebuild Current Component:** This option triggers a re-rendering of the current component only. - **No Rebuild:** Choose this option when you need to update the state value without immediately reflecting the changes in the UI. :::tip If you want to rebuild a component without updating any state variables, use the [**Rebuild**](https://docs.flutterflow.io/concepts/state-management#rebuild-action) state action. ::: :::caution[Expensive Rebuilds] Too many rebuilds can impact performance because rebuilding the widget tree frequently consumes resources and may lead to decreased responsiveness and increased battery usage. Therefore, it's essential to consider the trade-offs and use rebuilds judiciously to maintain optimal app performance. To learn more about what happens behind the scenes, refer to the [**Generated Code: Components**](https://docs.flutterflow.io/generated-code/component-model) section. ::: # Action Parameters (Callbacks) > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/components/callbacks Learn how to add action parameters or callbacks to custom components. In FlutterFlow Studio, callbacks are a way to pass down actions from parent entities (like pages or other components) to child entities (such as custom widgets or components). This allows the parent to define specific behaviors that the child entity should execute when certain events occur. Callbacks enable dynamic and interactive behavior in child components, allowing them to perform actions defined by the parent, such as navigation, data updates, or displaying dialogs. For example, if you have an *image upload component*, the parent can define what should happen after an image is successfully uploaded. Using callbacks, the *image upload component* can execute a parent-defined action, such as: - Resize and compress the image to reduce storage size. - Update the user's database record with the new image URL. - Refresh the UI to display the updated profile picture. This makes the *image upload component* reusable, as it doesn't need to know the specifics of what should happen after upload. Instead, the parent controls the behavior by passing the appropriate actions via a callback. ![action-parameters-callbacks](https://docs.flutterflow.io/assets/images/action-parameters-callbacks-93f5b42a0ea8dc2d5bf5f7ccacd430c6.avif) :::tip[Benefits of Using Callbacks in FlutterFlow Studio] - **Modularity:** Separate the logic of what happens when an event occurs from the child component, making your component more modular and reusable. - **Reusability:** Use the same child component in different contexts with different behaviors, simply by passing different callbacks. ::: ## Adding Callbacks Let’s continue with our previous example (*image upload component*) and see how to add callbacks to it: ### Creating a Callback Parameter To create a component that will execute a callback, you must create a component with a parameter with the **Action** type. You can create an action parameter called `uploadAction`, which represents the action that will be executed after the image is uploaded. When you create an action parameter, you can also specify parameters that will be passed into the action. For this example, the action will likely need to know the uploaded image URL to process it further. So, you can specify an action parameter called `uploadedURL`. Now, the page or component that uses this button can use this parameter in its own action flow. An example of this is shown below.

### Executing a Callback You can execute the action passed into the component by using the **Execute Callback** action within the component's action flows. For example, you can execute the above callback after the image is successfully uploaded and pass the uploaded image URL into the callback.

### Passing an Action to a Component When you add a component to the widget tree of a page or another component, you can define values for its parameters, including action parameters. For instance, when you add an *image upload component*, you can specify the action flows that should run when the callback is triggered. For this example, we simply update the profile picture. :::note You can access the value passed to the callback by navigating to the **Set Variable** menu > **Callback Parameters**. :::

Now that we have an *image upload component* with action parameters set up, it can be reused across different pages or contexts, because it relies on the parent to define the after-upload logic. For example, the same component can be used to upload an image while posting reviews for a product, eliminating the need to create a separate component for this functionality. ![component-action-parameters.avif](https://docs.flutterflow.io/assets/images/component-action-parameters-4af70e2016eac391b7ad452ec33669b5.avif) ## More Examples Let's look at a few more examples of action parameters (callbacks) in real-world scenarios. ### Example 1: Dynamic Dialog Component Let’s take another example of a reusable dialog component that uses callbacks to handle context-specific actions like confirming a deletion, logging out, or saving data. In one context, "Yes" deletes an item. In another, it logs out a user. The specific logic for each action is defined by the parent component or page using the dialog. The dialog itself does not need to know what should happen—it simply executes the callback passed to it when users click the "Yes" button. ![dialog-component-action-parameters.avif](https://docs.flutterflow.io/assets/images/dialog-component-action-parameters-c5a8e657eb4d1524754afd2dcad0d02a.avif) ### Example 2: Custom Navigation Bar in Super App Using action parameters to build a custom navigation bar in a super app is an excellent way to create a dynamic, reusable, and modular navigation solution. A **super app** typically hosts multiple mini-apps or features, each requiring specific navigation logic. Action parameters allow you to define navigation behavior dynamically, depending on the active context, making it perfect for this scenario. Here, the navigation bar doesn’t require hardcoded routes. Instead, the navigation logic can be customized for each mini-app, allowing the navigation bar to remain focused solely on its UI role. For example, in an **ecommerce mini-app**, the home button navigates to the product listing page, while the main (middle) button opens the shopping cart. In contrast, in a **cab booking mini-app**, the home button navigates to the dashboard, and the main (middle) button opens the quick booking page. ![navigation-bar-action-parameters.avif](https://docs.flutterflow.io/assets/images/navigation-bar-action-parameters-3e8f6b8fa1a943ec9121ba2126f91386.avif) # Child Widget > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/components/child-widget Learn how to use Child Widget to add flexible, customizable content inside components. Child Widget allows you to create reusable components while keeping part of the layout flexible. Instead of building multiple variations of the same component, you define a fixed structure and leave a specific area open for customization. - Its position is fixed within the component layout. - It accepts any widget, such as text, buttons, images, custom widgets, and components. - Each component instance can contain different content. - The overall structure of the component remains consistent This allows you to reuse the same component while adapting its content as needed. ![child-widgets.avif](https://docs.flutterflow.io/assets/images/child-widgets-9dc2d6e4e3b18a124a96dad258399b38.avif) :::note[Common use cases] - Dashboard cards with different content (charts, stats, lists) - Settings rows with different controls (toggle, dropdown, button) - Empty state sections with different actions - Feature or onboarding cards with varying content ::: ## Using Child Widget Let’s see how to use the Child Widget by building a simple example of displaying different controls in a settings row. 1. In your Component, add a new parameter and give it a clear name (e.g., `childWidget`). 2. Set the parameter **Type** to **Child Widget**. 3. In the component layout, add a **Child Widget placeholder** where you want dynamic content to appear. 4. Go to the component instance (the place where you add this component), locate the Child Widget area, and add any widget to it.

### Child Widget vs Widget Builder Parameter Both options let you insert custom UI into a component, but they are designed for different workflows. One focuses on visual flexibility, while the other focuses on structured and scalable component design. **Child Widget**: A Child Widget allows you to drag and drop any widget directly into a component instance. It does not require setup from the component creator and is handled entirely in the visual editor. Each instance can have different content, making it ideal for quick, flexible customization. [**Widget Builder Parameter**](https://docs.flutterflow.io/resources/ui/components/widget-builder): A Widget Builder Parameter is defined by the component creator and lets you pass UI into a component as a parameter. It works like a function input, providing a more structured and controlled way to customize components, especially for reusable and scalable designs. ### Best Practices - Place the Child Widget in a predictable area of the layout, such as a trailing section, content block, or action area. Avoid placing it in positions that affect the overall structure (e.g., between tightly coupled layout elements). - Keep the role of the Child Widget clear. It should represent a specific purpose, such as "action area" or "content area", not a random insertion point. - Avoid adding too many Child Widget placeholders in a single component, as it can make the component harder to understand and use. - Test the component with different widget types (small, large, interactive) to ensure the layout remains stable across variations. ### Limitations - The Child Widget position is fixed inside the component. You cannot move or reposition it differently for each instance. - It does not enforce any structure on what is inserted, so inconsistent widgets across instances can lead to inconsistent UI if not carefully designed. - It is not ideal for highly dynamic, repeated layouts such as product lists or grids, where content is driven entirely by data. - It relies on manual placement per instance, which can be less efficient for larger or system-driven designs. # Widget Builder Parameters > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/components/widget-builder Sometimes, you want to create a component that offers some consistent design, while also allowing for customization. This is where passing widget builders as parameters becomes valuable. Sometimes, you want to create a component that offers some consistent design, while also allowing for customization. This is where passing widget builders as parameters becomes valuable. Widget builder parameters allow component authors to substitute dynamic content within the widget tree of the component. This means that when someone uses the component, they can dynamically pass in pieces of UI to be used within the component. For example, consider a custom dropdown component. While the overall structure of the dropdown remains the same, you might need to change the style or content of the dropdown items based on different use cases. By passing the dropdown item widget as a parameter, you can reuse the dropdown's appearance and behavior without creating new components for each variation. :::tip[Possible use cases] - **Custom Cards**: Imagine you need to display product cards in an e-commerce app. You can build a reusable card component with parameters for the image, header, content, and call-to-action button. This card can be reused across multiple pages but with different content. - **Dynamic Forms**: Build a form component where different fields (TextFields, Dropdowns, or Checkboxes) are passed in as parameters. This allows you to reuse the same form structure but adapt to various input fields. - **Modular Layouts**: Create a consistent layout structure with areas like headers and footers that remain the same while passing in different body content as parameters to adapt to different pages. ::: Let’s see an example from an ecommerce app. On the shipping address page, you may want to maintain a consistent design for the various input fields (where the user can specify their name, email, etc.). However, you may want to allow customization for different inputs - for example, you want to use a `TextField` to allow the user to type their name, and a `DropDown` to allow the user to select their country. ![widget-builder-as-parameter-example.avif](https://docs.flutterflow.io/assets/images/widget-builder-as-parameter-example-1bf822ec372b4fbb9f3305d6c7d0932d.avif) ## Creating Widget Builders as Parameters To create a component with a widget builder as a parameter, use the steps outlined below. ### Create a Parameter of Type Widget Builder Create a new component and add the base widgets that will be unchanged. Next, define a parameter and set its type to **Widget Builder**. To pass data from the current component to the widget builder, you can specify a parameter for the widget builder.

### Add the Widget Builder to the Widget Tree Add the widget builder placeholder to the desired spot in the component’s widget tree where the dynamic element should appear. Widget builders appear in the **Components** section of the **Widget Palette** when adding a widget to the widget tree.

### Pass Parameters to the Widget Builder Sometimes, you need to pass data from the component to the widget builder. For example, on the shipping address page, you might want the hint text in an input field to change depending on some configuration. In this case, you can pass the hint as a parameter into the widget builder. Here’s how you do it:

#### Preview the Widget Builder Using Different Components You can select different components to use as a preview while building the component that has a widget builder parameter. To select a component to use in the preview, select the Widget Builder, then go to the **Widget Builder UI Properties** section of the **Properties panel**. ![preview-component.png](https://docs.flutterflow.io/assets/images/preview-component-7f90a152b97333c3d433330463decaa5.png) ## Using Components with Widget Builders as Parameters When you use a component that has a widget builder parameter, you can pass [components](https://docs.flutterflow.io/resources/ui/components) to customize the content according to your needs. In this example, we create two additional components for `TextField` and `Dropdown` — and pass them as widget builders.

# Overview > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/data-representation Explore the essentials of data representation in app development, focusing on the use of variables in FlutterFlow Studio. Data representation is a fundamental concept in app development. It refers to the methods and structures used to store and manipulate the data. The way data is structured can greatly influence how efficiently an app performs tasks. ## Variable In FlutterFlow Studio, variables are key to managing dynamic data, ensuring your app remains interactive and responsive. They enable you to capture user inputs, track changes, and share data across different parts of your app. :::note Dig deeper into **[variables and variable scopes](https://docs.flutterflow.io/resources/data-representation/variables)**. ::: ## Data types Data types are used to define the kind of data that variables can store and manipulate within your app. Managing data types correctly is crucial for ensuring that your app functions as intended, particularly when handling user inputs, storing data, and interacting with databases. :::note Learn more about primitive and composite data types in this [**detailed guide**](https://docs.flutterflow.io/resources/data-representation/data-types) and then create your own **[custom data type](https://docs.flutterflow.io/resources/data-representation/custom-data-types)**. ::: ## Data mutability All variables in FlutterFlow Studio are mutable. This means you can change their values at runtime based on user interactions or other events in your app. FlutterFlow Studio also supports immutable data, such as [**Constants**](https://docs.flutterflow.io/resources/data-representation/constants) that cannot be changed once they have been set. ## Global Properties Global properties in FlutterFlow Studio are built-in variables that you can use across your app, but they cannot be created or modified by users. Learn how to leverage these [**predefined properties**](https://docs.flutterflow.io/resources/data-representation/global-properties) to simplify common tasks. ## Encapsulation Encapsulation is a key concept in object-oriented programming (OOP). It bundles the data (fields) and the methods (functions) to manipulate the data. It also limits direct access to some data to prevent accidental changes. This concept is essential in improving security and functionality by managing data access and modification. ### How Encapsulation is achieved in FlutterFlow Studio FlutterFlow Studio supports the principles of encapsulation through its visual development environment. Let’s understand this with some examples: 1. **Custom Widgets and Components**: In FlutterFlow Studio, you can create custom widgets or use built-in widgets that encapsulate specific functionalities. These widgets can include both logic and UI elements that are bundled together. For example, if you are creating a user profile page, you can create a custom component that includes the user's photo, name, and contact button. This component can be reused wherever a user profile needs to be displayed in the app, ensuring that changes to the profile layout or functionality are centralized within this widget. 2. **Backend Actions**: FlutterFlow Studio allows you to define backend actions that can be called from different parts of your app. These actions can encapsulate complex logic, such as processing user input, interacting with databases, or calling external APIs. By defining such actions, you can manage how data is processed and passed around in your applications. This helps in maintaining a clear separation between the UI and business logic, which is a core principle of encapsulation. ### Benefits of Encapsulation in FlutterFlow Studio - **Reusability**: Encapsulated components are reusable across different parts of the application without requiring duplication of widgets. - **Maintainability**: Changes to the application’s data handling or business logic can be made in a single place using action blocks rather than having to make widespread modifications across many actions. - **Scalability**: Applications can grow more naturally and with less complexity when their components are well-encapsulated. # Variable > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/data-representation/variables Variables Variables in FlutterFlow Studio let you store and manage dynamic data, which is essential for creating interactive and responsive applications. By using variables, you can capture user inputs, track states, and manipulate data across different parts of your app. ![variable](https://docs.flutterflow.io/assets/images/variable-c8dba55586bec76e5d8d02e8a5769538.avif) In this section, we'll dive into the different types of variables available in FlutterFlow Studio, including: - **Local Variables:** Variables that are confined to a specific widget or page, used for handling data within a localized context. For example, Page State variables or Component State variables are scoped to the entity they were created in. - **Global Variables:** Variables that can be accessed and modified throughout the entire app, allowing for consistent data management across pages. For example, App State variables can be accessed from anywhere in the app. :::note[What are scopes?] The scope of a variable is determined by where it is created. For instance, if it's created at the app level, it can be accessed throughout the app. However, a variable created at the page level can only be accessed on that page. ::: ## Creating Variables When creating variables in FlutterFlow Studio, there are a few important considerations regarding their name, data type, nullability, and initial values. The specific _process_ for creating variables differs depending on whether you are working with App State, Page State, or Component State variables, and you can find detailed instructions linked below. ### Naming Variable Start by giving your variable a meaningful and descriptive name that reflects its purpose. This name will be used throughout your app to reference the variable, so it's important to keep it clear and consistent with your naming conventions. :::tip[Recommended naming convention] We recommend the `lowerCamelCase` naming convention for variables. Learn more about the **[recommended naming conventions](https://docs.flutterflow.io/resources/style-guide)** used in FlutterFlow Studio and Flutter projects. ::: ### Assigning a Data Type to a Variable Next, you need to select the appropriate data type for your variable. FlutterFlow Studio offers several data types, such as **Text, Integer, Boolean,** or **String**. Refer to the **[Data Types guide](https://docs.flutterflow.io/resources/data-representation/data-types)** to learn more about the available data types. Choosing the correct data type is crucial, as it determines how the variable can be used and what kind of data it can store. ### Is List Property Enable the **Is List** toggle to indicate that this field should be of the **list** type. :::note[Example] If the data type selected is `String` and the `Is List` toggle is enabled, FlutterFlow Studio will create a **list of String variables**. This list can hold multiple string values, such as a list of city names. ::: ### Nullable & Initial Value When creating variables in FlutterFlow Studio, you have the option to make them **nullable** or **non-nullable**. This setting is crucial because it determines whether the variable can hold a null value (i.e., no value). Alongside this, you can also define an initial value for your variable, which ensures that it starts with a specific value as soon as it’s created. ![variables-null-initial-value.png](https://docs.flutterflow.io/assets/images/variables-null-initial-value-3b9551914e84a3be7ba26a84e5f0a070.png) - **Nullable:** This option determines if a variable can hold a null value, meaning it can exist without any data. If the Nullable option is enabled, the variable can start as null and only receive a value when needed. If disabled, the variable must always have a value, which means you’ll need to provide an initial value when it’s created. - **Initial Value:** If a variable is non-nullable (i.e., cannot be null), you are required to provide an initial value to ensure it always contains data. For nullable variables, setting an initial value is optional, allowing them to remain empty until a value is assigned. :::tip[What is a null value?] A null value represents the **absence of a value**. In FlutterFlow Studio, allowing a variable to be null can be beneficial in scenarios such as: - **User Input:** Before a user enters data, a variable can start as null and only hold a value once the user provides input. - **Conditional Logic:** In cases where certain data might not always be applicable (e.g., an optional user setting), a null value allows you to handle the absence of data more flexibly. - **Loading States:** When fetching data from an API, variables can be null until the data is loaded, allowing you to differentiate between "loading" and "loaded" states easily. ::: ### How to create variables? For step-by-step guides on how to create App State, Page State, and Component State variables, please refer to the following links: - [Creating App State Variables](https://docs.flutterflow.io/resources/data-representation/app-state) - [Creating Page State Variables](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#page-state) - [Creating Component State Variables](https://docs.flutterflow.io/resources/ui/components/component-lifecycle#component-state) ## Set Variable The **Set from Variable** or **Set Variable** menu in FlutterFlow Studio is a powerful feature that allows you to dynamically control the content or behavior of your widgets using **data** stored in variables. When you select a variable from this menu, you're instructing FlutterFlow Studio to use the value of that variable to populate or modify the widget's properties, such as text, visibility, or styling. This menu provides a variety of variable **sources**, including data that's specific to the page or component, global properties that apply across the entire app, constants, and more. By choosing the appropriate variable, you can make your app more interactive and responsive to user input, data changes, or other conditions. ![set-variable-menu3.png](https://docs.flutterflow.io/assets/images/set-variable-menu3-36c77114a93aedc24f17013a0a1293e7.png) ## Manipulating Variables When setting variables via the **Set Variable** menu, you have the ability to manipulate or transform the data before applying it to a widget or another variable. This manipulation allows you to tailor the data to fit specific needs or contexts, enhancing the flexibility and functionality of your app. For instance, you can: - **[Concatenate or Combine Strings:](https://docs.flutterflow.io/resources/functions/utility#combine-text)** Combine multiple text values into a single string. To learn how to manipulate strings before setting variables, see the [Utility Functions](https://docs.flutterflow.io/resources/functions/utility#combine-text) guide. - **[Filter or Sort Lists](#list-options):** Organize or refine data in lists to display only what’s relevant or in a specific order. - [**Convert DateTime to UNIX:**](https://docs.flutterflow.io/resources/data-representation/global-properties#current-time) Change a DateTime object into a UNIX timestamp for compatibility or calculation purposes. - [**Apply Conditional Logic:**](https://docs.flutterflow.io/resources/functions/conditional-logic) Use If/Then/Else statements to set different values based on specific conditions. These manipulations enable you to create more dynamic and responsive user interfaces by ensuring that the data presented or used in your app is always in the most appropriate form. ### List Options Use list options to extract values, filter or sort items, remove duplicates, and check a list's contents. #### Map List Items **Map List Items** creates a list by extracting a field from each item in a list of documents, [custom data type records](https://docs.flutterflow.io/resources/data-representation/custom-data-types), or JSON objects. For example, extract the `name` field from cat records that contain `name`, `age`, and `breed` fields, and display the names in a dropdown. ![Map List Items extracts the name field from each record to populate a dropdown with Luna, Milo, and Bella.](https://docs.flutterflow.io/assets/images/map-list-items-4dbd669211d94839df959bc926547a14.png) #### Filter List Items **Filter List Items** creates a list containing only the items that match a condition. For example, use `age > 18` to include only users older than 18. ![Filter List Items keeps Noah and Mia because their ages are greater than 18.](https://docs.flutterflow.io/assets/images/filter-list-items-f9c383700822f31e12d5b64e7074fd3a.png) #### First Few Items **First Few Items** returns the items at the start of a list, up to the count that you specify. For example, a count of `3` returns the first three items. ![First Few Items extracts Luna, Milo, and Bella from a list of five names when the count is 3.](https://docs.flutterflow.io/assets/images/first-few-items-59dc8a1c7152945f893b65c4baa17c43.png) #### Sort List Items **Sort List Items** orders items by a sort key. For a list of simple values, such as numbers or strings, use each item's value as the **Sort Key**. Numbers sort numerically, and strings sort alphabetically. For example, sort a list of names alphabetically: ![Sort List Items arranges the names alphabetically as Bella, Luna, and Milo.](https://docs.flutterflow.io/assets/images/sort-list-items-4dd448c54ae0c800fafc0c1ce22c0db9.png) :::note[Reversing the display order] The ListView's [Reverse property](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#advanced-functionalities) changes the direction in which items appear. It does not sort or change the underlying list. ::: For a list of [custom data type records](https://docs.flutterflow.io/resources/data-representation/custom-data-types), use a field with sortable values, such as a number or string, as the **Sort Key**. For example, use the `price` field to sort `Product` records from the lowest price to the highest. ![Sort List Items uses the price field to order product records from the lowest price to the highest.](https://docs.flutterflow.io/assets/images/sort-records-by-price-c3b74cf974ef730ef9261063d8278625.png) #### Unique List Items **Unique List Items** removes duplicate values from a list. For example, remove repeated cat breeds so that each breed appears only once: ![Unique List Items removes duplicate cat breeds, leaving Siamese, Persian, and Bengal.](https://docs.flutterflow.io/assets/images/unique-list-items-71271e0d7cc7faaf39dadc74d229ceb4.png) To extract unique field values from custom data types, first use **Map List Items** to extract the field, and then apply **Unique List Items**. For example, map `Product` records to their `name` values, and then remove duplicate names. ![Map List Items extracts product names, then Unique List Items removes duplicate names to return Jacket and Hat.](https://docs.flutterflow.io/assets/images/map-unique-list-items-b2ee3702b84ccff197f7a1ce6c7d2a57.png) #### Number of Items **Number of Items** returns the total number of items in a list. ![Number of Items returns 3 for a list containing Luna, Milo, and Bella.](https://docs.flutterflow.io/assets/images/number-of-items-7faf40a52efcdbb08328e5989b36c5b5.png) #### Item at Index **Item at Index** returns an item at a specific position in a list. Indexes start at `0`. For example, index `2` selects the third item, Bella, in the following illustration. ![Item at Index returns Bella at index 2, with list indexes starting at 0.](https://docs.flutterflow.io/assets/images/item-at-index-77d71209b759ad76c8425e2b7d590e06.png) #### Is Set and Not Empty **Is Set and Not Empty** returns `true` only when a list is set and contains at least one item. It returns `false` when the list is empty or not set. For example, use this option to check whether a search query returned any results. ![Is Set and Not Empty returns true for a populated list and false for an empty list or a value that is not set.](https://docs.flutterflow.io/assets/images/is-set-and-not-empty-38e881f2517db684681bb3a9bd92d2ec.png) ## Updating Variable Values In FlutterFlow Studio, you can update the values of variables through **[actions](https://docs.flutterflow.io/resources/functions/action-flow-editor)**. For example, when a button is clicked or when a form field is modified, you can trigger an action that updates a variable with a new value. Refer to the following guides for detailed instructions on updating and using these variables: - [App State Variables](https://docs.flutterflow.io/resources/data-representation/app-state#update-app-state-action) - [Page State Variables](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#update-page-state-action) - [Component State Variables](https://docs.flutterflow.io/resources/ui/components/component-lifecycle#update-component-state-action) # Data Types > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/data-representation/data-types Dive into the diverse range of data types supported by FlutterFlow Studio, from basic primitives like integers and strings to complex composite types and built-in functionalities tailored for app development. FlutterFlow Studio supports a variety of data types to accommodate different needs in your app. These data types range from the basic, such as integers and strings, to more complex types like lists, maps, and built-in data types. ## Primitive Data Types Primitive data types are the most basic data types. They include **integers**, **doubles**, **booleans**, and **strings**. These are the building blocks and are essential in any kind of app development. ## Composite Data Types Composite data types are made up of primitive data types. They can hold multiple values and can be used to structure and organize data in a more meaningful way. Examples of composite data types include **lists** and **custom data types**. ### Custom Data Types You can also create your own custom data types. This can be especially useful when you need a specific structure for your data that doesn't fit into the predefined types. For example, you might create a custom data type for a user profile, which includes several pieces of data like a name, an email address, and a profile picture. :::note Learn more about creating and using [**Custom Data Types**](https://docs.flutterflow.io/resources/data-representation/custom-data-types). ::: ## Built-in Data Types FlutterFlow Studio's built-in data types are essential for effectively managing and organizing diverse information. They ensure data consistency and easy data retrieval. They handle functionalities from storing simple color values and media URLs to complex geographical data. For instance, the **GooglePlace** data type manages location data like coordinates, place name, and address, while the **Uploaded File** type handles uploaded file data, including file name, binary data, and image dimensions. This standardization is crucial as it allows you to focus on higher-level application logic without worrying about the underlying data handling specifics. Below is a list of all supported built-in data types: - **Color**: Stores color values. - **Image Path**: Stores the URL of uploaded images. - **Video Path**: Stores the URL of uploaded videos. - **Audio Path**: Stores the URL of uploaded audio files. - **Document Reference**: Stores references to documents, simplifying data fetching. - **Document**: Stores actual Firestore documents. - **Date Time**: Stores date and time values. - **Json**: Stores JSON values, such as `{"firstName":"John", "lastName":"Doe"}`. - **LatLng**: Stores the latitude and longitude of specific locations, aiding Google Maps integration. - **TimestampRange**: Stores start and end date-time values. - **GooglePlace**: Stores GooglePlace data. - **Data Type**: Stores custom data types. - **Supabase Row**: Stores actual row data from a Supabase table. - **Uploaded File (Bytes)**: Stores uploaded files in Bytes. ## Enums Enums, or enumerated types, are a special kind of data type that consists of a set of related values. They can be used to create a type-safe way of dealing with a specific set of values. For instance, you may have an enum for user roles, such as 'admin', 'user', and 'guest'. :::note Learn more about creating and using enums [**here**](https://docs.flutterflow.io/resources/data-representation/enums). ::: # Custom Data Types > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/data-representation/custom-data-types Learn how to create and utilize custom data types in FlutterFlow Studio to handle complex data structures that predefined types can't cover. In FlutterFlow Studio, custom data types allow you to define structured data models that enhance data management and consistency across applications. These data types serve as blueprints for organizing related data attributes. For instance, you can define a custom data type "Book" that combines predefined data types, such as a string for the title, an integer for the year of publication, and a list of strings for the authors. Custom data types have several key advantages: - **Reusable**: Define once, use everywhere. - **Easy to Update**: Change data structure in one place, and see it reflected throughout your app. - **Consistent**: Keeps data format uniform across the application. - **Efficient**: Simplifies complex data handling, reducing errors and redundant code. :::note - Use custom data type when predefined data types, such as _integer_ and _string_ may not be enough to store certain kinds of information. - FlutterFlow Studio also supports some [**Built-in Data Types**](https://docs.flutterflow.io/resources/data-representation/data-types#built-in-data-types). ::: ![custom-data-types.avif](https://docs.flutterflow.io/assets/images/custom-data-types-3b137f5c280f5408c0e9683670a4059d.avif) When you create a custom data type, it internally creates a Struct. A struct, or structure, is a composite data type that lets you combine fields of different data types to construct a data structure to suit your specific needs. :::note The class name for such data types is generated by appending "Struct" to the name of the data type. For example, if you create a custom data type called "Cart", the corresponding class would be named "CartStruct". ::: ## Creating Custom Data Type To create a custom data type, specify its name and the corresponding fields. Each field can have a distinct data type. You can also specify if a field should allow multiple entries using the **Is List** toggle.
:::tip[Naming Convention] When naming custom data types, always use **UpperCamelCase**, as recommended by the Dart Style Guide. To learn more, refer to the guide on **[Naming Variables & Functions](https://docs.flutterflow.io/resources/style-guide)**. ::: ## Organizing Data Types and Enums in Folders The **Data Schema** panel lists your custom data types on the **Data Types** tab and your [Enums](https://docs.flutterflow.io/resources/data-representation/enums) on the **Enums** tab. Both tabs support folders, so you can group related items. To add items and folders, click the **+** button at the top of the panel. The menu offers the following actions: - **Add Data Type** (or **Add Enum** on the **Enums** tab). - **Create Data Type from JSON** (on the **Data Types** tab only). - **Add Folder**. Enter a name in the **Folder Name** dialog, and then click **Create Folder**. Folder names can contain letters, numbers, underscores, and spaces. A folder name must be unique within its parent folder.
To open the menu for an item or folder, hover over its row and click the three-dot menu button, or right-click the row. You can also navigate menus with the keyboard: - Use the arrow keys to move between menu options. - Press **Right Arrow** or **Enter** to open a submenu. - Press **Left Arrow** or **Esc** to close a submenu. - Press **Enter** or **Space** to select an option. For a data type or an enum, the menu can include these actions: - **Move to Folder**: Opens a submenu that lists your folders, nested to show the folder hierarchy. This action appears when there's a folder the item can move to. - **Move to New Folder**: Prompts for a folder name, creates the folder, and moves the item into it. - **Move Out of Folder**: Returns the item to the top level. This action appears when the item is in a folder. For a folder, the menu can include the following actions: - **Add Data Type** (or **Add Enum**). - **Create Data Type from JSON**. - **New Subfolder**. - **Rename Folder**. - **Delete Folder**. Items you create from a folder menu are placed in that folder. To rename a folder, you can also double-click it. When you delete a folder, its contents move to the parent folder. :::tip Drag an item or folder onto another folder to move it there. To move it to the top level, drag it onto empty space in the panel. ::: To find an item, enter text in the search field at the top of the panel. Search ignores case and spaces and keeps matching results within their folder structure: - Matching items remain in their folders. - Folders with no matching items are hidden. - If a folder name matches, the folder shows all of its contents. - Folders expand while you search. :::note Folders on the **Enums** tab affect only how enums are organized in the panel. Enums remain in a single file in the generated code. ::: ## Accessing Custom Data Type After creating a custom data type, it’s treated internally as a [Dart class](https://dart.dev/language/classes). However, just defining the custom data type doesn’t hold any real data. To work with actual data, such as storing a user profile or a review, you need to create an **instance** of custom data type. Creating an instance allows you to: - Assign specific values to each field in your custom data type. - Store the instance in app state, page state, or pass it between widgets. - Access individual fields wherever needed. To create an instance of a custom data type, first you need to [create a state variable](https://docs.flutterflow.io/concepts/state-management#creating-state-variables) (of type **Data Type**) that will hold the instance. Then, to create and add the instance to the state variable, open the **Set from Variable** dialog and select **Create Data Type Object > Project Data Type**. Choose the data type you want to use. After that, set values for each of the required fields.

### Custom Data Type in Custom Code Sometimes, you might want to access the custom data type in your custom code. Our custom code editor allows you to receive and pass data into a variable of a custom data type. For example, you could manipulate or analyze the data as needed, and then return the modified result in the custom data type. ![custom-data-in-custom-code.avif](https://docs.flutterflow.io/assets/images/custom-data-in-custom-code-f280a8eb9e12f1f2736693bf81d4e2f9.avif) ## Use case: mapping JSON responses from API calls Consider a case where you're calling an API that returns product details. You could create a custom data type 'Product' representing the JSON structure and then map the JSON values to the custom data type field. So, if the JSON response looks like this: ```json { "id": "a1b2c3d4e5f678901234567", "name": "Jacket", "price": 199.99, "reviews": [ { "id": "rev101", "username": "mike", "rating": 4, "comment": "This product exceeded my expectations in every way. Highly recommended!", }, { "id": "rev102", "username": "kera", "rating": 2, "comment": "Great quality, but the color was not as shown in the picture.", } ], } ``` Here’s how you map into a custom data type: ![mapping-json-to-custom-data-type.avif](https://docs.flutterflow.io/assets/images/mapping-json-to-custom-data-type-3ea9203a0888b0f13cdb3fb1eca985c7.avif) # Enums > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/data-representation/enums Learn how Enums can enhance the management of application states, product types, and process statuses by providing a robust method to handle predefined sets of values. In FlutterFlow Studio, Enums (enumerations) provide a method for defining a set of named constants. They are typically used to represent a group of related values in a more readable and safe manner. They prevent invalid values from being assigned. For example, if you have an enum for days of the week, you can't mistakenly assign a non-existent day. In contrast, with strings or numbers, you might accidentally use an invalid or misspelled value like "Sundey" or "Sinday". ![enums](https://docs.flutterflow.io/assets/images/enums-fi-828b0b73ef99ab7ea726edd7172c6ca4.avif) Here are some real-world examples where using Enums is beneficial: 1. **Application States**: A media player might use enums to keep track of playback states (e.g., playing, paused, stopped). 2. **Product Types, Sizes, or Categories**: A clothing store app might use enums to categorize clothing sizes (small, medium, large). 3. **Order or Process Status**: For tracking the status of orders, processes, or tasks (pending, inProgress, completed, canceled). ## Create and use Enums 1. You can create Enums from the left side navigation menu and add values to it.
:::tip To keep a long list of Enums organized, group them in folders on the **Enums** tab of the **Data Schema** panel. To learn more, see [Organizing Data Types and Enums in Folders](https://docs.flutterflow.io/resources/data-representation/custom-data-types#organizing-data-types-and-enums-in-folders). ::: 2. Access the Enum values by navigating to the **Set from Variable** menu, then selecting **Enums > [your enum name] > Values**. ![enums.avif](https://docs.flutterflow.io/assets/images/enums-6f100f8b0496e611ff233cae9317751d.avif) :::tip[Naming Convention] When naming enums, always use **UpperCamelCase**, and for enum values, use **lowerCamelCase**, as recommended by the Dart Style Guide. To learn more, refer to the guide on **[Naming Variables & Functions](https://docs.flutterflow.io/resources/style-guide)**. ::: # App State > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/data-representation/app-state Learn how to effectively utilize App State Variables in FlutterFlow Studio to maintain and manage global application states across all pages and components. App state variables are specific variables that hold the current state of an application. They can be accessed and modified throughout the entire application across all pages and components. This type of variable can be useful for storing data that needs to be shared between different parts of the app, such as user preferences and authentication tokens. ![app-state-variables.avif](https://docs.flutterflow.io/assets/images/app-state-variables-c3be8e44314611883d9decf575ab0882.avif) App state variables should be used in scenarios where the same data needs to be accessed and modified from multiple locations within the app. For instance, in a shopping cart app, items in a user's cart are usually accessible across different pages. App state variables should not be used for temporary data that doesn't impact the overall state of the application. For instance, a user's temporary input in a form should not be stored in an app state variable. It would be more appropriate to use a [page state](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#page-state) or [component state](https://docs.flutterflow.io/generated-code/state-management#component-state) variable instead. ## App State Variables Let’s see how you can manage the app state variable using an example of adding items to a cart in a shopping app. ### Create App State variable Head over to the left-side navigation menu and follow the steps below to create a variable.
#### App State Properties - **isList:** Whether this field is a list type (e.g List of String or List of Custom Data Type) - **Persisted:** Whether this app state is saved to disk so that it can be loaded when the app is restarted. Otherwise the field will be reset on restart. :::tip[Generated Code] Curious about what happens when the **Persisted** toggle is on? Check out the [**Generated Code**](https://docs.flutterflow.io/generated-code/state-management#persisting-app-state) guide. ::: ### Use App State The variable can now be accessed via set from variable menu. For example, on the cart page, you can loop through the app state variable to display each item. ![access-app-state-variable.avif](https://docs.flutterflow.io/assets/images/access-app-state-variable-32ed5e4451632f8519881db24b694184.avif) ### Update App State [Action] You can update an app state from the Actions Panel anywhere in the app, whether it's on tap of a widget in a component or page, or via custom code in FlutterFlow Studio. When you update the app state via the Action Flow Editor, you will find the following options in the Action Settings. ![update-app-state-action.png](https://docs.flutterflow.io/assets/images/update-app-state-action-17d969477327725f5d471be230a97ee1.png) #### Update Type How this app state update will affect your app. - **Rebuild All Pages:** Rebuilds all pages in the app when this app state is updated. - **Rebuild Current Page:** Rebuilds only the current page when this app state is updated. - **No Rebuild:** No rebuild is required. :::tip[Generated Code] Curious about how state changes are handled internally when you choose different **Update Type** options? Explore the detailed [**FFAppState**](https://docs.flutterflow.io/generated-code/ff-app-state) guide. ::: Here's a quick guide to updating the app state variable. We need to add an action to the 'Add to Bag' button. Within this action, we'll provide the product details and configure it to add to the current cart list.
:::tip If you want to rebuild a page or component without updating any state variables, use the [**Rebuild**](https://docs.flutterflow.io/concepts/state-management#rebuild-action) state action. ::: ## FAQs
Why are some variable types not available in App State?

Certain variable types, e.g., **Firestore Documents** and **Supabase Row**, can be used in Page State or Component State, but not in App State. This is because App State variables are designed to be global, meaning they stay in memory throughout the app. When App State variables are marked as persisted, the variable’s value is saved to the device’s local storage. Storing large or complex data types like documents in App State could lead to **performance or size issues**, especially on lower-end devices. For this reason, FlutterFlow Studio limits App State to lightweight types, while Page/Component State allows for more flexibility since their scope is smaller and temporary. If you need to work with such data types, it's recommended to store them in Page or Component state instead.

# Constants > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/data-representation/constants Explore the importance of using Constants in FlutterFlow Studio to define unchanging values throughout your application. Constants are used to define values that remain unchanged throughout the lifetime of an application. Using constants is a good practice for values that do not need to be recalculated or reassigned. Constants are used to define values that you believe are fixed, like API endpoints, standard mathematical values, maximum size limits set by business rules, etc. :::tip[When to use Constants vs **[App state variables](https://docs.flutterflow.io/resources/data-representation/app-state)?**] Constants don't change. Once you set its value (in builder), you can't change it from within the app. On the other hand, app state variables are dynamic. They can be updated in response to interactions in the application, such as a user clicking a button or entering data. ::: ## Create and use Constants
:::tip[Naming Convention] Prefer using a lowercase `k` prefix for constants to indicate their immutability, especially for project-specific constants. This approach is more concise and aligns with Dart's common practices. To learn more, refer to the guide on **[Naming Variables & Functions](https://docs.flutterflow.io/resources/style-guide)**. ::: # Global Properties > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/data-representation/global-properties Learn how to use FlutterFlow Studio global properties to access app, device, and platform information. Global properties are built-in variables that you can use across all pages of your FlutterFlow Studio app. FlutterFlow Studio defines these properties; you can't create your own or assign values to them. For example, global properties can be used to redirect users to another page if they are not logged in or to enable specific functionality based on the platform your app is running on. You can access these properties through **Set from Variable > Global Properties**. ![global-properties.avif](https://docs.flutterflow.io/assets/images/global-properties-334541daf62a438eecee710a65a556db.avif) ## List of Global Properties The following global properties are available: - **Is User Logged In:** Indicates whether a user is currently logged into the app. Use this value to show content or features based on login status. This property is only accessible if you have enabled authentication. - **Current Time:** Returns the current date and time. Use [custom formatting](#current-time) to control how the value is displayed. - **Current Device Location:** Returns the user's current location. See how to [use the location as a map's initial location](#current-device-location). - **Link To Current Page:** Provides the [Deep Link](https://docs.flutterflow.io/concepts/navigation/deep-dynamic-linking#deep-link) of the current page. - **Current Route Path:** Provides the route name of the currently visible page. Use this value to check which page is active before running an action. For example, a push notification might open another page while the home page's **On Page Load** actions are running. See the [example of checking the active route](https://github.com/FlutterFlow/flutterflow-issues/issues/2765#issuecomment-2598915946). - **Current Route Stack:** Returns the route names in the app's navigation stack. Use this list for custom back navigation, breadcrumbs, or navigation analytics. - **Fraction of Screen Width:** Returns a specified fraction of the screen width. For example, half the screen width can be used to size a widget to 50% of the available width. - **Fraction of Screen Height:** Returns a specified fraction of the screen height. For example, half the screen height can be used to size a widget to 50% of the available height. - **Screen Width:** Returns the screen width in logical pixels, not physical display pixels. - **Screen Height:** Returns the screen height in logical pixels, not physical display pixels. - **Is Android:** Determines if the user is accessing the app on an Android device. [Refer here](#is-androidiosweb). - **Is iOS:** Determines if the user is accessing the app on an iOS device. [Refer here](#is-androidiosweb). - **Is Web:** Determines if the user is accessing the app through a web browser. [Refer here](#is-androidiosweb). - **Is Debug Mode:** Indicates if the app is currently running in debug mode, useful for displaying features or performing actions only during debugging. - **Is Dark Mode:** Checks if the app's current theme mode is set to dark. - **Is Light Mode:** Checks if the app's current theme mode is set to light. - **Is On-Screen Keyboard Visible:** Checks whether the on-screen keyboard is visible. Use this value to adjust the layout when the keyboard opens. See the [bottom navigation example](#is-on-screen-keyboard-visible). - **Current Environment:** Returns the current [development environment](https://docs.flutterflow.io/testing/dev-environments) value. :::tip[Generated Code] Learn more about the [**Generated Code**](https://docs.flutterflow.io/generated-code/state-management#global-state) behind Global Properties. ::: ### Current Time The **Current Time** property returns the current date and time. This option is available when **Source** is set to **Global Properties**. You can use this property to display the current date and time on the screen or pass it to a FlutterFlow Studio or custom widget for further processing. #### Custom Formatting Use **Custom Format** when you need a date or time format that isn't available among the predefined options. ![Current Time with the custom format yyyy/MM/dd || kk:mm displays 2023/07/25 || 10:30.](https://docs.flutterflow.io/assets/images/current-time-light-b3c17217207d94533d06982e82fdff62.png) For example, the custom pattern `yyyy/MM/dd || kk:mm` displays July 25, 2023, at 10:30 AM as `2023/07/25 || 10:30`. The pattern uses these symbols: - `yyyy` represents a four-digit year, like `2023`. - `MM` is a two-digit month, such as `07` for July. - `dd` indicates a two-digit day, for instance, `25`. - `kk` represents a two-digit hour from `01` to `24`, with midnight represented as `24`. - `mm` stands for a two-digit minute, such as `30`. Use `HH` instead of `kk` for hours from `00` to `23`, with midnight represented as `00`. The following explicit patterns show common formats. Example output uses July 25, 2023, at 10:30:45 AM in an English locale. | Custom Pattern | Example Output | | --- | --- | | `yyyy/MM/dd` | `2023/07/25` | | `dd/MM/yyyy` | `25/07/2023` | | `MMM d, yyyy` | `Jul 25, 2023` | | `MMMM d, yyyy` | `July 25, 2023` | | `EEEE, MMMM d, yyyy` | `Tuesday, July 25, 2023` | | `HH:mm` | `10:30` | | `HH:mm:ss` | `10:30:45` | | `h:mm a` | `10:30 AM` | Explicit patterns control field order and separators. Month and weekday names depend on the locale. DateFormat also supports locale-adaptive skeletons, such as `yMd` and `jm`. A skeleton's output depends on the locale; `jm` can use either 12-hour or 24-hour time. :::note For more patterns and information about skeletons, see the [**DateFormat class documentation**](https://pub.dev/documentation/intl/latest/intl/DateFormat-class.html). ::: ### Current Device Location **Current Device Location** returns the device's location as latitude and longitude. You can access it when **Source** is set to **Global Properties**. Use this value to display the user's location on a map or store it in a backend database. :::caution Use Run mode to test this property; it isn't supported in Test mode. To test on Android, iOS, or desktop platforms, use [**Local Run**](https://docs.flutterflow.io/testing/local-run). ::: For example, use the device's location as the initial location of a GoogleMap widget, which accepts a `LatLng` value: 1. Select the **GoogleMap** widget in the widget tree or on the canvas. 2. In the properties panel, find **Initial Location** and click **Set from Variable**. 3. Set the **Source** to **Global Properties**. 4. Set **Available Options** to **Current Device Location**. 5. Click **Confirm**. ![Set the GoogleMap widget's Initial Location from Global Properties > Current Device Location to use the device's latitude and longitude.](https://docs.flutterflow.io/assets/images/get-current-device-location-321ce7fc3af2050eda9e77087827bd19.png) ### Is Android/iOS/Web Use **Is Android**, **Is iOS**, and **Is Web** in visibility conditions or conditional actions to customize behavior for each platform. Each property returns a Boolean value. - **Is Android:** Show Android-specific instructions or run an action intended for the Android app when this property is `true`. - **Is iOS:** Show iOS-specific instructions or run an action intended for the iOS app when this property is `true`. - **Is Web:** Show browser-specific instructions when this property is `true`. A web app can run in a desktop or mobile browser, so this property doesn't indicate the screen size. ### Is On-Screen Keyboard Visible **Is On-Screen Keyboard Visible** returns `true` when the on-screen keyboard is visible and `false` when it is hidden. You can access it when **Source** is set to **Global Properties**. #### Hide Bottom Navigation When the Keyboard Is Visible For example, an app with a dog-details form can hide its custom bottom navigation bar while the user types in a text field. Here's how it looks: ![The custom bottom navigation is visible when the keyboard is hidden and hidden when a text field opens the keyboard.](https://docs.flutterflow.io/assets/images/keyboard-bottom-navigation-56bbe524413e29e94860e3fcb3e020ac.png) Add [Conditional Visibility](https://docs.flutterflow.io/resources/ui/widgets/widget-commonalities#conditional) to the custom bottom navigation. Set the condition to show the navigation only when **Global Properties > Is On-Screen Keyboard Visible** is `false`. This keeps the navigation visible when the keyboard is hidden and hides it when the keyboard opens. ![Conditional Visibility shows the bottom navigation when Is On-Screen Keyboard Visible is false and hides it when the property is true.](https://docs.flutterflow.io/assets/images/keyboard-conditional-visibility-0763b94dce33e810121f03d9f3366224.png) # Control Flow & Logic > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/control-flow-overview Control flow in programming refers to the order in which individual statements, instructions, or Control flow in programming refers to the order in which individual statements, instructions, or function calls are executed or evaluated. Proper control flow is crucial for determining how your app responds to user inputs and events. Here are some key elements: * **[Conditional Flows:](https://docs.flutterflow.io/resources/control-flow-concepts)** These include `if`, `else if`, and `else` flows that allow your app to make decisions based on certain conditions. For example, you might check if a user is logged in and then show different content based on their authentication status. * **[Loops:](https://docs.flutterflow.io/resources/functions/loops)** Loops allow your app to repeat a sequence of logic multiple times. This is useful for tasks like iterating through a list of items or retrying a failed operation. * **[Event Handling:](https://docs.flutterflow.io/resources/functions/action-flow-editor#action-triggers)** In certain cases, you will execute functions that are triggered by specific events such as user interactions (e.g., taps, swipes) or system events (e.g., page load, on focus change). Understanding how to handle such events effectively ensures that your app reacts appropriately to user interactions or events. **Logic** or **Functions** refer to the core operations and behaviors that determine how an app responds to user actions and interacts with data. This could include: * **Business Logic:** This is the part of the app that manages the rules and processes of the real world. For example, in an e-commerce app, it handles tasks like processing orders, calculating prices, and managing inventory. * **User Interface Logic:** This controls how the app looks and interacts with users. It includes tasks like validating forms, navigating between screens, and updating content based on user actions. * **Data Logic:** This manages the app's data. It includes tasks like fetching, storing, updating, and deleting data from databases or via APIs. Let's dive into few more key concepts: ## Functions A function is a block of code designed to perform a specific task. Functions can be reused throughout your application to perform common tasks efficiently. ### Triggers or Running a Function Functions can be executed in various ways: they can be called from properties within the app, such as performing a quick calculation or number formatting before setting the final value to a variable, or concatenating strings before setting the string to a text widget. Functions can also run in response to specific events, such as a button click or a page load. ### Types of Functions There are different types of functions you can use in your app. Some examples in FlutterFlow Studio are: * **[Built-in Utility Functions](https://docs.flutterflow.io/resources/functions/utility):** Functions that perform general utility tasks, such as formatting data or performing calculations. In FlutterFlow Studio, you can use [**Inline Function**](https://docs.flutterflow.io/resources/functions/utility#inline-function-code-expressions) for simple data manipulation tasks or use the **[Combine Text](https://docs.flutterflow.io/resources/functions/utility#combine-text)** built-in function to concatenate strings. * **[Actions](https://docs.flutterflow.io/resources/functions/action-flow-editor):** Sequence of Logic performed in response to user interactions. For example: * **[Updating State Variables:](https://docs.flutterflow.io/concepts/state-management)** Functions that modify the current state or data of the app, page, or component. * **Widget-specific Functions:** Functions applicable to various widgets that need specific actions, such as scrolling to an item in a ListView, clearing text fields, or calling third-party integration functions. * **[Custom Actions:](https://docs.flutterflow.io/concepts/custom-code/custom-actions)** More complex actions written in **Flutter & Dart** that can be added as a node to the action flow editor. * **[Navigation:](https://docs.flutterflow.io/concepts/navigation/overview)** Functions that handle the movement between different pages or screens within your app, including opening bottom sheets or dialogs. In FlutterFlow Studio, such functions can either run automatically after certain related operations, such as Login/Create Account, or they can be added as individual **Actions** if the developer enables it. * **[Backend Queries:](https://docs.flutterflow.io/resources/backend-query)** Functions that interact with your database or external services to retrieve or manipulate data. * **[Custom Functions:](https://docs.flutterflow.io/concepts/custom-code/custom-functions)** Complex manipulation code written in **Dart**, used to set properties of a widget or an action. ## # Control Flow Concepts > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/control-flow-concepts Understand and implement control flow in your FlutterFlow Studio app to manage the execution of statements, instructions, and function calls under various conditions. In app development, control flow refers to the order in which individual statements, instructions, or function calls are executed or evaluated. Proper control flow ensures that your app behaves as expected under various conditions and user interactions. This involves understanding and implementing **conditionals**, managing **sequential and parallel** logic flows, handling **blocking and non-blocking** actions, and deciding when and how to execute specific actions based on certain criteria. In this section, we will explore various control flow concepts and how they can be effectively implemented in FlutterFlow Studio to create dynamic, responsive, and efficient applications. ## Conditional One of the fundamental aspects of control flow is the use of conditionals, which allow your app to make decisions and execute different blocks of code based on specific criteria. Conditional statements are expressions that evaluate to either true or false. Depending on the result of these evaluations, different logic sequences are executed. The primary conditional statements are `if`, `if-else`, and `else`. - **`if` Statement:** The if statement evaluates a condition and executes a block of code if the condition is true. The if statement evaluates a condition and executes a block of code if the condition is true. ![if-condition.png](https://docs.flutterflow.io/assets/images/if-condition-46b2d18ed56b7c74168db859e37fe0ae.png) - **`if-else` Statement:** The if-else statement provides an alternative block of code to execute if the condition is false. ![if-else-condition.png](https://docs.flutterflow.io/assets/images/if-else-condition-8a738666792cecca224759a3cd726e51.png) Here, if `userIsLoggedIn` is true, the app will show a welcome message. Otherwise, it will prompt the user to log in.

- **`else if` Statement:** The `else if` statement can be used to check multiple conditions sequentially. ![if-elseif-condition.png](https://docs.flutterflow.io/assets/images/if-elseif-condition-8606606c66f1fe359dcf7d42f61183ca.png) This example demonstrates multiple conditions. If `userIsLoggedIn` is true, it shows a welcome message. If not, it checks if `userIsGuest` is true and shows a guest message. If neither condition is met, it prompts the user to log in. ### Implementing Conditionals In FlutterFlow Studio, you can implement conditional logic in two primary ways: - **[When Setting Properties](https://docs.flutterflow.io/resources/functions/conditional-logic#setting-widget-properties-with-conditional-logic)** In FlutterFlow Studio, you can set properties of widgets conditionally. For example, you might want to change the color of a button based on a variable's value. You can use conditional expressions to dynamically set these properties during runtime. - **[Conditional Actions](https://docs.flutterflow.io/resources/functions/conditional-logic#conditional-actions)** You can also perform conditional actions in FlutterFlow Studio, where certain actions are executed only if specified conditions are met. This is useful for implementing logic like navigating to different pages based on user input or showing/hiding widgets. Example: If the user clicks a button and a form is valid, navigate to the next screen; otherwise, show an error message. :::note Check out the [**complete guide**](https://docs.flutterflow.io/resources/functions/conditional-logic) here. Are you looking to learn about implementing conditional UI instead? Check out our **[Responsiveness 101](https://docs.flutterflow.io/concepts/layouts/responsive)** guide instead. ::: ## Sequential vs Parallel Logic Flow - **Sequential Logic Flow**: Actions are executed **one after the other**. Each action waits for the previous one to complete before starting. This is useful for tasks that depend on the outcome of previous actions. **Example:** Submitting a form, waiting for a server response, and then showing a confirmation message. - **Parallel Logic Flow** Multiple actions are executed at the **same time**, independently of each other. This is useful for tasks that can be done simultaneously and do not depend on each other's outcomes. **Example:** Loading data from multiple sources simultaneously to speed up the data fetching process. ![parallel-sequential.png](https://docs.flutterflow.io/assets/images/parallel-sequential-14310ce3eccf7c5d31ebd268d3ddffb1.png) ## Asynchronous Functions Asynchronous functions are operations that do not complete immediately and may finish at a future time due to network delays or long computation times. They can be made **blocking** or **non-blocking** depending on the use case. Some examples of asynchronous operations include: - **Network requests** (e.g., fetching data from an API) - **Database operations** (e.g., reading or writing data) - **Long-running computations** (e.g., complex calculations) - **Animations** (e.g., transitions, widget animations) ### Blocking Actions Blocking actions are actions that halt the execution of subsequent actions until they are completed. These actions typically involve operations that take time, such as network requests or animations. :::tip[Generated Code] In the **generated code**, FlutterFlow Studio uses the `await` keyword to pause the execution of an asynchronous function until the operation completes before proceeding to the next function. This approach is commonly used to handle asynchronous functions, ensuring that each operation finishes before the subsequent one begins. In the following example from **generated code**, the code **awaits** on `actions.getRandomIntAfterWait()` because it is an asynchronous function that takes around 2 seconds to complete and provide a result (in this case, a random integer). ```dart _model.result = await actions.getRandomIntAfterWait(); _model.text1Value = _model.result.toString(); ``` The result of the `actions.getRandomIntAfterWait()` is stored in `model.result` variable and then the result then set to a Text widget using the Page State variable `text1Value`. ::: ### Non-Blocking Actions Non-blocking actions, on the other hand, allow the program to continue executing other subsequent tasks while waiting for the initial actions to complete in the background. :::tip[Generated Code] In the **generated code**, when an asynchronous function is made **non-blocking**, FlutterFlow Studio removes the `await` keyword. This means the subsequent function will not wait for the asynchronous action to complete and will move to the next action immediately. The previous example will no longer work because it doesn't await the asynchronous function `actions.getRandomIntAfterWait()`. As a result, the variable `model.result` may not be ready or available when `_model.text1Value = _model.result.toString();` is executed. ``` _model.result = actions.getRandomIntAfterWait(); _model.text1Value = _model.result.toString(); // will throw errors ``` To ensure proper execution, make only those actions non-blocking whose subsequent actions do not depend on the results from these initial functions. ::: ## Non-Blocking vs Parallel Actions | Non-Blocking Actions | Parallel Actions | |------------------------------------------------------------------------|---------------------------------------------------------------------------------------| | Allows the subsequent action to run **immediately** after the current one without waiting for the current action to complete. | Allows users to run two or more actions at the **same time** independently. | | **Only asynchronous** functions can be made non-blocking. | **Both asynchronous and synchronous** functions can be included in parallel actions. | | Ideal for tasks where the result of the action is not immediately needed by the next action. | Ideal for independent tasks that can be executed simultaneously to improve efficiency. | | Ensures the app remains responsive by not waiting for long-running tasks. | Helps in reducing overall execution time by performing multiple tasks concurrently. | | **Example**: Fetching data in the background while allowing user interaction. | **Example**: Loading data from two APIs simultaneously to save time. | # Utility Functions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/functions/utility Learn about the built-in utility functions available in FlutterFlow Studio to enhance your app's UI logic. Utility functions are crucial for simplifying common tasks in app development, such as performing quick calculations, formatting data, and concatenating strings. In FlutterFlow Studio, you can effortlessly integrate these utility functions when setting variables to value sources. This allows you to simplify processes like calculations, data formatting, and text manipulation directly within the visual builder. FlutterFlow Studio has the following built-in functions: * **Combine Text:** A built-in function that lets you concatenate strings, making it easy to join multiple text elements together seamlessly. * **Inline Function:** This feature allows you to perform simple calculations and data manipulations quickly and efficiently. ## Combine Text Oftentimes, you will encounter scenarios where you need to show two variables in a single String or Text widget. For example, in our [Ecommerce Demo](https://bit.ly/ff-docs-demo-v2) app, we have a price object in the following format: ```json "price": { "currency": "$", "amount": 25.50 } ``` However, when displaying the data in the UI, we should combine both the currency value and amount, as they make sense only together. In such cases, we can use the **Combine Text** built-in function available in all value sources that take a `String`. You can combine any number of _dynamic_ and _static_ variables together, even if they are not `Strings` themselves. In the end, the final value is always a String since it is set to a widget that only accepts `String` data types. Here is a quick demo:

:::caution[Combine Text vs RichText widget] The **Combine Text** built-in function only allows you to combine multiple values (dynamic or static) together, with the same text style applied to all of them. If you need to combine multiple String values with different text styles for each, consider using the **[RichText](https://docs.flutterflow.io/resources/ui/widgets/text#richtext-widget)** widget. Text assembled with **Combine Text** does not appear in the Languages table and is not included in **Translate All**. Static text in RichTextSpan children is translatable. ::: ## Inline Function (Code Expressions) :::note **Code Expressions** was renamed to **Inline Functions** starting from FlutterFlow Studio 6.0 version. ::: Often times, you may need to quickly format data, convert a data type from one form to another, or perform a simple calculation before setting the variable to a data source, such as a widget value source. Inline Function is a piece of code that combines operators, variables, and/or values to produce a result. It can be used for arithmetic and logical operations, among other tasks. To add inline function, open the Set from Variable dialog wherever it's possible to set a dynamic value and choose the values that will be part of the inline function. For example, we may want to quickly calculate the discount amount of a product where the discount is 18% of the MRP of the product. The expression would be `cost - (cost * discount)`. :::tip Looking for more power and flexibility? Use the new [**Custom Code Expression**](#custom-code-expression). It’s a more advanced version of Inline Functions that lets you access FlutterFlow Studio generated resources without passing them as arguments. You also get real-time autocomplete and inline error checking for faster, more accurate logic. ::: **Precedence of operations** Inline Function for math operations follow typical precedence (e.g., multiplication/division before addition/subtraction), but parentheses can change the order. In this case, the variables we need are `cost` and `discount`. So, we create two arguments in the **Inline Function** dialog where they hold the value of `cost` and `discount`, assign the data type for each of the arguments, and define the return type of the final value. In this case, the return type is a `double` since it holds the **subtotal** amount.
Now you can write the inline function in the **Expression** field and click on **Check Errors** to see if the expression is valid. If it is valid, you will see the generated code for the same. The arguments in a Inline Function can take the following properties: | DataType | Supports Nullable | Supports List | |----------|-------------------|---------------| | String | ✅ | ✅ | | Integer | ✅ | ✅ | | Double | ✅ | ✅ | | Boolean | ✅ | ✅ | | Colors | ✅ | ✅ | ### Common Examples Here are some common expressions you can use for your business logic: | Expression | Description | Example | Return Type | |------------------------------------|---------------------------------------------------------|----------------------------|----------------| | `contains()` | Checks if a **string** contains a particular substring. | `text1.contains(text2)` | `bool` | | `split()` | Splits a **string** into a list of substrings. | `text.split(",")` | `List` | | `toLowerCase()` or `toUpperCase()` | Converts all characters in a **string** to lowercase. | `text.toLowerCase()` | `String` | | `contains()` | Checks if a **list** contains a particular element. | `fruits.contains("apple")` | `bool` | | `max()` | Returns the larger of two numbers. | `math.max(a, b)` | `int` | | `toDouble()` | Converts the **integer** to a **Double**. | `intValue.toDouble()` | `double` | | `int.parse(s)` | Convert the **String** into an **integer.** | `int.parse(stringValue)` | `int` | ## Custom Code Expression **Custom Code Expression** lets you write short Dart code directly in widget property fields and action flows in FlutterFlow Studio. It’s a more powerful version of [**Inline Function**](#inline-function-code-expressions), allowing you to directly access FlutterFlow Studio generated classes, global variables, widget properties, parameters, and more without needing to manually pass them as inputs. Custom Code Expressions also support real-time autocomplete, making it easy to discover available fields as you type. For example, when you type `FFAppState().`, it will suggest all available app state variables along with their types. In addition, inline validation provides immediate feedback as you write, helping you catch syntax errors or invalid property references. :::note To use Custom Code Expression, you must have an active [**FlutterFlow Studio paid plan**](https://www.flutterflow.io/pricing). ::: :::tip - To explore what you can access within a Custom code expression, refer to the [**Common Examples**](https://docs.flutterflow.io/concepts/custom-code/common-examples) page. - Press `^ + Space` (or `Ctrl + Space`) while typing to see suggestions for what you can access in your Custom code expression. - You can access values inside custom structs. For example, you can use `FFAppState().localDeviceInfo.osVersion` if that field exists in your app state. - To use Custom code expressions better, it's helpful to understand how FlutterFlow Studio builds your project behind the scenes. You can check the [**State Management**](https://docs.flutterflow.io/generated-code/state-management) page and other **Generated Code** sections to learn how everything is set up. ::: Here are a couple of examples showing how to access App State and Page State within a Custom code expression: - **App State Access:** For example, to check if dark mode is enabled using an App State variable: ```jsx FFAppState().enableDarkMode ? 'Dark Mode On' : 'Light Mode Off' ``` This accesses the global `enableDarkMode` boolean stored in `FFAppState`, and returns a string based on its value. - **Page and Component State Access:** For example, to access a page or component state variable like `searchText`, you start with `_model.` and then select the variable from the autocomplete suggestions. ```jsx _model.searchText.isEmpty ? '' : 'Searching for "${_model.searchText}"' ``` This expression checks if the `searchText` variable (defined as a page state) is empty, and returns an appropriate message. The `_model` object refers to the current page’s generated state model. Here's an example of adding a Custom Code Expression:

### Execute Custom Code [Action] To use a Custom Code Expression when triggering actions in FlutterFlow Studio (i.e., inside an Action Flow), you can use the **Execute Custom Code** action. This allows you to run a Dart expression when something happens, such as tapping a button or after a page loads. ![execute-custom-code.avif](https://docs.flutterflow.io/assets/images/execute-custom-code-bd07ca89bc8f62a23382545a6573949c.avif) The Execute Custom Code action can be really helpful in scenarios where the home page is removed early from the navigation stack and standard navigation using the local context may fail. To prevent this, you can [use the global navigator context](https://docs.flutterflow.io/concepts/navigation/deep-dynamic-linking#using-global-context-to-navigate) inside a code expression. ## Custom Functions You can also use custom functions to handle slightly more complex calculations or to process a wider range of data types that are not supported in Inline Function. :::note Learn more about [**Custom Functions**](https://docs.flutterflow.io/concepts/custom-code/custom-functions). ::: ## FAQS
How is a Custom Code Expression different from an Inline Function?

Custom Code Expression is a more advanced and flexible version of Inline Function. With Inline Functions, you had to manually pass values as arguments. In contrast, Custom Code Expressions let you directly reference FlutterFlow Studio generated resources (such as `FFAppState()`, `_model`, context, and more) without needing to pass them in. You can write any valid Dart expression in a Custom code expression, even multi-line logic using anonymous functions. Plus, Custom Code Expressions support real-time autocomplete and inline error validation, making it much easier to discover available variables and avoid mistakes.

# Actions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/functions/action-flow-editor Learn how to use the Action Flow Editor in your FlutterFlow Studio app to manage and streamline your backend logic. Effectively managing user interactions is essential for developing interactive applications. Designing interactivity involves two steps: 1. Listening for Interaction (**Action Triggers**) 2. Responding to Interaction (**Actions**) **Action Triggers** represent a specific event, while **Actions** are functions executed in response to the triggered event. Common triggers are: - **On Tap**: Triggered on tapping on a widget or specifically buttons. - **On Selected:** Triggered on selecting an option from a dropdown list. - **On Page Load:** Triggered on loading a page Actions are tasks or operations that are performed in response to an event detected by a trigger. ## Action Flow Editor The Action Flow Editor is a visual, node-based editor used to configure the functions that run in response to a trigger. This editor simplifies the process of creating and managing business logic. ![Action Flow Editor](https://docs.flutterflow.io/assets/images/actions-e960c2b3fcd71f75014ba419ffa23dc8.avif) ### Action Triggers When you open the Action Flow Editor, no triggers are added by default. To add a trigger, simply search for and select the desired one from the available options. The Action Triggers bar, located at the left of the editor, displays all added triggers. :::note To learn more about **Action Triggers** and its types, refer [**here**](https://docs.flutterflow.io/resources/functions/action-triggers). :::

:::caution[Exposed by FlutterFlow Studio] Please note that Action Triggers are exposed by FlutterFlow Studio and are not user-generated. You can only work with the ones provided in the Action Flow Editor. ::: Each trigger has its own separate node-editor, allowing you to create distinct logic flows for different events. When you switch between triggers, the node-editor will update to display the logic specific to the selected trigger.
:::note It's important to note that the logic defined in the node-editor is associated with the selected trigger. This means that the actions you set up will only be executed when that particular trigger is activated. ::: ### Node Editor This central area of the editor is where you define and visualize the logic/actions that will execute in response to the selected trigger. The actions are laid out in a flowchart-like manner, making it easy to understand and modify the flow of actions. Actions in the Node Editor are executed synchronously. This means that if an action returns a value, it will be available to subsequent actions within the flow. :::tip[Synchronous vs Asynchronous] **Synchronous actions** are executed one after another, with each action waiting for the previous one to complete. **Asynchronous actions** are executed independently and can run concurrently, allowing other following tasks to proceed without waiting for them to finish. ::: ### Creating Action If there is no initial action or if there is an action,and you want to add another one and press the plus icon, the following options will be available: 1. **Add Action**: Adds a single action node to the flow. You can add multiple synchronous actions one after another. 2. **Add Conditional Action**: Adds a conditional node with an input for a boolean expression and two action branches. The actions in each branch will be executed based on the evaluation of the boolean expression. 3. **Add Loop**: Adds a loop flow that contains an input boolean expression and an action flow. The actions within the loop will be executed repeatedly as long as the expression evaluates to true ( similar to a while loop). 4. **Add Parallel**: Adds two action flow branches that will be executed in parallel. 5. **Paste Action(s)**: Allows you to paste actions previously copied to the clipboard. After creating an action node, you need to specify the action type in the Right Panel. Creating a node is equivalent to creating an empty function, and specifying the action type is like filling out the function body with the desired logic.
### Right Panel The Right Panel serves two main purposes: 1. **Selecting Actions**: Choose the specific actions you want to add to your action flow. 2. **Configuring Actions**: Configure the properties, parameters, and return names of the selected action.
### Widget Binding In the Action Flow Editor, the icon in the upper left corner indicates the widget to which the current action flow is bound. ![Widget Binding](https://docs.flutterflow.io/assets/images/widget-binding-5e3c31a9a5e00772c04a2fc51ad6c67a.avif) :::note If you rename your widget, the new name will automatically be updated and associated with this action flow. This makes it easier to keep track of the logic associated with each widget, ensuring clarity and better organization of your action flows. ::: ### Issues The bug icon will display warnings and errors in any of the action flows bound to this widget. Note, these are neither issues in the whole project nor issues in all of the action flow but *only* issues generated from the action flows bound to *this* widget. This includes *all* the action flows on *all* the triggers and not just currently visible action flow on the selected trigger. ![Issues](https://docs.flutterflow.io/assets/images/action-errors-3bd97539688a6e9a8ae102f8e5b74cf5.avif) ### Action Blocks The diamond icon in the Action Flow Editor opens a menu where you can create and edit Action Blocks. **Action Blocks** are reusable action flows that can accept parameters and return values, promoting code reusability and modularity. ![action-block.avif](https://docs.flutterflow.io/assets/images/action-block-icon-7f09cb4c8a36689a1503abee4a6057db.avif) :::tip[Deep Dive on Action Blocks] Learn more about different types of **[Action Blocks](https://docs.flutterflow.io/resources/functions/action-blocks)** and their scopes. ::: ## Adding an Action [Example] Here's a quick demo of how you can add an action or multiple sequential actions to a widget:
# Action Triggers > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/functions/action-triggers Explore the action triggers available in FlutterFlow Studio. **Action Triggers** represent specific events that occur when a user interacts with the app, such as tapping a button, selecting an option from a dropdown, or loading a new page. When an Action Trigger is invoked by one of these interactions, it initiates a corresponding **Action**—a task or operation that responds to the event. In essence, Action Triggers are the '_listeners_' in your app, keeping an eye out for user interactions and signaling when it's time for your app to respond. By understanding and utilizing Action Triggers, you can craft a more dynamic and user-friendly application experience. ## Types of Action Triggers ### Page & Component Root Level Triggers FlutterFlow Studio provides several action triggers that allow you to respond to a page or component being initialized, or things like a key press event. For more information on these triggers, see the [Page Actions & Lifecycle](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle) and [Components Actions & Lifecycle](https://docs.flutterflow.io/resources/ui/components/component-lifecycle) pages. ### Basic Triggers FlutterFlow Studio provides several basic action triggers that can be easily added: - **On Tap**: This trigger is activated when a user taps on a widget. For instance, you can use this trigger to display a [Snackbar message](https://docs.flutterflow.io/resources/ui/pages/scaffold#snackbar) when a [button](https://docs.flutterflow.io/resources/ui/widgets/button) is tapped. - **On Double Tap**: This trigger is activated when a user taps a widget twice quickly. A typical example might be zooming in on an image or photo when the user double-taps on it. - **On Long Press**: This trigger is activated when a user presses and holds down on a widget for an extended period. A common use case is to show additional options or a context menu, such as allowing a user to delete or rename a file when long-pressing on it. Here’s an example of showing a message on button click using the **On Tap** trigger:

### Widget Specific Triggers Certain widgets offer specific triggers that activate based on user interactions or device events. These triggers enable developers to define custom behaviors for various situations. Below are examples of widget-specific triggers: - **On Submit**: Triggered on the TextField widget when the user presses "submit" or "done," finalizing text entry. - **On Page Load**: Available on the page widget, this trigger activates as soon as the page loads, useful for tasks like data fetching or content updates. - **On Phone Shake**: Specific to the page widget, this trigger responds to physical shaking of the device, commonly used in games for actions like rolling dice. - **On Selected**: Found on widgets like Dropdowns, CheckboxGroups, Sliders, RadioButtons, and ChoiceChips, this trigger activates upon any change in selection. - **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 Count Controller widget, this trigger responds to changes in the count. ## Gesture Detector Triggers Gesture Detector Triggers enable you to respond to user gestures, such as taps, drags, swipes, and pinches. These triggers are invoked based on specific gestures and allow you to add actions in response to user interactions. For example, the `onDoubleTap` trigger is invoked whenever a user quickly taps twice on a widget, which can be used to toggle a 'like' state or zoom in on content. These triggers are accesible when you add an action onto a `Container`. ### Lifecycle stages The lifecycle of gesture triggers involves four key stages: **Start**, **Update**, **End/Stop**, and **Cancel**. These stages dictate how gestures are detected and handled, from the initial interaction to completion or cancellation. Understanding this lifecycle is crucial for building intuitive gesture-based interactions in your app. #### Tap Gesture Lifecycle Tap gestures have a simpler lifecycle, focusing primarily on detecting taps and whether they complete or get canceled. Here's how the tap lifecycle works: 1. **Down**: This stage begins when the user places their finger on the screen to initiate a tap. For example: `onTapDown` is triggered when the user touches the screen to start a tap. 2. **Up**: The tap gesture is completed when the user lifts their finger from the screen. For example: `onTapUp` is triggered when the user completes the tap by lifting their finger. 3. **Tap**: After both of the above actions are successfully completed, `onTap` is triggered indicating a full tap gesture has occurred. 3. **Cancel**: If the user moves their finger too much before lifting it, the tap is canceled, preventing the completion of the action. For example: `onTapCancel` will be called, and `onTap` will not be triggered. Here’s how the lifecycle flows for tap gestures: ![tap-gesture-lifecycle](https://docs.flutterflow.io/assets/images/tap-gesture-lifecycle-aa2aabf02f7c37fef8fb5ba2381c11e3.avif) #### Drag Gesture Lifecycle Drag gestures are more complex, involving continuous tracking of movement across the screen. The drag lifecycle involves the following stages: 1. **Start**: This stage occurs when the user begins dragging their finger on the screen. For example: `onHorizontalDragStart` is triggered when a horizontal drag is initiated. 2. **Update**: During the drag, the gesture’s movement is tracked, allowing you to capture real-time data like the pointer's position or delta values. For example: `onHorizontalDragUpdate` is triggered as the user drags their finger, enabling the app to track the drag’s progress. 3. **End/Stop**: The drag gesture is completed when the user lifts their finger, finalizing the interaction. For example: `onHorizontalDragEnd` is triggered when the user finishes dragging and lifts their finger off the screen. 4. **Cancel**: If the drag gesture is interrupted before it completes (for instance, by another gesture), it will be canceled. For example: `onHorizontalDragCancel` is triggered if the drag is interrupted before finishing. Here’s how the lifecycle flows for drag gestures: ![lifecycle-stage.avif](https://docs.flutterflow.io/assets/images/lifecycle-stage-fb3686571c89efb6d780be88eb80173f.avif) ##### Drag Gesture Cancellation For drag gestures, lifecycle doesn't always strictly follow the sequence of **Start**, **Update**, **End/Stop**. The **Cancel** stage can occur at any point, even before **End/Stop**, depending on the interaction. This is different from tap gestures because a drag can be canceled after it has started or even while it is being updated. For example, If a horizontal drag is interrupted before the drag completes (for example, if another gesture takes precedence), `onHorizontalDragCancel` is triggered instead of `onHorizontalDragEnd`. ![lifecycle-stage-cancel.avif](https://docs.flutterflow.io/assets/images/lifecycle-stage-cancel-0fb909588adf6847ef4ca5d046e680ed.avif) ### Available Gesture Detector Triggers Below is a complete list of available gesture detector triggers in FlutterFlow Studio to enhance the capabilities of gesture-based interactions. - **onDoubleTapCancel**: Triggered when a double-tap gesture is recognized but does not complete successfully. - **onDoubleTapDown**: Triggered when the user presses down on the screen for the first tap in a double-tap sequence. - **onForcePressEnd**: Triggered when the user releases a press that exceeds a certain force threshold. - **onForcePressPeak**: Triggered when the force of a press reaches its peak. - **onForcePressStart**: Triggered when the user begins pressing with enough force to pass a defined threshold. - **onForcePressUpdate**: Triggered when the user changes the amount of pressure applied during a press. - **onHorizontalDragCancel**: Triggered when a horizontal drag gesture is interrupted or canceled. - **onHorizontalDragDown**: Triggered when the user first touches the screen and initiates a horizontal drag. - **onHorizontalDragEnd**: Triggered when the user ends a horizontal drag gesture. - **onHorizontalDragStart**: Triggered when the user begins a horizontal drag gesture. - **onHorizontalDragUpdate**: Triggered continuously as the user drags horizontally. - **onLongPressCancel**: Triggered when a long press gesture is recognized but doesn't complete. - **onLongPressDown**: Triggered when the user first presses down on the screen with the intention of a long press. - **onLongPressEnd**: Triggered when the user releases a long press. - **onLongPressMoveUpdate**: Triggered as the user moves their finger while holding down during a long press. - **onLongPressStart**: Triggered when the long press gesture starts after the user holds down for the required duration. - **onLongPressUp**: Triggered when the user releases a long press after the hold duration. - **onPanCancel**: Triggered when a pan gesture (general dragging) is interrupted or canceled. - **onPanDown**: Triggered when the user first touches the screen with the intention of panning. - **onPanEnd**: Triggered when the user ends a pan gesture. - **onPanStart**: Triggered when the user begins a pan gesture. - **onPanUpdate**: Triggered continuously as the user drags their finger across the screen. - **onScaleEnd**: Triggered when the user ends a scaling gesture, such as pinch-to-zoom. - **onScaleStart**: Triggered when the user begins a scaling gesture. - **onScaleUpdate**: Triggered continuously as the user changes the scale (e.g., zooms in or out). - **onSecondaryLongPress**: Triggered when the user presses and holds with a secondary pointer (e.g., two-finger press). - **onSecondaryLongPressCancel**: Triggered when a secondary long press gesture is recognized but does not complete. - **onSecondaryLongPressDown**: Triggered when the user first touches the screen with a secondary pointer intending to long press. - **onSecondaryLongPressEnd**: Triggered when the user releases a secondary long press. - **onSecondaryLongPressMoveUpdate**: Triggered as the user moves a secondary pointer while holding down during a long press. - **onSecondaryLongPressStart**: Triggered when the secondary long press gesture starts after holding down for the required duration. - **onSecondaryLongPressUp**: Triggered when the user releases a secondary long press after the hold duration. - **onSecondaryTap**: Triggered when the user taps with a secondary pointer (e.g., two-finger tap). - **onSecondaryTapCancel**: Triggered when a secondary tap gesture is recognized but does not complete. - **onSecondaryTapDown**: Triggered when the user first touches the screen with a secondary pointer intending to tap. - **onSecondaryTapUp**: Triggered when the user releases the screen after a secondary tap. - **onTapCancel**: Triggered when a tap gesture is recognized but does not complete successfully. - **onTapDown**: Triggered when the user first touches the screen with the intention of tapping. - **onTapUp**: Triggered when the user releases the screen after a tap. - **onTertiaryLongPress**: Triggered when the user presses and holds with a tertiary pointer (e.g., three-finger press). - **onTertiaryLongPressCancel**: Triggered when a tertiary long press gesture is recognized but does not complete. - **onTertiaryLongPressDown**: Triggered when the user first touches the screen with a tertiary pointer intending to long press. - **onTertiaryLongPressEnd**: Triggered when the user releases a tertiary long press. - **onTertiaryLongPressMoveUpdate**: Triggered as the user moves a tertiary pointer while holding down during a long press. - **onTertiaryLongPressStart**: Triggered when the tertiary long press gesture starts after holding down for the required duration. - **onTertiaryLongPressUp**: Triggered when the user releases a tertiary long press after the hold duration. - **onTertiaryTapCancel**: Triggered when a tertiary tap gesture is recognized but does not complete successfully. - **onTertiaryTapDown**: Triggered when the user first touches the screen with a tertiary pointer intending to tap. - **onTertiaryTapUp**: Triggered when the user releases the screen after a tertiary tap. - **onVerticalDragCancel**: Triggered when a vertical drag gesture is interrupted or canceled. - **onVerticalDragDown**: Triggered when the user first touches the screen and initiates a vertical drag. - **onVerticalDragEnd**: Triggered when the user ends a vertical drag gesture. - **onVerticalDragStart**: Triggered when the user begins a vertical drag gesture. - **onVerticalDragUpdate**: Triggered continuously as the user drags vertically. ### Accessing Gesture Detector Data Gesture detectors not only recognize types of gestures but also provide relevant data based on the trigger. For example, the exact location (XY coordinates) where a drag event occurs. Examples of using gesture data include: - **Custom Slider:** Use the coordinates to update the position of the thumb of a custom slider on its track. - **Interactive Zoom:** Used the data provided by the scale gesture to appropriately zoom in or out. - **Dynamic Interfaces:** Create effects that react to touch, like animations that start from where the user taps the screen. You can access the Gesture Detector data after adding the relevant gesture detector triggers. Once added, you can retrieve this data via the **Set from Variable** menu inside the **Action Flow Editor**. Depending on your specific needs, you can choose from the following options: - **Global Position X**: The x-coordinate of the pointer relative to the left edge of the screen when the gesture was triggered. - **Global Position Y**: The y-coordinate of the pointer relative to the top edge of the screen when the gesture was triggered. - **Local Position X**: The x-coordinate of the pointer relative to the left edge of the widget that has the action triggers applied. - **Local Position Y**: The y-coordinate of the pointer relative to the top edge of the widget that has the action triggers applied. - **Delta X**: The horizontal distance the pointer moved during the gesture. - **Delta Y**: The vertical distance the pointer moved during the gesture. ![access-xy-data](https://docs.flutterflow.io/assets/images/access-xy-data-98437951d7a2304fb0a923c07529b3a3.png) See how to effectively use gesture detector triggers and access XY data in the following example. ### Example: Swipe to delete cart items Let's walk through an example that demonstrates how to implement a "Swipe to Delete" feature for cart items **entirely** using Gesture Detectors. Here's a preview of how it works:

Here’s how you do it: 1. First, we create a variable called `offsetX` to track the horizontal drag distance of the cart item. Since the cart item is displayed in a **ListView** and is built as a reusable component, we'll define `offsetX` as a **component state variable**. This ensures that each cart item independently tracks its own drag position. ![component-state-variable.avif](https://docs.flutterflow.io/assets/images/component-state-variable-207381e4133bc82238588f7e9d023a32.avif) 2. Now, to make the item move as the user drags it, we add a **slide animation** (under **On Action Trigger**) to the Container that holds the item's layout. While configuring the animation, set the **Duration** to 0 and the **Final Position** to the `offsetX` variable. This ensures that the item follows the user's finger as they swipe. :::note We'll trigger this animation every time the user swipes by listening to the `onHorizontalDragUpdate` event (see how to do it in next step). ::: ![add-animation.avif](https://docs.flutterflow.io/assets/images/add-animation-8edbaddf0a8a5d669e5638cf27824b18.avif) 3. On the main Container, we add the `onHorizontalDragUpdate` action trigger. This will called continuously as the user drags the item horizontally. On this event, we update the `offsetX` variable with the new position based on the swipe movement (using **Delta X** Data) and trigger the animation. This real-time update makes the item slide on the screen.

4. Now we need to check if the swipe meets the threshold to delete the item or reset the item's position back to its original location. For that, we add the `onHorizontalDragEnd` trigger. In the `onHorizontalDragEnd` trigger, we check if the `offsetX` value exceeds 100. If it does, we send the item index back to the page or component (via execute callback action) to delete the item from the list. If not, we reverse the slide animation. Lastly, we reset the `offsetX` value to 0 to ensure it's ready for the next interaction.

# Action Blocks > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/functions/action-blocks Learn how to use Action Blocks in your FlutterFlow Studio app to and create reusable actions. An Action Block is a set of actions that perform a specific task and can be reused in different parts of the app. If you find yourself repeatedly performing a particular set of operations in your app, it may be helpful to create an Action Block. This allows you to break down complex actions into smaller, more manageable units, making them easier to understand and modify in the future. Action Blocks have different scopes, which determine their availability: | **Action Block Type** | **Description** | **Scope** | |----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| | **App Level Action Blocks** | Usable across the entire app. You can create an App Level Action Block from any page or component, and it will be accessible for viewing or editing from any page or component as well. | Internally, an App Level Action Block can only access the state variables available in its scope (e.g., app state variables). | | **Page Level Action Blocks** | Restricted to the page in which they were created. These can access the state variables available in their scope, such as page state variables, as well as variables above their scope, such as [App State variables](https://docs.flutterflow.io/resources/data-representation/app-state). | Page Level Action Blocks can access page state variables and App State variables. | | **Component Level Action Blocks**| Restricted to the component in which they were created. These can access the state variables available in their scope, such as component state variables, as well as variables from higher scopes, like page and App State variables. | Component Level Action Blocks can access component state variables, page state variables, and App State variables. | :::note[Unsupported Actions in Action Blocks] Some actions are not supported and cannot be used in an Action Block. By default, these actions are hidden in the Action Block Editor. For example, actions under the **Firebase Authentication** category, **Start Periodic Action**, **Upload Data**, and others. ::: ## Action Blocks Structure When creating an Action Block, the process of defining the flow is similar to **[defining Actions](https://docs.flutterflow.io/resources/functions/action-flow-editor#adding-an-action-example)**. The main difference is in choosing the scope and defining the input & output values of the Action Block. ### Choosing the Scope of Action Block As discussed, Action Blocks can be **App Level, Page Level**, or **Component Level**. App Level Action Blocks can be created from any widget's action properties throughout the app. However, Page Level or Component Level Action Blocks are only available in the Page or Component where they were created. Usually, you will see a dropdown to choose between App Level, Page Level, or Component Level. Choose the scope based on your Action Block's use case. ![action-blocks.png](https://docs.flutterflow.io/assets/images/action-blocks-9d20367e001bf2a5d845ba072d3b36fc.png) ### Action Parameters Action Blocks have access to the state variables available in the same scope as the Action Block (for e.g., Page State variables can be accessed from Page Level Action Blocks). However, there will be times when you may need to input some parameters for the Action Block to perform its logic. These are called **Action Parameters**, and they can be added from the Action Flow Editor when you create a new Action. For example, here is a small demo where we create an Action Block with an input parameter. In this example, we add an item to the wishlist of an e-commerce app. Let's say our local wishlist is saved in an App State variable called `localWishlist`, and we have a reusable Action Block called `addToWishlist` that takes an input parameter called productId and performs the actions to add it to the `localWishlist` object.
### Return Values Often, your Action Block may return a value. For example, in our Product Cart Page, we have a reusable Component Level Action Block called `getTotalCost` that returns the final cost of all the products. You can define such an Action Block that returns a value (e.g., a double for this example) or a value related to your use case. You can define the return value in the Action Flow Editor. Let's see one example.
# Conditional Logic > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/functions/conditional-logic Learn how to implement conditional logic in your FlutterFlow Studio app to control the flow of actions or generate properties based on certain conditions. Conditional logic is a fundamental concept in programming and software development. It involves making decisions in code based on certain conditions. This is achieved using conditional statements, which evaluate expressions to determine whether they are true or false. Depending on the result, different actions or outcomes are executed. #### How Conditional Logic Works - **Condition:** An expression that evaluates to either true or false. - **True Path:** The set of actions to execute if the condition is true. - **False Path:** The set of actions to execute if the condition is false. ![true-false.png](https://docs.flutterflow.io/assets/images/true-false-326377a00a7b1d4e0d107d516594f4cc.png) ## Conditional Flows Conditional flows enhance basic true-false logic by handling multiple conditions and executing specific actions based on those conditions. This is achieved through more complex flows, such as single conditions, multiple conditions (using AND/OR), and conditional values with If/Then/Else logic. ### Single Condition This flow allows you to define a condition based on the comparison of two values, which can be set manually or derived from variables. The condition will return **True** or **False**. **Comparison Operators:** - Equal To - Not Equal To - Less Than - Greater Than - Less Than Or Equal To - Greater Than Or Equal To - Is Set - Is Not Set ![single-condition.png](https://docs.flutterflow.io/assets/images/single-condition-fc718d2facebe1cb7c2137da8dfe8770.png) ### Multiple Conditions (AND/OR) This flow lets you combine multiple single conditions using logical AND or OR operators. It is useful for more complex decision-making processes. ![multiple-condition.png](https://docs.flutterflow.io/assets/images/multiple-condition-8d10635d362ca8204fda8d0de7d56a19.png) ### Conditional Value (If/Then/Else) Conditional Value allows you to set a dynamic variable based on different conditions. For each condition, you can specify a value that will be assigned if the condition is true. A default value can be provided if none of the conditions are met. See the example **[below](#setting-widget-properties-with-conditional-logic).** ## Setting Widget Properties with Conditional Logic FlutterFlow Studio allows you to dynamically set the properties of widgets based on conditional logic. Depending on the expected data type of the property, you can use a combination of conditional flows to achieve your desired logic. Here's an example where we use Conditional Logic to determine the value of a Text widget:
If the `placePicker` widget state is set, then return the placePicker address string. Else, if the `defaultAddress` component parameter is set and not empty, then return that as a string. Otherwise, return a default address value.
## Conditional Actions When you need to execute actions based on specific conditions, you can do so in the Action Flow Editor. By combining simple single conditions or multiple conditions, you can create complex logical flows. These conditions can be configured as learned in the Setting Properties section, allowing your action flows to follow **True/False** logic or **If-Else, If-Else If-Else** structures. Here's a quick demo to illustrate a simple Single Condition Action flow:

You can easily convert a single condition action flow into a multiple condition action flow by enabling the Multiple Conditions toggle. Here's how:
# Loops > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/functions/loops Learn how to implement loops in your FlutterFlow Studio app to iterate over data and perform repeated actions. **Loops** in FlutterFlow Studio allow you to perform repetitive tasks without writing complex code. This is useful when working with lists of data or when you want to repeat actions a certain number of times. There are two types of loops supported in FlutterFlow Studio: ## While Condition Loops A **While Condition** loop requires a condition. The actions within the loop will continue to trigger as long as the condition holds true. When the condition becomes false, the loop terminates, and the next actions in the workflow will trigger. For example, you can use a While Condition loop to continuously check if a user is still within a geofenced area. As long as the condition `isUserInLocation == true` holds, the app might keep checking for updates or show a live indicator. ![loop-block.png](https://docs.flutterflow.io/assets/images/loop-block-fc90ec57a9d391e64cbcebc44df2a956.png) ## Over List This loop type lets you iterate over a list of items to perform actions for each item in the list. For example, if you have a list of items in a shopping cart and want to calculate the total price or apply a discount to each item, you can use Over List to go through each product and perform a calculation for each one. You can also customize how the loop iterates: - **Start Index**: Where the loop starts (default is `0`). - **End Index**: Where the loop ends (default is the length of the list). - **Step Size**: Interval between each iteration (e.g., set to `2` to loop through every second item). - **Reverse Order**: Enables the loop to iterate from the end of the list to the beginning (e.g., showing the latest messages first). ![loop-over-list.avif](https://docs.flutterflow.io/assets/images/loop-over-list-012eca6fedc40882eb110c201b83b898.avif) Inside a loop, you can access the current item and its index. This gives you the ability to work with each item individually, such as displaying item-specific data and making calculations. ![access-item-inside-loop.avif](https://docs.flutterflow.io/assets/images/access-item-inside-loop-e97760677c5d140e18249dacb7b27078.avif) :::tip[Nested Loops] You can also add a loop inside another loop to handle related data structures. For example, looping through orders and then looping through each order’s line items. ::: ## Loop Breaks :::danger[AVOID an INFINITE LOOP] Be careful with loop actions, as they can cause your app to enter an infinite loop if the condition never becomes false. Always ensure that the condition will be met at some point so the loop can exit. ::: If the intended operation is completed before the condition becomes false, you must add a **Loop Break** action in your workflow to exit the loop. **Loop Breaks** are statements used to exit a loop prematurely, before the loop's normal termination condition is met. They are typically used to stop the loop when a certain condition is satisfied, preventing unnecessary iterations and allowing the program to proceed to the next section of actions. **Key Points:** - **Purpose:** Exit the loop immediately when a specific condition is met. - **Implementation:** Typically implemented with the "Add Break" node in Action Flow Editor. - **Usage:** Commonly used to avoid infinite loops or to stop looping once a desired result is achieved. ![loop-block-return.png](https://docs.flutterflow.io/assets/images/loop-block-return-fc9222466eb9481890fbb79e2f5ef4dc.png) # Utility Actions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/functions/utility-actions Learn how to use utility actions to select colors and dates, verify identity, copy text, change themes, and open communication apps. Utility actions let you select colors and dates, request biometric verification, copy text, change the app theme, and open email, phone, or messaging apps. ## Add a Utility Action To add any action described on this page: 1. Select the widget that triggers the action, such as a Button. 2. Open the **Actions** tab in the properties panel and choose an event, such as **On Tap**. 3. Open the **Action Flow Editor**. For the first action, select **+ Add Action**. To add an action to an existing flow, select **+**, then **Add Action**. 4. Search for the action by name and select it. The following sections describe how to configure each action. ## Color Picker [Action] The **Color Picker** action lets users choose a color from a palette or enter a HEX or RGB value. For example, users can choose a product color. ![Color picker with color, hue, and opacity controls.](https://docs.flutterflow.io/assets/images/utility-color-picker-0196d181c2634cf1729300ac657ab3de.png) Add **Color Picker**, then configure these options: - **Initially Selected Color**: Set the color selected when the picker opens. - **Text Color**: Set the primary text color in the picker. - **Secondary Text Color**: Set the color of secondary text in the picker. - **Background Color**: Set the picker's background color. - **Primary Button Background Color**: Set the primary button's background color. - **Primary Button Text Color**: Set the primary button's text color. - **Primary Button Border Color**: Set the primary button's border color. - **Allow Opacity**: Turn this off to allow only opaque colors. - **Show Recent Colors**: Turn this off to hide recently used colors. After the user selects a color, access it through **Widget State > Color Picked**. Use it in a widget's color property or in a subsequent action to update an app state variable or a backend record. ## DateTime Picker [Action] The **Date/Time Picker** action lets users select a date, a time, or both. Use it for appointment times, reminders, or travel dates. ![Date picker showing a calendar for selecting a date.](https://docs.flutterflow.io/assets/images/utility-date-picker-dd3c234d87b4124a51f688d852298128.png) ### Picker Types {#types-datetime-picker} Choose the picker type that matches the value you need: - **Date**: Select a date. - **Date+Time**: Select a date, then a time. - **Time**: Select a time. ### Configure the Picker 1. Add **Date/Time Picker** and set **Date/Time Picker Type** to a [picker type](#types-datetime-picker). 2. Set **Default Date/Time** to choose the initial value. 3. To limit selectable dates, set **Minimum Date/Time** and **Maximum Date/Time**. 4. For the **Date** picker, use **Allow Past Date** and **Allow Future Date** to control whether users can select past or future dates. Explicit minimum or maximum values disable the corresponding option. 5. Use **Dismissible** to control whether users can dismiss the picker by tapping outside it. After the user confirms a selection, access it through **Widget State > Date Picked**. For example, use the value in a Text widget or save it in a subsequent action. ### Customize the Picker Turn on **Use Cupertino-style** for an iOS-style picker. For Material-style **Date** and **Date+Time** pickers, set **Date Entry Mode**: - **Calendar** (default): Select a date from a calendar, with a pencil icon to switch to text input. - **Calendar Only**: Select a date from a calendar without a text input option. - **Text Input**: Type a date, with a calendar icon to switch to the calendar. - **Text Input Only**: Type a date without a calendar option. **Date Entry Mode** is read-only when **Use Cupertino-style** is on and isn't available for the **Time** picker. For **Date+Time**, it applies only to the date step. To customize the appearance, turn off **Use Default Theme**. Expand **Header Properties** and **Date/Time Picker Properties** to configure the header and picker styling. You can also configure these appearance settings: - **Selected Date/Time Background Color**: Set the background color used to highlight the selected date or time. - **Selected Date/Time Foreground Color**: Set the text color used for the selected date or time. - **Action Button Foreground Color**: Set the text color of the picker's action buttons. - **Icon Size**: Set the size of icons in the picker. ## Biometric Verification [Action] The **Biometric Verification** action requests on-device authentication, such as fingerprint or facial recognition. Use the result to decide whether to access sensitive content or perform a protected action. Adding this action doesn't automatically restrict access to your app. Configure the actions that follow it to handle successful and unsuccessful verification. ### Configure Verification 1. Add **Biometric Verification**. 2. To require biometric authentication rather than allowing device credentials, turn on **Allow biometric only**. Otherwise, the device can offer a supported credential, such as a PIN, pattern, or passcode. 3. Enter the **Biometric Reason text** to explain why verification is required. 4. Set an **Action Output Variable Name** to access the verification result in subsequent actions. ### Use the Result 1. Add a conditional action after **Biometric Verification**. 2. Set the condition to the verification result from **Action Outputs**, using the output variable name you configured. 3. In the **TRUE** branch, add the action that requires successful verification, such as opening a page. 4. In the **FALSE** branch, keep the protected action unavailable. You can [**show a snackbar**](https://docs.flutterflow.io/resources/ui/pages/scaffold#snackbar) explaining that verification was unsuccessful. ## Copy to Clipboard [Action] The **Copy to Clipboard** action copies text, such as a message or transaction ID, so users can paste it into another app. 1. Add **Copy to Clipboard**. 2. Set the text to copy. For dynamic content, select the variable that contains the text. Test the action by triggering it and pasting the result into a text field. ## Debug Log [Action] The **Debug Log** action logs a message and values at a specific point in an action flow. Use it to check whether an action runs and inspect the values available at that point. 1. Add **Debug Log** where you want to inspect the flow. 2. Set **Log Level** to the level for the entry, such as **Debug**. 3. Under **Message**, set **Value** to the message to log, such as `Checking selected date`. 4. To include a value, select **Add Value**. Under **Value**, select the variable or value to inspect. Use **Label (optional)** to give it a descriptive name, such as `selectedDate`. 5. Repeat **Add Value** for any additional values you want to inspect. 6. Turn on **Log in Release Builds** if you also need these logs in release builds. Leave it off when the logs are only needed during development. For example, add **Debug Log** after **Date/Time Picker**, set the message to `Checking selected date`, and add **Widget State > Date Picked** as a value with the label `selectedDate`. For instructions on viewing logs while testing in a browser, see [**Opening debug logs**](https://docs.flutterflow.io/troubleshooting#opening-debug-logs). :::tip Avoid logging passwords, access tokens, or other sensitive data, especially when **Log in Release Builds** is on. ::: ## Set Dark Mode Setting [Action] The **Set Dark Mode Setting** action changes the app's theme mode. ### Theme Mode Options {#types-of-dark-mode-setting} Choose one of these settings: - **From System**: Follow the device's light or dark mode preference. - **Light Mode**: Use the light theme. - **Dark Mode**: Use the dark theme. To configure the action: 1. Add **Set Dark Mode Setting**. 2. Choose **From System**, **Light Mode**, or **Dark Mode** as the theme setting. For example, add this action to a theme-selection control so users can choose their preferred mode. ## Send Email [Action] The **Send Email** action opens an email app with a prefilled recipient, subject, and message. The user must send the email; the action doesn't send it automatically. 1. Add **Send Email**. 2. Set **Email Address** to the recipient's email address. 3. Enter the **Subject** and **Body**. ## Call Number [Action] The **Call Number** action opens the phone dialer with a prefilled number. The user must start the call; the action doesn't place it automatically. 1. Add **Call Number**. 2. Set **Phone Number** to the number to dial. ## Send SMS [Action] The **Send SMS** action opens a messaging app with a prefilled phone number and message. The user must send the message; the action doesn't send it automatically. 1. Add **Send SMS**. 2. Set **Phone Number** to the recipient's number. 3. Enter the message in **SMS Body**. # Forms Overview > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms Learn how to work with Forms in FlutterFlow Studio app. Forms are a fundamental part of many applications, serving as the primary method for users to input and submit data. Whether you're building a simple contact form or a complex multi-step survey, FlutterFlow Studio provides a comprehensive set of tools to create, validate, and manage forms effectively. :::tip In this section, you'll learn how to add form widgets such as [**TextField**](https://docs.flutterflow.io/resources/forms/textfield), [**Dropdown**](https://docs.flutterflow.io/resources/forms/dropdown), [**RadioButton**](https://docs.flutterflow.io/resources/forms/radiobutton), [**Checkbox Widgets**](https://docs.flutterflow.io/resources/forms/checkbox) and add [**Validations**](https://docs.flutterflow.io/resources/forms/form-validation) and [**set**](https://docs.flutterflow.io/resources/forms/set-form-field)/[**reset**](https://docs.flutterflow.io/resources/forms/reset-form-field) actions on these widgets. ::: # Checkbox > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/checkbox Choose and configure a Checkbox, CheckboxListTile, or CheckboxGroup widget in FlutterFlow Studio. Choose a widget based on what users need to select: - [**Checkbox**](#checkbox-1): Use a standalone checkbox for one yes-or-no choice. - [**CheckboxListTile**](#checkboxlisttile): Use a checkbox with a title and an optional subtitle, such as a notification preference. - [**CheckboxGroup**](#checkboxgroup): Let users select any combination of options from a list.
Three checkbox variants: a standalone checkbox, a notification setting with a title and subtitle, and a toppings list with two options checked.
## Checkbox {#checkbox-1} Use **Checkbox** for a single Boolean value, such as whether to include a gift receipt. ### Adding Checkbox Add a **Checkbox** from **Base Elements** or search for it in the widget tree's **Add Widget** menu. To use the checked or unchecked value, open **Set from Variable** on the property or action input that needs it. Select **Widget State**, then select your Checkbox widget's value. For example, bind the value to a [**Text**](https://docs.flutterflow.io/resources/ui/widgets/text) widget to display it. ### Setting Initial Value In the properties panel, use **Checkbox Initial Value** to choose whether the checkbox starts checked or unchecked. To set it dynamically, select **Set from Variable** and choose a Boolean value, such as a Firestore field. ### Saving Checkbox Value To save the value when it changes, add a save action under [**On Toggled On** and **On Toggled Off**](https://docs.flutterflow.io/resources/forms/form-triggers#on-toggled-on--on-toggled-off). Use **On Toggled On** for the checked state and **On Toggled Off** for the unchecked state. ### Customizing Select the **Checkbox** widget and open **Checkbox Properties** in the properties panel. #### Changing color - **Checked Color**: Set the fill color when the checkbox is checked. - **Check Border Color**: Set the color of the checkbox outline. - **Check Color**: Set the color of the check mark. #### Add rounded corners Use **Border Radius** to round the corners. Lock the values to adjust all four corners together, or unlock them to adjust each corner separately. #### Make it circular Turn on **Circular Check** to display a circular checkbox. #### Adjust density Use **Density** to choose how compact the checkbox is. Select **Dense**, **Padded**, or **Platform Default**. #### Disable Checkbox Turn on **Checkbox Disable Options**, select **Unset**, and [set a condition](https://docs.flutterflow.io/resources/functions/conditional-logic). When the condition evaluates to `true`, users can't change the checkbox. For example, disable **Same as shipping address** when the shipping address is empty. Use **Disabled Check Color** to set the check color in the disabled state. ## CheckboxListTile Use **CheckboxListTile** when a checkbox needs a title and an optional subtitle in the same row. For example, use *Email updates* as the title and *Get a weekly summary* as the subtitle. 1. Add a **CheckboxListTile** widget to your page. 2. Select it and expand **Title** in the properties panel to enter the label. Expand **Subtitle** if the choice needs more context. To use the checked or unchecked value, select it from [**Widget State**](https://docs.flutterflow.io/concepts/state-management/widget-state). To run an action when the value changes, use [**On Toggled On** or **On Toggled Off**](https://docs.flutterflow.io/resources/forms/form-triggers#on-toggled-on--on-toggled-off). ### Customizing CheckboxListTile Select the **CheckboxListTile** widget and use these settings in the properties panel: - **Checkbox Initial Value**: Choose whether the checkbox starts checked or unchecked, or use **Set from Variable** to supply a Boolean value. - **Tile Color**: Set the background color of the tile. - **Checked Color** and **Unchecked Color**: Set the checkbox colors for the checked and unchecked states. - **Check Color**: Set the color of the check mark. - **Content Padding**: Adjust the space around the tile's contents. - **Border Radius**: Round the corners. - **Circular Check**: Display a circular checkbox. - **Dense**: Make the tile more compact. - **Leading**: Place the checkbox before the title and subtitle rather than after them. - **Checkbox Density**: Adjust the compactness of the checkbox itself. - **Checkbox Disable Options**: Set a condition that prevents users from changing the checkbox when it evaluates to `true`. ## CheckboxGroup Use **CheckboxGroup** when users can select multiple options independently, such as toppings on an order. ### Adding CheckboxGroup Add **CheckboxGroup** from **Form Elements**, or search for it in the widget tree's **Add Widget** menu. Then choose how to supply the options: - **Enter options manually.** In **Define Options**, edit **Option 1**, then select **Add Option** for each additional option. Use the remove icon next to an option to delete it. - **Load options from a variable.** In **Define Options**, select **Set from Variable** and choose a source for the option labels, such as an app state variable or API response. ### Using Selected Options When a property or action input needs the selected options, open **Set from Variable** and select **Widget State**. Choose the CheckboxGroup widget's value and use it where a list of selected options is expected. ### Trigger Action on Change To run an action when the selection changes, add it under the [**On Selected** trigger](https://docs.flutterflow.io/resources/forms/form-triggers#on-selected). ### Setting Initial Selection 1. Select the **CheckboxGroup** widget and open **Initially Selected** in the properties panel. 2. Select **Add Selected** and enter the option label exactly as it appears in the list. 3. Repeat for each option that should start selected. ### Clear/Select all items [Action] Use **Clear All/Select All** to clear the selection or select every option, such as when a user taps a reset button. 1. Select the widget that should trigger the action, such as a **Button**, and open **Actions**. 2. Choose the trigger, such as **On Tap**, and add **Clear All/Select All** under **Widget/UI Interactions**. 3. In **Choose Multiselect Widget**, select the **CheckboxGroup** widget to update. 4. Set **Action Type** to **Clear All** or **Select All**. ### Customization Select the **CheckboxGroup** widget to find its settings in the properties panel. #### Disable CheckboxGroup Use **Disable** to prevent users from changing the selection. #### Set padding around the checkbox Use **Item Padding** to control the space around each option. Lock the padding values to adjust all sides together, or unlock them to adjust each side separately. #### Changing checkbox color In **Checkbox Style**, use **Checked Color** for the fill of a checked box and **Check Color** for its check mark. See [Change Color](https://docs.flutterflow.io/resources/ui/widgets/widget-commonalities#change-color) for ways to choose a color. #### Customizing checkbox border In **Checkbox Style**, use **Check Border Color** to set the outline color and **Border Radius** to round the corners. Lock the radius values to adjust them together, or unlock them to adjust each corner separately. #### Style the option labels In **Label Style**, use **Label Padding** to adjust the space around each option label. Use **Checked Label Text Style** and **Unchecked Label Text Style** to style the labels separately for each state. Both sections have the same controls: - **Theme Text Style**: Choose a text style from your theme. - **Font Family**, **Font Weight**, **Font Size**, and **Text Color**: Customize the font and color. - **Line Height**, **Letter Spacing**, and **Text Align**: Adjust spacing and alignment. - **Shadows**: Select **Add Shadow** to add a text shadow. - **Text Overflow Replacement**: Choose how to display text that doesn't fit. # ChoiceChips > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/choice-chips Learn how to configure ChoiceChips, use selected values, and customize chip styles in your FlutterFlow Studio app. The ChoiceChips widget lets users select one option or, with multiselect enabled, multiple options from a group of chips. Each chip has a text label and can include an icon. For example, use ChoiceChips in a shopping app to let users filter products by size or color. Size filter chips with Medium selected in single-selection mode and Medium and Large selected in multiselect mode. :::tip[Widget State] Access form selections through [**Widget State**](https://docs.flutterflow.io/concepts/state-management/widget-state). ::: ## Adding a ChoiceChips Widget {#adding-choicechips-widget} To add the ChoiceChips widget to your app: 1. Add the **ChoiceChips** widget from the **Form Elements** tab. 2. In the properties panel, open **Define Options**. Edit the default **Option 1** label and choose an icon if needed. 3. Select **Add Option** to add each additional choice, then set its label and optional icon. 4. To select a chip initially, set **Initial Option** to an option's label. To set the value dynamically, use **Set from Variable**. When [multiselect](#allow-multiselect) is enabled, you can specify multiple initial selections.

## Use the Selected Values Use the ChoiceChips widget's state to access its selection: 1. Open **Set from Variable** for the property or action input that needs the selection. 2. Select **Widget State**, then select your ChoiceChips widget's value. 3. Use the selected option for single selection, or the selected options for multiselect. For example, use the selection to filter a product list or update an app state variable. Choose a destination that accepts the widget's selection format. ## Trigger Action on Change To respond to a selection change, select the **ChoiceChips** widget, open **Actions**, and add actions under **On Selected**. For example, update an app state variable with the selection, then use it to filter products. See [form action triggers](https://docs.flutterflow.io/resources/forms/form-triggers#on-selected). ## Select or Clear All Choices [Action] Use **Clear All/Select All** to select every option or clear the selection, such as when users select a reset button. :::note Before you add this action, ensure you [**allow multiselect**](#allow-multiselect) on this widget. ::: 1. Select the widget that triggers the action, such as a Button, and open **Actions**. 2. Choose an event, such as **On Tap**, and add the **Clear All/Select All** action. 3. In **Choose Multiselect Widget**, select the ChoiceChips widget to update. 4. Set **Action Type** to **Clear All** or **Select All**. ## Customizing Select the **ChoiceChips** widget to customize its selection behavior, layout, and styles in the properties panel. ### Allow Multiselect Turn on **Allow Multiselect** to let users select more than one chip. ### Require Selection Turn on **Require Selection** to require users to select at least one option. ### Layout Choose a **Layout Type**: - **Wrap**: Move chips to the next row when they don't fit. - **Row**: Keep all chips on a single horizontal row without wrapping. #### Chip Spacing {#adding-space-between-chips} Use these properties to control the gaps between chips: - **Chip Spacing**: Set the horizontal gap between chips in the same row. - **Row Spacing**: For **Wrap**, set the vertical gap between rows of chips. #### Align Chips Use **Alignment** to position chips within each row, such as aligning them to the start or center. ### Disable ChoiceChips To show the chips without letting users change the selection, set a condition for **Disable**: 1. Select the **ChoiceChips** widget. 2. In the properties panel, turn on **Disable**, then click **Unset**. 3. Set a [single condition](https://docs.flutterflow.io/resources/functions/conditional-logic#single-condition) or [combine multiple conditions](https://docs.flutterflow.io/resources/functions/conditional-logic#multiple-conditions-andor). Users can change the selection only when the condition evaluates to `false`. ### Selected and Unselected Chip Styles {#customizing-selected-and-unselected-chip-style} Expand **Selected Chip Style** or **Unselected Chip Style** to customize how chips look in each state. # Dropdown > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/dropdown Learn how to add Dropdown widget in your FlutterFlow Studio app. The DropDown widget enables users to choose from a list of options. It requires a set of items to display and an initial value to indicate the current selection. When a user selects an item from the dropdown list, the value is updated to reflect the selected item. You can use this widget in any situation where you want users to select from a set of options, such as selecting a country, choosing a language, or picking a color. :::tip[Widget State] Before diving into form widgets, check out our guide on [**Widget States**](https://docs.flutterflow.io/concepts/state-management/widget-state) to efficiently manage the state and behavior of your form elements. ::: ## Adding DropDown widget Let's see how to add a *DropDown* widget and build an example that shows the selected value on a Text widget. Here's how it looks:

1. Add the **DropDown** widget, move to the **Properties Panel > Define Options >** click **Add Options** to add items. 2. To display the default value, move to the **Initial Configuration** section and enter the value. Ensure it matches one of the options added in the previous step. 3. The selected dropdown value can be accessed via *Widget State > DropDown*. To display it on the *Text* widget, add a [**Text**](https://docs.flutterflow.io/resources/ui/widgets/text) widget, move to the properties panel, click on **Set from Variable** and choose the **Widget State > DropDown** (i.e., name of your dropdown).

### Setting Initial Value Setting a default or initial value for the DropDown is a common requirement for many apps. It can provide a better user experience by pre-selecting the most likely option. To set an initial value: 1. Select the **DropDown** widget > move to the **Properties Panel** > **Initial Configuration**. 2. In **Initial Option Value**, enter the option name that you want to set as default. 3. To set this value dynamically, open the **Set from Variable** menu and select the variable. 1. For example, to set this value from Firebase, ensure you have access to Firebase document that contains the field you want to set. 2. Open the **Set from Variable** menu > select **[collection_name] Document** > select the **field**. 4. If you don't set the initial value, the **Hint Text** will be displayed.

### Saving DropDown Value on Selection Change You might want to save the dropdown value as soon as the selection changes. This approach is useful when you want to ensure that the user's selection is immediately saved without having to wait for them to submit the form. By doing so, you can provide a better user experience and reduce the risk of data loss in case of any interruption. You can do so by adding an action such as [update app state](https://docs.flutterflow.io/resources/data-representation/app-state#update-app-state-action), [update Firestore record](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-actions#update-document-action) that [triggers when a selection changes](https://docs.flutterflow.io/resources/forms/form-triggers#on-selected) on this widget. ## Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. ### Showing Option Label The dropdown widget allows you to show a label than the actual option value. By adding the option label, you can have a simple/short name or abbreviation (which is quite easy to compare and process in the backend) instead of a tricky name (e.g., Falkland Islands (the) [Malvinas]). For example, In a Country dropdown, you could have different *Option* *Values* to store in the backend and *Option Labels* to show in the dropdown list. Just like below: | Option Values | Option Labels | | --- | --- | | US | United States | | IN | India | | FK | Falkland Islands (the) [Malvinas] | To show option label: 1. Select the **DropDown** widget, move to the properties panel, and turn on the **Add Option Labels** toggle. 2. Enter the value in the **Define Option Values** and **Define Options Labels**. Click **Add Option** (below the *Define Option Values*) to add more values and labels. 3. You must also set the **Data Type** for the values. For example, if the values you are going to store are in numbers like 1,2,3, set it to *Integer*.

### Searchable Dropdown The *DropDown* widget is a good choice when you have a small number of options, up to around 10-20; however, If you have more options than that, consider using a searchable dropdown. A searchable dropdown allows users to search and filter options by typing in a search bar. As the user types, the dropdown list is dynamically filtered to only show matching options. This is especially useful when dealing with long lists of options and can improve the user experience by reducing the time it takes to find and select an option.

To make the dropdown widget a searchable one: 1. Select the **DropDown** widget, move to the **Properties Panel > DropDown Search >** enable **Is Searchable** option. 2. You can also customize the **Search Hint Text** property. ![Making dropdown searchable](https://docs.flutterflow.io/assets/images/making-dd-searchable-f1de9e328ba77af1b6c50fbb028e23b0.png) ### Disable Dropdown You might need to disable a dropdown when certain conditions are not yet met or need to be fulfilled. For example, when the dropdown options are dependent on other fields, and those fields are not filled yet.

To disable the dropdown: 1. Select the **DropDown** widget, move to the **Properties Panel > DropDown Search >** enable **Disable Dropdown** option. 2. Click on **Unset** and select the source that returns the boolean value (i.e., True or False), such as boolean variable, [Conditions](https://docs.flutterflow.io/resources/functions/conditional-logic), [Inline Function](https://docs.flutterflow.io/resources/functions/utility#inline-function-code-expressions). ![Disabling dropdown](https://docs.flutterflow.io/assets/images/disabling-dropdown-05e5d82e8c412f1ae7cc909623b9e693.png) ### Allow Multi Select You might want to allow users to select multiple options from the dropdown list. For example, on an e-commerce app, users might want to filter products based on multiple attributes, such as t-shirts in both 'blue' and 'red' colors. To allow multi-select, select the **Dropdown** widget, move to the properties panel, find the **Allow Multi Select** property, and enable it. :::note To clear the selection, you can use the [Reset Form Fields](https://docs.flutterflow.io/resources/forms/reset-form-field) action and choose the **Reset Dropdown Fields** option. Then, simply select the name of the dropdown widget you wish to reset. :::

### Changing Dropdown Size To change the height and width of the dropdown, select the **DropDown** widget, move to the **Properties Panel > DropDown Properties > enter the Width and Height value**. ### Set Max Height If needed, you can also control the dropdown height using the **Max Height** property.

### Adding Margin Margin adds a space between the DropDown's text and its border. To change the margin, select the **DropDown** widget, move to the **Properties Panel > DropDown Properties >** find the **Margin** property, and change the values.

### Changing Background Color To change the background color, move to the **Properties Panel > DropDown Style > set the Fill Color**. ![Changing background color](https://docs.flutterflow.io/assets/images/changing-background-color-2522beea0239fb73d5746b2a33cb77ac.png) ### Changing Menu Elevation Menu elevation adds a shadow to the dropdown, giving it a sense of depth and making it appear above the surface it is placed on. To change the menu elevation (depth or Z-axis), move the **Properties Panel >** enter the **Menu** **Elevation** value. :::note The higher value draws the bigger size of the shadow. ::: ### Adding Border See how to [add a border](https://docs.flutterflow.io/resources/ui/widgets/widget-commonalities#adding-border). ### Show/hide Underline To show or hide the dropdown underline, move the **Properties Panel >** **DropDown Style** > use the **Hides Underline** toggle.

### Fix Position By default, the dropdown options are displayed over/above the dropdown button. To display beneath/below the button, move the **Properties Panel >** **DropDown Style** > switch on the **Fix Position** toggle. ![Fix position for dropdown options](https://docs.flutterflow.io/assets/images/fix-position-44942cedca06778938f5864d54a1a709.webp) # RadioButton > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/radiobutton Learn how to add RadioButton widget in your FlutterFlow Studio app. The RadioButton widget is used to allow a user to select one option from multiple selections. You can use the **RadioButton** widget for implementing a single selection such as gender selection, notification preferences, etc. :::tip[Widget State] Before diving into form widgets, check out our guide on [**Widget States**](https://docs.flutterflow.io/concepts/state-management/widget-state) to efficiently manage the state and behavior of your form elements. ::: ## Adding RadioButton to Your Project Here's an example of how you can use the RadioButton widget in your project: 1. First, drag the **Column** widget from the **Layout Elements** tab (in the Widget Panel) or add it directly from the widget tree. Set its **Cross Axis Alignment** to **Stretch**. 2. Now add the **RadioButton** widget from the **Form Elements** tab or add it directly from the widget tree. :::note The RadioButton widget adds a single option named **Option 1** by default. :::

### Trigger Action on Change See how to [trigger an action when a selection changes](https://docs.flutterflow.io/resources/forms/form-triggers#on-selected) on this widget. ### Changing Option Name To change the name of the option: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Define Options** section. 3. Find the **Option 1** property and change the **name**.

### Adding or Removing Option To add or remove an option from the RadioButton: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Define Options** section. 3. Click on the **Add Option** text. 4. Enter the name in **Option 2 Text**. 5. To remove the option, simply click on the cancel icon () displayed in the **Option name** property.

### Setting Initial Option When you run the app, no option is selected by default. To set the initial option: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Initial Option** property. 3. Enter the **name** of the option. For example, entering a value as **Jupiter** will show the second option selected on running the app.

### Styling Selected Option To change the text style of the selected option: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Radio Button Text Style** section. 3. Checkmark the **Change Selected Text Style**. (Click on it) 4. Under the **Radio Button Selected Text Style** section, change the text style.

## Retrieving RadioButton Selection Let's build an example of showing the selected option in a Text widget.

:::note For simplification purposes, the selected option is shown in the Text widget. In a real-world scenario, you may pass the RadioButton selection to your Backend (Firestore Database/API call). ::: To retrieve the user's selection: 1. Add the [**Text**](https://docs.flutterflow.io/resources/ui/widgets/text) widget to your page. 2. Move to property editor and click on the **Set from Variable** text. (This will open a new panel) 3. Set the **Source** to **Widget State**. 4. Set the **Available Options** to **RadioButton**. 5. (Optional) Set the default value if you wish to. 6. Click **Save**.

## Changing the Properties The Properties Panel can be used to customize the appearance and behavior of your widget. ### Changing Options Height To change the height of all options: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Radio Button Properties** section. 3. Enter the desired height into the **Option Height** box.

### Adding Space Around Option Text To add some space around the option text: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Radio Button Properties** section. 3. Find the **Margin** property and enter the values. 4. Click on the Refresh icon to reset the values. :::note Use the Lock button to change the Left, Top, Right and Bottom padding all at the same time. Unlocking will allow you to modify each value separately. :::

### Showing Options Horizontally By default, all options are shown as if they were inside the Column widget. Using *Axis* property, you can change this behavior to display all options horizontally as if they are inside the Row widget. To display all options horizontally: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Radio Button Properties** section. 3. Find the **Axis** property, change it to **Horizontal**.

### Aligning Options Changing the alignment will change how the options are distributed in the horizontal space. To change the option alignment: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Radio Button Properties** section. 3. Find the **Alignment** dropdown and select from the options displayed that include Start, Center, End. 4. If the **Axis** property is set to **Horizontal**, you will see options that include Start, Center, End, Space evenly, Space between, and Space around.

### Changing Button Position If you want to display the button on the opposite side of the option text i.e right side, you can do so using the *Button Position* property. To change the button position: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Radio Button Properties** section. 3. Find the **Button Position** property, change it to **Right**.

### Styling Radio Button To change the color of selected and unselected options: 1. Select **RadioButton** from the widget tree or from the canvas area. 2. Move to the Property Editor (on the right side of your screen) and scroll down to the **Radio Button Properties** section. 3. Find the **Selected Color** property, click on the box next to **Unset**, select the color, and then click **Use Selected Color** or click on **Unset** and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button. 4. Find the **Unselected Color** property, click on the box next to **Unset**, select the color, and then click **Use Selected Color** or click on **Unset** and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button.

# Switch Widgets > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/switch Learn how to add Switch and SwitchListTile widget in your FlutterFlow Studio app. In FlutterFlow Studio, **Switch** widgets provide an intuitive way for users to toggle between two states, such as on/off or enabled/disabled. They are useful for settings, preferences, and other scenarios where a simple binary choice is required. FlutterFlow Studio offers two primary switch widgets: [**Switch**](#switch) and [**SwitchListTile**](#switchlisttile). Each of these widgets provides unique features and use cases, making it easy to incorporate toggle functionality into your app's interface. ## Switch The **Switch** widget is a straightforward toggle switch. It consists of a sliding button that can be moved between two positions, indicating an on/off state. You can customize the appearance and behavior of the switch, such as its color, and initial state (whether it starts as on or off). ### Adding Switch Let's see how to add a switch widget and build an example that shows its value on a Text widget. Here's how it looks:

Here is a simple way to do it: 1. First, click on the **+ Add Widget**, drag the **Switch** widget from the **Base Elements** tab, or add it directly from the widget tree. 2. Below the Switch, add a [**Text**](https://docs.flutterflow.io/resources/ui/widgets/text) widget, move to the properties panel, click on **Set from Variable** and choose the **Widget State > switchValue** (i.e., name of your switch).

### Setting Initial Value You might want to show the switch with a default status, i.e., ON or OFF. For example, showing the location service setting with a default switch OFF. To set the initial value: 1. Select the **Switch** widget, move to the properties panel, and see the **Switch Initial Value** property. 2. Use the checkbox to set this value manually, or click **Set from Variable** to set it based on the dynamic value. If you choose *Set from Variable*, ensure you pass the boolean value from the source (e.g., API response, Firestore document field).

### Saving Switch Value You may want to save the switch value as soon as it is toggled ON or OFF. To do this, [add an action using the trigger](https://docs.flutterflow.io/resources/forms/form-triggers#on-toggled-on--on-toggled-off) that responds to changes in the widget’s selection. ### Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. #### Changing color To change the switch colors, select the **Switch** widget, move to the properties panel, and scroll down to the **Switch Properties** section. Here you can [change the color](https://docs.flutterflow.io/resources/ui/widgets/widget-commonalities#change-color) for the following properties: - **Active Color**: The color of the thumb (circle) when the switch is ON. - **Active Track Color**: The color of a track (the line over which the circle slides) when the switch is ON. - **Inactive Track Color**: The color of a track (the line over which the circle slides) when the switch is OFF. - **Inactive Thumb Color**: The color of the thumb (circle) when the switch is OFF. #### Disable switch You may need to disable a switch if certain conditions aren't met. For instance, users should only be able to toggle the switch when the connected smart device is operational. To disable a switch, move to the **Properties Panel** **>** turn on the **Switch Disable Options >** click **Unset,** and set the [**Condition**](https://docs.flutterflow.io/resources/functions/conditional-logic). Once set, you could also customize the disabled state colors using the *Disabled Active Color, Disabled Active Track Color, Disabled Inactive Track Color,* and *Disabled Inactive Thumb Color* properties.

## SwitchListTile The **SwitchListTile** widget combines the functionality of a switch with a **[ListTile](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#listtile-widget)**, providing a more comprehensive option for displaying toggle switches alongside additional information. This widget includes a switch, a title, and an optional subtitle, all within a single, cohesive element. SwitchListTile is ideal for use cases where you want to provide more context or descriptive text alongside the switch, such as in a settings menu or a form with detailed options. ### Adding SwitchListTile Here's an example of how you can use a SwitchListTile widget in your project: 1. Drag the **SwitchListTile** widget from the **Base Elements** tab and drop it inside the **Column**. 2. By default, the switch is enabled initially. 1. To turn it off, move to the properties panel, and **uncheck** the **Switch Initial Value** property. 2. To set its value based on the variable (e.g. app state variable, API response), move to the properties panel, click on the **Set from Variable** and choose the **Source**. 3. To set the title, scroll down to the **Title** section and change the **Text** property. 4. Similarly, scroll down, find the **Subtitle** section, and change the **Text** to add the description.

### Setting Platform Type You can set the platform type to *Adaptive or Android* for this widget. Selecting the Adaptive type will display the widget in its native style. That means the widget will show iOS-style rendering when running on iOS devices and Android-style rendering when running on Android devices. To set the platform type: 1. Select the **SwitchListTile** widget from the widget tree or the canvas area. 2. Move to the properties panel and open the **Platform** section. 3. Set the **Platform Type** among the **Adaptive** or **Android**.

### Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. #### Changing switch color To change the switch color: 1. Select **SwitchListTile** from the widget tree or the canvas area. 2. Move to the Properties panel and scroll down to the **Switch List Tile Properties** section. 3. To change the color of the thumb (sliding circle), find the **Thumb Color** property and click on the box next to the already selected color, select the color, and then click **Use Color** or click on the already selected color and enter a Hex Code directly. 4. To change the color of the track (the line over which the circle slides), find the **Track Color** property and click on the box next to the already selected color, select the color, and then click **Use Color** or click on the already selected color and enter a Hex Code directly.

#### Showing switch at the start To make the switch appear before the title: 1. Select **SwitchListTile** from the widget tree or the canvas area. 2. Move to the Properties panel and scroll down to the **Switch List Tile Properties** section. 3. Scroll down and checkmark the **Leading** property (click on it).

# TextField > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/textfield Learn how to add TextField widget in your FlutterFlow Studio app. The TextField widget allows users to enter text, numbers, and symbols in your app. You can use the TextField widget to build forms, send messages, dialogs, search, etc. :::tip[Widget State] Before diving into form widgets, check out our guide on [**Widget States**](https://docs.flutterflow.io/concepts/state-management/widget-state) to efficiently manage the state and behavior of your form elements. ::: ## Adding TextField Widget Let's see how to add a TextField widget and see an example of displaying its value in an Alert Dialog.

Here are the steps: 1. First, add the TextField widget, move to the properties panel and give it a name. 2. Add the [**Button**](https://docs.flutterflow.io/resources/ui/widgets/button) widget and on tap of it, add an Alert Dialog action. While adding this action, provide the Message **From Variable > Widget State > [TextFieldName]**.

## Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. ### Changing Width By default, the TextField widget takes all the available space in the horizontal direction. You might want to limit its width to match your design. See how to change the width of this widget. ### Adding Multiline/auto Expand Support By default, a TextField is only one line. So when you type in a long text that won't fit in one line, you'll be able to see an entire message using a horizontal scrollbar. You can change this default behavior and show the full message (without a horizontal scrollbar) by making the TextField multiline/auto-expand. To make a TextField multiline/auto-expand, move the **Properties Panel *>*** find the **Max Lines** and **Min Lines** properties. 1. To make the TextField auto-expand as long as its parent allows, remove the **Max Lines** value and set the **Min Lines** to **1**. 2. To make the TextField auto-expand up to a few lines and then show a vertical scrollbar to see the full message, set **Max Lines** to a value up to which you like to show an entire message (e.g., 3,5) and **Min Lines** to **1**.

### Setting Prefilled Value You might want to display a TextField with some initial value. This can be any specific value such as "*What are you looking for*", "*Input your Email*", or a value from any variable. To set the initial value, move to the **Properties Panel > TextField Properties > Initial Value** and enter the specific value or *Set from Variable*. ![setting-prefilled-value](https://docs.flutterflow.io/assets/images/setting-prefilled-value-c47b24e1996e7de1532b8b69333d6444.avif) ### Adding Label Showing a label helps users understand what should be entered into the TextField. If you don't have an initial value set, the *Label Text* will appear as full size in the TextField. Once the user taps the TextField, the *Label Text* will become smaller, and the *Hint Text* will appear. To set the label, move to the **Properties Panel > Label Properties >** enter the **Label Text**. ![adding-label](https://docs.flutterflow.io/assets/images/adding-label-902c402214265f2a53df93b3547b6c10.avif) When the TextField is set to [Multiline](#adding-multilineauto-expand-support) the label appears in the center. To get it closer to the hint text, switch on the **Align Label With Hint** property.

### Setting Hint Text Showing a hint text helps users know what information is needed to enter into the TextField. For example, showing hint text as "Enter Your Email Here" clearly informs the user to enter their email. To set the hint text, move to the **Properties Panel > Hint Properties > enter the Hint Text**. ![setting-hint-text](https://docs.flutterflow.io/assets/images/setting-hint-text-ea03c449e2bd46fc47082cf5b62a51b3.avif) ### Decorating TextField Various properties under the *Input Decoration Properties* allow you to customize the TextField to match your design. ### Changing TextField Background Color To change the background color, move to the **Properties Panel > Input Decoration Properties >** enable **Filled >** set the **Fill Color**.

### Adding Border Here's an example of how you can add a border around the TextField: 1. Select TextField widget, move to the **Properties Panel > Input Decoration Properties > select the Input Border Type**. 1. Choose **Outline** to place a border around the entire field. 2. Choose **Underline** to place a border only on the bottom of the field. 3. Choose **None** to completely remove the border. 2. You can also set a color to the border for various states, such as when TextField is in a *Focused* or *Error* state. To do so, use the **Border Color**, **Focused Border Color**, and **Error Border Color**. 3. To increase the border thickness, use the **Border Width** property. 4. To create the rounded border, use the **Border Radius** property. By default, any value your enter will be set for all corners, which are TL (Top left), TR (top right), BL (bottom left), and BR (bottom right). Click on the lock icon to change each corner separately. Use the refresh icon to reset the values.

### Add Content Padding Content Padding adds space between the test and the border of your TextField. To add content padding, move to the **Properties Panel > Input Decoration Properties >** enter the **Content Padding** value.

### Reducing TextField Height To reduce TextField's height to as minimum as possible, select the TextField widget, move to the **Properties Panel >** enable the **Dense** property.

### Changing Error Message Styling You can also change the text styling for the error message. To do so, head over to **Properties Panel > Input Decoration Properties >** enable **Custom Error Style** and [change the text styling](https://docs.flutterflow.io/resources/ui/widgets/text#common-text-styling-properties). ![changing-error-message-styling](https://docs.flutterflow.io/assets/images/changing-error-message-styling-007121650f2b27c1d1bbe4fba7422883.avif) ### Adding Icon You might want to add an icon inside the TextField, either at the start or end. You can do so using the *Leading* and *Trailing* Icon property. To add a leading or trailing icon, move to the **Properties Panel >** find the **Leading** and **Trailing Icon** property > Click on the **None** button **>** search and select the icon. You can also [customize the icon's size and color](https://docs.flutterflow.io/resources/ui/widgets/icons#common-icon-properties). ![adding-icon](https://docs.flutterflow.io/assets/images/adding-icon-95bb6492fecbd52ce05440bc093e7a75.avif) ### Using TextField for Passwords To make a TextField a Password Field, move to the **Properties Panel > Additional Properties >** enable the **Password Field**. When you enter a password, it will be obscured with the dot (•). You can see and confirm the entered password by clicking on the **Toggle Hide Password Icon**. You can also customize its size and color. ![textfield-for-passowrd](https://docs.flutterflow.io/assets/images/textfield-for-passowrd-6b3f53f88dfc032e449d8199f664e528.avif) ### Clear TextField A clear field icon inside the TextField allows the users to quickly remove the entered text. To clear a TextField, move to the **Properties Panel > Additional Properties >** enable the **Show Clear Field Icon**. You can also customize the icon's color and size.

#### Adding Clear Text Fields/Pin Codes [Action] This action lets you clear the values from single or multiple TextField and PinCode widgets. This comes in handy while implementing a form inside your app, and you want to let the user reset the form with one click. Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., IconButton, Button, etc.) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu), click **+** **Add Action** button. 3. Search and select the **Clear Text Fields/Pin Codes** (under *Widget/UI Interactions*) action. 4. Select the *TextFields* and *PinCode* widgets you want to reset. ![adding-clear-textfield-action](https://docs.flutterflow.io/assets/images/adding-clear-textfield-action-10eaab0d9d431d61dfa1c0c8308015bc.avif) ### Autofocusing TextField When you autofocus a TextField, it mimics the tap event and immediately shows the keyboard. This makes TextField ready to receive input from you without having you click on TextField. To autofocus a TextField, select the TextField widget, move to the **Properties Panel** **> Additional Properties >** enable the **Autofocus** property.

### Enable Interactive Selection The **Enable Interactive Selection** toggle controls whether users can interact with the text selection features, such as long-press selection, copy/paste menus, and selection handles. By default, this property is set to **True**, allowing users to select, copy, and paste text using the platform's built-in text selection controls. Disabling this can help prevent unintended text copying or editing, especially in sensitive fields. ![interactive-selection](https://docs.flutterflow.io/assets/images/interactive-selection-323dae6cef2a9187fe13cfa47857e9a5.avif) ### Autocomplete a TextField You might want to allow users to enter the text by suggesting them a list of items. The suggested items are shown if it contains the currently entered text from TextField. For example, using autocomplete to get the *Country* *name*, *Fruit* *name*, etc. :::note This helps avoid spelling mistakes and enhances the user experience as users won't have to enter the complete text. ::: To autocomplete a TextField, select the TextField widget, move to the **Properties Panel** **> Additional Properties >** enable the **Autocomplete** property. Now you can customize the autocomplete using the **Autocomplete Properties** section. Here's how you do it: 1. Inside the **Autocomplete Options**, click **Add Option** and provide item names that you would like to appear in the suggestion box. 2. You can also **Set from Variable** to show items from any variable, such as app state variable, API response, and Firestore collection. :::note If you *Set from Variable* and run the app in preview mode, you can try entering the country name. The list will be populated with matching countries. :::

3. You can also customize the appearance of the suggestion box using properties such as **Height**, **Elevation**, **Background Color**, and **Highlight Color** (highlighting the currently selected option in the dropdown list). 4. To style the text displayed inside the dropdown list, you can use the **Option Text Style** and **Substring Style** (can be used to highlight the matching text in an item name).

### Auto Fill Hint When *Auto Fill Hint* property is enabled, it uses the operating system's autofill service to suggest the relevant information to the user, such as usernames, passwords, or credit card numbers, based on the context of the text field. For example, you have a form where the user needs to enter their credit card information. You can use this property to help the autofill service suggest the user's credit card number and expiration date. To enable the Auto Fill Hint property: 1. Select the TextField widget, move to the **Properties Panel** **> Additional Properties >** enable the **Auto Fill Hint** property. 2. Set the **Auto Fill Hint Options** to one that you want to provide a hint about. :::caution The availability and behavior of the *Auto Fill Hint* may vary by platform and user settings, and it does not guarantee that the operating system's autofill service will suggest the correct information to the user. :::

### Update Page on Change You might have added the TextField widget inside the search page and want to refresh the search result as the value inside the TextField changes. :::note Enabling this feature will refresh the page whenever a user types into TextField after a configurable delay. ::: Here's an example of displaying the TextField value in a Text widget in realtime: 1. Select the TextField widget, move to the **Properties Panel** **> Additional Properties >** enable the **Update Page On Change** property. 2. Also, set the **Update Delay (ms)**, which specifies the time interval after the user stops typing before the page refreshes its UI. For example, if the *Update Delay (ms)* value is set to 2000 ms (2 seconds), the page will update 2 seconds after the user stops typing. For this example, let's set it to 0 ms. 3. Now select the **Text** widget, move to the **Properties Panel > Set from Variable > Widget State > [TextFieldName]**. Tip: You can also set the default value to be displayed until the user has entered any text. :::tip We advise setting the delay value if you make an API call that accepts the input from TextField. :::

### Read only TextField Sometimes you might want to restrict users from entering or updating anything into TextField and only allowed it if they are in edit mode. You can accomplish this by switching the **Read Only** property.

### Change Cursor Color In a form with many text fields, changing the cursor color for the currently focused field can help the user understand where their input will go when they start typing. To change the cursor color, head over to **Properties Panel** **> Additional Properties >** change the **Cursor Color**. ![change-cursor-color](https://docs.flutterflow.io/assets/images/change-cursor-color-05f5660685d861eddeefade60a07d7ab.avif) ### Changing Keyboard Type When the keyboard opens by default, you can type any text. You might want user input in a certain format, such as a phone number, email address, website URL, etc. In this situation, you can choose a predefined keyboard type to present the appropriate key selections. To change the keyboard type, select the TextField widget, move to the **Properties Panel** **> Additional Properties >** set the **Keyboard Type** to the right one. ![keyboard-types](https://docs.flutterflow.io/assets/images/keyboard-types-e4a1beb8860678317acbb152580517c6.avif) ![changing-keyboard-type](https://docs.flutterflow.io/assets/images/changing-keyboard-type-7bcaa99496b93d0ca8b3165eb5c38544.avif) ### Masking Input You might want to allow users to provide input in a specific format. For example, if you want a date in a format like MM/DD/YYYY, where all input must be a number, and its length should not exceed eight digits. You can do so by formatting the user input using the specific mask. To mask the user input, select the TextField widget, move to the **Properties Panel** **> Additional Properties >** set the **Mask** dropdown to the one you need. If the required format is not on the list, you can select **Custom** and specify the **Custom Mask**. The '#' sign represents the number, and 'A' represents a letter. Here are some examples of *Custom Masks*: | Input | Custom Mask | | --- | --- | | Credit card number (e.g., 3424 4353 5453 3535) | #### #### #### #### | | Custom date (e.g., 12-Jan-2023) | ##-AAA-#### |

### Filtering Input You might want to restrict the type of characters that can be entered into a TextField. Let's say you are building an app that requires its employees to enter their employee ID when they clock in and out for their shifts. The employee ID consists of only letters and numbers, and the app should only allow these characters to be entered. You can do so by filtering the user input To filter the user input, select the TextField widget, move to the **Properties Panel** **> Additional Properties >** set the **Filter** dropdown to the one you need.

### Validating Input You can validate the TextField value by wrapping it inside the [Form](https://docs.flutterflow.io/resources/forms/form-validation) widget and adding the validation criteria. :::tip Filtering ensures that only the allowed characters or values are entered, whereas the validation checks the entire input data against certain criteria. Both techniques can be used together or independently to ensure the correctness of user input in a TextField widget. ::: ### Capitalization You might want to control the capitalization of text when the user is typing, and also when the text is displayed. The Capitalization property allows you to specify how the text entered in the TextField should be capitalized. This property accepts one of the following values: - **None**: This value means that no capitalization should be applied to the text. All the characters will be displayed as they are typed. - **Words**: This value capitalizes the first letter of each word in the text. - **Sentences**: This value capitalizes the first letter of each sentence in the text. - **Characters**: This value capitalizes every character in the text. To set the capitalization, select the TextField widget, move to the **Properties Panel** **> Additional Properties >** set the **Capitalization** dropdown to the one you need. ![capitalization](https://docs.flutterflow.io/assets/images/capitalization-882a7bdbe6b787328f3798af98637803.avif) ### Submit Type Showing a particular action on a keyboard can be useful in guiding users on what to do next. For example, if you have a search bar, you can display a "Search" button on the keyboard. When tapped, instead of moving to a new line or closing the keyboard, you can execute a search function. This can improve user experience by providing more intuitive keyboard actions based on the context of the input. This property accepts one of the following values: - **Done**: This closes the keyboard. - **Next**: This moves focus to the next field. - **Previous**: This moves focus to the previous field. - **Send**: This represents the Send action. - **Search**: This represents the Search action - **Go**: This represents the Go action. To set the submit type, select the TextField widget, move to the **Properties Panel** **> Additional Properties >** set the **Submit Type** dropdown to the one you need. ![submit-type](https://docs.flutterflow.io/assets/images/submit-type-7b60ba6675f9b8ad3b637f0b56c950d7.avif) ### Set Max Character Length Sometimes, you might want to specify the maximum number of characters users can enter into the TextField. When the user types or pastes text into the field and reaches the specified character limit, they won't be able to input more characters, or the TextField will visually indicate that the limit has been reached. For example, When users can leave comments or post messages (similar to 'tweet'), setting a maximum character length can help prevent spam or excessively lengthy responses. To set the max character limit, select the TextField widget, move to the **Properties Panel** **> Additional Properties >** set the **Max Length** (number of characters you want to allow), and set the **Max Length Enforcement** to one of the following values: - **Not Enforced**: This allows users to input extra characters and displays a warning when the limit is exceeded. - **Enforced**: This always truncates any additional character once the limit is reached. :::note You can also hide the maximum character count by enabling the **Hide Max Length Counter** option. :::

## Hiding Keyboard on Tap Hiding the keyboard when the user taps outside of a TextField is a common user experience pattern that many apps use to improve usability. When the keyboard is open, it can obscure important information on the screen and make it difficult for the user to interact with other parts of the app. Adding this behavior in your app can make it easier for these users to interact with other parts of the app without interference from the keyboard. It can also make your app feel more polished and professional.

To hide/close the keyboard, select the page, move the **Properties Panel >** enable the **Hide Keyboard on Tap**. ![Hide keyboard on tap](https://docs.flutterflow.io/assets/images/hide-keyboard-tap-2-845a510336fc3403e93e770c5a78ad8b.avif) ## Focus Change Event Sometimes, you may need to know whether a TextField is being used or not. For example, you can turn other parts of the app *on* or *off* depending on if the TextField is active. Also, you can start animations when someone starts or stops typing in the TextField. Let's see an example of controlling the visibility of a Text widget based on the TextField's Focus state.

To do so: 1. On a Text widget, add a [Conditional Visibility](https://docs.flutterflow.io/resources/ui/widgets/widget-commonalities#conditional) based on the TextField's Focus state. You can access via **Set from Variable** menu **> Widget Focus State > [TextField name]**. 2. Now, on a TextField widget, under the [On Focus Change](#trigger-action--listen-callback) callback, simply add an action to refresh the page by adding the update app state variable.

## Trigger Action / Listen Callback The TextField widget provides you with two types of actions (aka callbacks): 1. **On Submit**: Actions under this will be triggered when you finish entering the text in the TextField widget. i.e., pressing a done button inside the soft keyboard. 2. **On Change**: Actions under this will trigger when you enter or delete a character in the TextField widget. 3. **On Focus Change**: Actions under this will trigger when the focus state changes on a TextField. This means when users click on it to type or click away from it. :::caution Be careful about adding the actions under the **On Change**. Specifically, you should avoid adding any action that will take more time. ::: **On Submit**

**On Change**

**On Focus Change**

To trigger an action: 1. Select the TextField widget from the widget tree or canvas area. 2. Select **Actions** from the Properties panel (the right menu), and click **+ Add Action**. 3. Select the **Type of Action** among the **On Submit, On Change,** and **On Focus Change**. 4. Now you can add any action here.

--- ## Video guide If you prefer watching a video tutorial, here's the one for you:

# Form Validation > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/form-validation Learn how to add Form Validation widget in your FlutterFlow Studio app. You can add validations to input fields by wrapping them inside the Form widget. The Form widget enables you to validate user inputs and display appropriate messages when validation criteria are not met. For example, you could use it to check if a user has given a valid email and password. This makes it easy to handle user input and ensure that the data is correct before it is submitted to the server or stored locally. ## Adding Form widget Let's see how to add a *Form* widget by building a signup example. Here's how it looks:

Building and validating a *Form* includes the following steps: 1. [Adding input fields](#1-adding-input-fields) 2. [Adding validations](#2-adding-validations) 3. [Adding validate action](#3-adding-validate-action) ### 1. Adding input fields A form widget can only validate if there are any input fields. Here's an example of adding input fields for the signup form. 1. First, add the **Form** widget itself from the **Form Elements**. 2. Inside the form, add the **Column** widget from the **Layout Elements** tab. 3. Now, add two [**TextFields**](https://docs.flutterflow.io/resources/forms/textfield) (one for email and one for password). 4. Add a [**Button**](https://docs.flutterflow.io/resources/ui/widgets/button) widget and then add **Date/Time Picker** action to get the date of birth. 5. Add one more **Button** to validate and submit the form. Here's how it looks: ![Input fields](https://docs.flutterflow.io/assets/images/fv-input-fields-217cea7794a21e90fc1475fe1cc83e15.avif) ### 2. Adding validations Validation refers to the process of checking user input for correctness and ensuring that it meets certain criteria or requirements. This can include checking for the presence of required fields, verifying that a value is within a certain range or format, or validating against the custom pattern. After adding input fields, they will be available to be validated using the form widget properties. Here's how you do it: 1. Select the **Form** widget, and move to the **Properties Panel > Validate** section. 2. Identify the **TextField** on which you would like to add the validation and tick the box on the right side. 1. Inside the **Error Message** input box, provide the message that will be displayed (below the *TextField*) if a user leaves the *TextField* empty. 2. You can also specify the **Min Required Character** and **Max Allowed Characters**. 1. **Min Required Character**: This is the minimum character required for the validation to pass. For example, If you provide a value as 9 and a user enters the value as *a@a.com* (which is 6 characters), **then the validation fails, and an error message will be displayed. 1. Inside the **Minimum Character** **Error Text** input box, provide the message that will be displayed if a user doesn't provide the min required characters. 2. **Max Allowed Characters**: This is the maximum number of characters allowed for the validation to pass. For example, If you provide a value of 15 and a user enters a password that exceeds 15 characters, then the validation fails, and an error message will be displayed. 1. Inside the **Max Allowed Characters** **Error Text** input box, provide the message that will be displayed if a user enters more than the maximum allowed characters.

3. You can also choose to validate the input using our predefined validators or by creating the custom one. To do so, you can set the **Text Validator** to the one you need. 1. If the required validation is not on the list, you can select **Custom Regex** and specify your own **Regex (Dart/JS)**. Here are some examples of *Custom Regex*: | Examples | Regex (Dart/JS) | | --- | --- | | IP address (e.g., 192.168.1.1) | ^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$ | | Time in the 24-hour format (e.g., 13:45) | ^([01]?[0-9]|2[0-3]):[0-5][0-9]$ | 2. Also, provide a message in **Invalid Text Error Text**. This will be displayed If validation for the *Custom Regex* fails. 4. You can also add validation on certain actions that can be used inside the form, such as *Date/Time Picke*r and *PlacePicker*. To do so, find the action name and tick the box on the right side. 1. Now you must enable **Add Action on Error** and set the **Action Type** to the appropriate one. This will be triggered if the validation fails. For example, in this case, if a form is submitted without selecting the birth date, you can add a Show Snackbar action asking a user to select the date. ![Validating Date/Time picker](https://docs.flutterflow.io/assets/images/validating-date-time-picker-490b88db4d2332d91249ea6c37362dd6.png) ### 3. Adding validate [Action] Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**. 3. Search and select the **Validate Form** (under *Widget/UI Interactions*) action. 4. Set the **Select Form to Validate** to your **Form name**. 5. You can chain the next action that will be triggered if the validation passes.

## Auto validating Rather than displaying an error message after the user submits the form, you can provide real-time feedback as they type in the *TextField* widget to indicate validation errors. This feature can be particularly useful for lengthy forms where it can save the user's time and effort. To auto validate a form, select **TextField >** move to the **Properties Panel > Add validations >** and then enable the **Automatically Validate**.

![Enabling auto validate](https://docs.flutterflow.io/assets/images/enable-auto-validate-c63d86f6dc81572a21a5ebeb15bb20ab.avif) ## Validating a Form on TextField On Submit You can also validate a form when you are done entering a value inside the *TextField* using the *On Submit* action.

To validate a form on *TextField* *On Submit*: 1. Select the **TextField** widget and select **Actions** from the Properties panel. 2. Click **+ Add Action** button, and ensure that the **Type of Action** is set to **On Submit**. 3. Search, and select the **Validate Form** (under UI Interactions) action. 4. Set the **Select Form to Validate** to your **Form name**.

--- ## Video guide If you prefer watching a video tutorial, here's the one for you:

# Set Form Field [Action] > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/set-form-field Learn how to add Set Form Field action in your FlutterFlow Studio app. The **Set Form Field** action allows you to programmatically populate or update the value of any input widget—like a TextField, Dropdown, or other form elements—at runtime. This is especially useful when you want to quickly fill or modify user input fields based on user preferences (e.g., saved addresses) or pre-stored information. :::note[possible use cases] - **Use Saved Address:** If a user toggles "Use Saved Address," you might set the Full Name, Street Address, City, and ZIP Code fields to values pulled from a user profile or database. - **Edit Existing Data:** When navigating to an "Edit Profile" page, you can auto-populate the TextFields with the current user info so they only change what’s needed. - **Auto select Country/State Dropdown:** Automatically select the user's country and state based on location services or their account settings. ::: While adding the Set Form Field action, select the target widget (e.g., `TextField`) and assign a value—this could come from a variable like `fullName` in your backend, app state, or page parameters. ![set-form-field-action.avif](https://docs.flutterflow.io/assets/images/set-form-field-action-0e8ca7dc0d5864645a21baa09f70a1b7.avif) If you need to update several widgets (such as a TextField and a Dropdown), use a separate Set Form Field action for each and specify the appropriate value. ![multiple-set-form-field.avif](https://docs.flutterflow.io/assets/images/multiple-set-form-field-bdcfae8c0444b80a9a4bdbaa571b1caa.avif) #### Focus Field When Set You can also set additional preferences like whether the field should be focused and how the cursor should behave using the **Focus Field When Set** option. When you enable the option, it automatically sets the focus on the field once its value is assigned. This is helpful in scenarios such as an “Edit Full Name” switch—when turned on, the field preloads the existing name and positions the cursor for immediate editing. When **Focus Field When Set** is enabled, you can set one of the following **Cursor Position**: - **End**: Places the cursor at the end of the newly filled text, letting the user continue typing from the last character. - **Start**: Positions the cursor at the beginning of the text. - **Highlight**: Selects (highlights) the entire text, letting the user immediately overwrite it. - **Preserve**: Maintains the cursor location as it was (if any), which is useful when the user is already typing and only part of the text has changed. ![focus-field-when-set](https://docs.flutterflow.io/assets/images/focus-field-when-set-922b79f19bfb336f337de2da9304a23c.avif) :::note You can also set form fields inside the current widget’s child component.

set-form-field-component ::: # Reset Form Field [Action] > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/reset-form-field Learn how to add Reset Form Field action in your FlutterFlow Studio app. The **Reset Form Field** action allows you to reset values in form widgets. This is especially useful for clearing previously entered data and giving users a clean slate. For example, after a form is successfully submitted, you can use this action to clear the input fields—making it easy for users to enter new information for another submission. ![reset-form-field](https://docs.flutterflow.io/assets/images/reset-form-field-9555bd87c26221abdff902bc72be91ad.avif) :::note You can also reset form fields that are inside the components. ![reset-form-field-component](https://docs.flutterflow.io/assets/images/reset-form-field-component-189c6112822c7a787500e872dedbe4d6.avif) ::: # Form Triggers > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/forms/form-triggers Learn how to use Form Triggers in FlutterFlow Studio to create dynamic, interactive user experiences by responding to user input on widgets like dropdowns, sliders, toggles, and text fields. **Form Triggers** in FlutterFlow Studio allow you to respond dynamically to user input on widgets like dropdowns, sliders, toggles, and text fields. Whether it’s selecting an option, toggling a switch, or typing in a field, these triggers help you create interactive, responsive experiences by executing actions based on user interaction. ## On Selected The **On Selected** action trigger is used to perform actions when a user selects or changes a value from a widget that presents multiple options. This trigger is associated with form widgets where selection input is required, such as [Dropdown](https://docs.flutterflow.io/resources/forms/dropdown), [RadioButton](https://docs.flutterflow.io/resources/forms/radiobutton), [CheckboxGroup](https://docs.flutterflow.io/resources/forms/checkbox#checkboxgroup), [ChoiceChips](https://docs.flutterflow.io/resources/forms/choice-chips), and [Slider](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/slider). :::tip[Possible use cases] - **Dropdown – Shipping Method Selection:** User selects a shipping method from options like "Standard", "Express", or "Next Day". Action under the *On Selected* trigger sets the app state variable `shippingOption`, which updates pricing or estimated delivery time dynamically. - **Slider – Show Volume Level in Snackbar:** User adjusts a Slider from 0 to 100. The *On Selected* trigger displays a Snackbar showing the current volume: Volume set to: [sliderValue]. - **ChoiceChips – Filter Products by Category:** User taps a chip like "All", "Electronics", or "Clothing". The *On Selected* trigger might set an app state variable (e.g., `selectedCategory`) and update the product list to match the chosen category. ::: To use the **On Selected** trigger: 1. Start by selecting a supported widget, such as a Dropdown. 2. Open the **Actions** tab in the properties panel and click **+ Add Action**. 3. You will notice that the **Type of Action** (aka callback) is already set to **On Selected**. That means actions added under this will be called whenever the selection changes. 4. Finally, define the actions you want to perform when the user makes a selection, such as setting a variable, navigating to another page, or displaying a message. ![on-selected](https://docs.flutterflow.io/assets/images/on-selected-dc6bc4f81bd0d298bbbc71ca82d99b59.avif) ## On Toggled On / On Toggled Off The **On Toggled On** and **On Toggled Off** action triggers are used to perform actions when a user turns a toggleable widget on or off. These triggers are supported by widgets such as [Checkbox](https://docs.flutterflow.io/resources/forms/checkbox), [CheckboxListTile](https://docs.flutterflow.io/resources/forms/checkbox#checkboxlisttile), [Switch](https://docs.flutterflow.io/resources/forms/switch), and [SwitchListTile](https://docs.flutterflow.io/resources/forms/switch#switchlisttile), any widget that represents a binary state. These triggers are especially useful when you want to conditionally execute different actions based on whether a user enables or disables a setting, preference, or feature. :::tip[Possible use cases] - **Switch – Enable Dark Mode:** User toggles a Switch to enable Dark Mode. Action under the *On Toggled On* trigger sets the dark mode. - **Checkbox – Agree to Terms:** User checks a Checkbox labeled “I agree to the terms and conditions.” The *On Toggled On* trigger enables the Submit button. If the user unchecks it, the *On Toggled Off* trigger disables the button again. - **CheckboxListTile – Select Notification Channels:** User checks or unchecks options like Email, SMS, or Push Notifications. Each toggle fires either *On Toggled O*n or *On Toggled Off* to update selected preferences in the backend. ::: To use the **On Toggled On** or **On Toggled Off** trigger: 1. Start by selecting a supported widget, such as a Switch. 2. Open the **Actions** tab in the properties panel and click **+ Add Action**. 3. Choose **On Toggled On** to define actions when the toggle is switched on, or **On Toggled Off** to define actions when it's switched off. 4. Add your desired actions, such as updating a variable, showing a message, enabling a button, or triggering a backend call. ![on-toggle](https://docs.flutterflow.io/assets/images/on-toggle-9bc23d1bd5b7301c0e2382945ce9fccf.avif) ## On Change The **On Change** action trigger is used to respond to real-time user input as they type or modify the contents of an input field. This trigger is supported by widgets such as [TextField](https://docs.flutterflow.io/resources/forms/textfield) and [Pincode](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/pincode). It’s ideal for enabling live form validations, updating app state as the user types, or enabling/disabling UI elements based on the current input. :::tip[Possible use cases] - **TextField – Enable Button When Email Is Entered:** As the user types in an email TextField, action under the *On Change* trigger checks if the input is a valid email. If it is, it enables the Continue button. - **Pincode – Auto Submit When Complete:** When a user finishes entering a 6-digit code in a Pincode widget, action under the *On Change* trigger checks if the full code is entered and triggers form submission or a backend call. ::: To use the **On Change** trigger: 1. Start by selecting a supported widget, such as a TextField. 2. Open the **Actions** tab in the properties panel and click **+ Add Action**. 3. Choose **On Change** from the list of available triggers. 4. Define the actions to trigger, such as setting a variable, showing a message, or calling an API. ![on-change](https://docs.flutterflow.io/assets/images/on-change-88fcfa03bf04b3b1a30deca3915a861e.avif) --- ## On Focus Change The **On Focus Change** trigger fires whenever an input field gains or loses focus, like when a user taps into or out of a [TextField](https://docs.flutterflow.io/resources/forms/textfield) and [Pincode](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/pincode) widget. It’s useful for providing user guidance (on focus) or performing validations. :::tip[Possible use cases] - **TextField – Show Hint on Focus:** When the TextField gains focus, action under the *On Focus Change* trigger displays a helper text or tooltip with input instructions (e.g., “Enter your phone number without dashes”). - **Pincode – Validate on Exit:** When the user finishes entering the code and the Pincode widget loses focus, action under the *On Focus Change* trigger runs validation logic to check if the input is complete or valid, and displays an error if it's not. ::: To use the **On Focus Change** trigger: 1. Start by selecting a supported widget, such as a TextField. 2. Open the **Actions** tab in the properties panel and click **+ Add Action**. 3. Choose **On Focus Change** from the list of available triggers. 4. Define the actions to trigger, such as showing helper text, validating input, or updating the UI based on focus. ![on-focus-change](https://docs.flutterflow.io/assets/images/on-focus-change-eb02d0ce94bb5b1e5310a75acda7f36e.avif) # API Calls > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-logic/rest-api Learn the basics of making API calls in your backend logic. On this page, you will learn the most basic knowledge on various concepts for adding an API call to your project. They are the building blocks of adding an API call. Depending on the API's definition, you may utilize some or all of these concepts to successfully implement the API call in your project. Here are they: * [Headers](#headers) * [Query Parameters](#query-parameters) * [Variables](#variables) * [Body](#body) * [API response (JSON) to/from Data Type](#api-response-json-tofrom-data-type) * [JSON Path](#json-path) * [Advanced Settings](#advanced-settings) ## Headers Headers typically carry the metadata associated with an HTTP request or response of an API call. HTTP headers are mainly grouped into two categories: * **Request headers** contain more information about the resource to be fetched or the client requesting the resource. * **Response headers** hold additional information about the response that the server returns. ### Passing request headers Some of the common request headers that you might need while sending a request are: * **Authorization**: Used for authenticating the request. * **Content-Type**: Used while sending a POST/PUT/PATCH request containing a message body. To pass the request header: 1. Select the **Headers** tab and click on the **+ Add Header** button. 2. Inside the input box, enter the header name followed by the colon(:) and its value (e.g., **Content-Type: application/json**).

:::note The default **Content-Type** for any HTTP POST request is `application/json`, so if your data body is in JSON, you can skip defining the Content-Type. ::: ### Passing auth token (as request header) You might need to add an API that is secured. That means it only gives results if you pass the authorization token (aka auth token) in the header parameter. This is usually done to prevent abuse. Let's see how you can add the auth token. #### Passing static auth token Some services provide you with a static auth token. Such a token never changes until you manually generate the new one. To pass the static auth token: 1. Select the **Headers** tab and click on the **+ Add Header** button. 2. Inside the input box, enter the header name as **Authorization** followed by colon (:) and its value (e.g., **Authorization: Bearer YOUR_TOKEN**).
#### Passing dynamic auth token You would probably want to pass the auth token returned as a response in the login API call. Such a token changes every time when you log in. Hence, you need a way to pass the dynamic token. :::caution[How to save an authentication token?] After the login call is succeeded, ensure you save the authentication token in an app state variable (with Persisted -> True). Check the visuals below: ![api-token-variable.png](https://docs.flutterflow.io/assets/images/api-token-variable-acf56056503d2c4fb2717205d8d8c7d2.png) ::: Now you can pass the dynamic token: 1. Select the **Headers** tab and click on the **+ Add Header** button. 2. Inside the input box, enter the header name as **Authorization** followed by a colon (:) and then enter any variable name inside the brackets (e.g., **Authorization: Bearer [auth_token]**). 3. Select the **Variables** tab and [create a new variable](#creating-variables) with the same name you provided inside the brackets. This will be used to pass the token value from the app state variable to the API call. Now from the API call (that requires an authentication token), pass the token value from the app state variable.
### Accessing response headers Sometimes you might want to retrieve the values of the response headers. For example, retrieving the auth token from the response headers of the Login API call. To access the response header: 1. Ensure you have added the [API call action](https://docs.flutterflow.io/resources/backend-logic/rest-api) and provided the **Action Output Variable Name**. 2. Now, whenever/wherever the **Value Source** is set to **From Variable**, select the **Action Outputs > [Action Output Variable Name]** (e.g., Action Outputs > loginResponse). 3. Set the **API Response Options** to **Get Response Header**. 4. Enter the **Header Name**. Note that this must match the name of the response header from your API call. 5. Click **Confirm**. ## Query Parameters They are optional parameters you can pass with an API call; they help format the response data returned by the server. Usually, they are concatenated at the end of the URL with a question mark (`?`) as the delimiter and are represented as key-value pairs. An example of an URL with query parameters looks like this ([NASA Open API](https://api.nasa.gov/)): [https://api.nasa.gov/neo/rest/v1/feed?**start_date=2015-09-07&end_date=2015-09-08&api_key=DEMO_KEY**](https://api.nasa.gov/neo/rest/v1/feed?start_date=2015-09-07&end_date=2015-09-08&api_key=DEMO_KEY) Here, `start_date`, `end_date`, and `api_key` are the query parameters passed to receive the specific data. Here's another example, this API call `` has two query parameters. The `limit` parameter specifies 20 items to load per page, and the `offset` specifies the number of items to skip. This is called offset-based pagination. ### Passing query parameters To pass the query parameters for `GET` or `DELETE` API call: 1. Select the **Query Parameters** tab and click the **+ Add Query Parameter** button. 2. Enter the **Name** of the query parameter. 3. Set the **Value Source** to **Specific Value** or **From Variable**. 1. If you want to pass this value from your page, app state variable, or any other source (i.e. , dynamic value), choose the **From Variable,** and then from the **Select Variable** dropdown, choose the already created variable (see how to [create variable](#creating-variables)) or click on **+ Create New Variable**. Note: This will immediately create a new variable with the same name as of query parameter. However, you still need to open the **Variables** tab and set its **Type**. 2. If you want to pass a static/fixed value, select the **Specific Value**, set its **Type,** and enter its **Value**. Below is the example of passing query parameter for the URL -> `https://api.instantwebtools.net/v2/passenger?page=10&size=20`

In a rare case, you might want to pass the query parameters for the other methods of API calls. Such as POST, PUT, and PATCH. To do so: 1. In your API URL, replace the hard-coded values with a meaningful name inside the brackets (e.g., from `https://api.instantwebtools.net/v2/passenger?``**page=0**` to `https://api.instantwebtools.net/v2/passenger?``**page=[page]**`). 2. Select the **Variables** tab and [create a new variable](#creating-variables) with the same name you provided inside the brackets.
## Variables Variables allow you to pass the dynamic values from any part of your app to the API calls. Here's when they come in handy: * Sending an auth token from your app's state to an API call's request header. * Using username and password from TextField widgets in the API call's request body. * Including selected dates as query parameters. * Changing the base URL with a dynamic URL. ### Creating variables To create variables, select the **Variables** tab, enter its **Name**, select the appropriate **Type** and provide the **Default Value** if you wish to. ![variables.png](https://docs.flutterflow.io/assets/images/variables-581babfdb6cab0e35ece92e29388cba5.png) Now you can pass values to these variables while triggering the API call from your page. You can set its value from any widget, app state variable, or any other source.

Here's how you can use a variable to create a dynamic base URL:

![dynamic-base-url.png](https://docs.flutterflow.io/assets/images/dynamic-base-url-1b204a7de91385a3f4287fcfaf1459d4.png)

## Body You can send data (as a request body) while calling the API of methods POST, PUT, or PATCH by defining them inside **Body**. The most common type is JSON format which is the easiest way of passing data inside the body of the reqest. ### Creating Request Body Here you'll see creating a request body in the following formats: #### JSON format To create a request body in JSON format: 1. First, If you haven't already, [create variables](#creating-variables) (e.g., username and password variables that will be required to pass values from a login page to the login API call). 2. Select the **Body** tab and set the Body dropdown to **JSON**. 3. Copy-paste your request body and replace the values with the variables by dragging and dropping them inside your JSON body.
#### Text format This format is used to send textual data in the request body of an API. For example, in a SOAP API, the request body is typically in text format and contains XML data. To create a request body in text format: 1. First, If you haven't already, [create variables](#creating-variables). 2. Select the **Body** tab and set the Body dropdown to **Text**. 3. Copy-paste your request body and replace the values with the variables by dragging and dropping them inside the request body.
#### x-www-urlencoded format To create a request body in x-www-form-urlencoded format: 1. First, If you haven't already, [create variables](#creating-variables) (e.g., username and password variables that will be required to pass values from a login page to the login API call). 2. Select the **Body** tab and set the Body dropdown to **x-www-form-urlencoded**. 3. Click on the **+ Add Parameter** and enter the **Name** of the parameter. 4. Set the **Value Source** to **Specific Value** or **From Variable**. 1. If you want to pass this value from your page, app state variable, or from any other source (i.e., dynamic value), choose the **From Variable,** and then from the **Select Variable** dropdown, choose the already created variable (see how to [create variable](#creating-variables)) or click on **+ Create New Variable**. Note: This will immediately create a new variable with the same name as of parameter. However, you still need to open the **Variables** tab and set its **Type**. 2. If you want to pass a static/fixed value, select the **Specific Value**, set its **Type,** and enter its **Value**.
#### Multipart format A multipart request body is a data format used in HTTP requests that enable the transfer of multiple parts of data in a single request. It is commonly used in file uploads. To create a request body in the multipart format: 1. Select the **Body** tab and set the *Body* dropdown to **Multipart**. 2. Click on the **+ Add Parameter** and enter the **Name** of the parameter. 3. Set the **Value Source** to **From Variable,** and then from the **Select Variable** dropdown, click on **+ Create New Variable**. Note: This will immediately create a new variable with the same name as of parameter. 4. Now move to the **Variables** tab and set the **Type** to **Uploaded File**. This will allow you to pass the file stored locally on the device using an action such as **Upload/Save Media**.
## API response (JSON) to/from Data Type Converting between API Response (JSON) and Data Types is often referred to as JSON deserialization and serialization. It allows you to convert JSON data from an API response into a [**Custom Data Type**](https://docs.flutterflow.io/resources/data-representation/custom-data-types) when you receive it. Also, it enables you to convert your Custom Data Type back into JSON when sending data in an API request. :::note This is a more robust and maintainable way to work with JSON data in your app. It reduces complexity and potential errors (e.g., typos) compared to manually navigating [JSON paths](#json-path). ::: ### Create Custom Data Type matching to JSON structure First, [create a Data Type](https://docs.flutterflow.io/resources/data-representation/custom-data-types#creating-custom-data-type) with the same structure as your API response. Here's what the sample JSON response looks like after mapping it into a Custom Data Type.
![custom-data-type-json-response.png](https://docs.flutterflow.io/assets/images/custom-data-type-json-response-3a0d799722f6aaa023aa47d0142fd9a6.png)
Creating custom data type as per the JSON response
After this, you can choose to [convert to](#json-to-data-type) or [from](#json-from-data-type) the Data Type based on your requirements. ### JSON to Data Type Let's see how to get the JSON into the Custom Data Type using an example that fetches the list of products from [this API](https://dummyjson.com/docs/products). Here's how it looks: ![img.png](https://docs.flutterflow.io/assets/images/img-c6ed86116aa90ef908ab4f79a0262ceb.png) Here's how you do it: 1. First, ensure that you [create a custom data type](#create-custom-data-type-matching-to-json-structure) that matches your JSON structure. 2. Open your API call definition > **Response & Test tab > Response Type >** enable the **Parse as Data Type**. Select the **Data Type** that you want to convert into. For this example, it's 'AllProducts'. ![img_1.png](https://docs.flutterflow.io/assets/images/img_1-05b380df971294e998ed9a503d802323.png)

3. On ListView, after adding the [API call backend query](https://docs.flutterflow.io/resources/backend-query/api-call-query), access the values by setting the following options. 1. **Generate Children from Variable** by setting **API Response Options** to **As Data Type**. 2. Set **Available Options** to **Data Structure Field** because we want to grab only a specific field, which has a list of products and not other items such as 'total' and 'skip'. 3. **Select Field** to the field that holds the list of products, i.e., 'products' for this example. 4. Click **Confirm** twice.

4. Now, you can bind data in UI elements as you would normally do by setting the **Available Options** to **Data Structure Field** and **Select Field** that you want to display.
### JSON from Data Type Sometimes you might want to dynamically create a JSON body and pass it along the API request instead of manually configuring each field in the API call editor. You can do so by adding data into a Custom Data Type and then converting it into JSON while making an API call. Let's see an example of adding a product by sending its data in JSON format in the API request. ![add-product.png](https://docs.flutterflow.io/assets/images/add-product-ef370dfe0ed90a1a547b26a09fb59236.png) Here's how you do it: 1. First, [create a custom data](#create-custom-data-type-matching-to-json-structure) type that matches the JSON format of the API request body. Here's how it looks for this example. ![img_2.png](https://docs.flutterflow.io/assets/images/img_2-793efe2c929d07234b9fb57e4cac6d5b.png)

2. In your API call, [create a variable](#creating-variables) with type **JSON** and put it inside the **Body** section.

3. On click of **Add** button, we'll store values from UI into the page state variable of custom data type. Then, while making an API call, pass that page state variable and set the **Available Options** to **To JSON**.
## JSON Path **JSONPath** is a query language for JSON. Using the JSON path, you can retrieve specific data out of the whole JSON response. :::note You'll usually get a response in JSON format from an API request. ::: Learning a few JSON paths (or *JSONPath expressions*) will help you retrieve most of the data you need. Inside our builder, we allow you to try and add different JSON paths in real-time and suggest various options to get exactly what you are looking for. Some examples of JSONPath expressions are as follows: * `$.data.name` * `$.users[0].name` * `$.users[:].name` The leading `$` represents the root object, dot (`.`) is used for accessing keys present inside the JSON, the value inside brackets (`[0]`) represents the array index if the key contains an array, and the (`[:]`) will select all the objects inside the list. Let's see some real-world examples of the JSON path for the following API response: ``` { "page": 1, "per_page": 6, "total": 3, "total_pages": 2, "data": [ { "id": 1, "email": "george.bluth@reqres.in", "first_name": "George", "last_name": "Bluth", "avatar": "https://reqres.in/img/faces/1-image.jpg" }, { "id": 2, "email": "janet.weaver@reqres.in", "first_name": "Janet", "last_name": "Weaver", "avatar": "https://reqres.in/img/faces/2-image.jpg" }, { "id": 3, "email": "emma.wong@reqres.in", "first_name": "Emma", "last_name": "Wong", "avatar": "https://reqres.in/img/faces/3-image.jpg" } ], "support": { "url": "https://reqres.in/#support-heading", "text": "To keep ReqRes free, contributions towards server costs are appreciated!" } } ```
$.total

This will return the following data: ``` 3 ```

$.data

This will return the following data: ``` [ { "id": 1, "email": "george.bluth@reqres.in", "first_name": "George", "last_name": "Bluth", "avatar": "https://reqres.in/img/faces/1-image.jpg" }, { "id": 2, "email": "janet.weaver@reqres.in", "first_name": "Janet", "last_name": "Weaver", "avatar": "https://reqres.in/img/faces/2-image.jpg" }, { "id": 3, "email": "emma.wong@reqres.in", "first_name": "Emma", "last_name": "Wong", "avatar": "https://reqres.in/img/faces/3-image.jpg" } ] ```

$.data[0]

This will return the object at the 0th index (i.e., the first object). ``` { "id": 1, "email": "george.bluth@reqres.in", "first_name": "George", "last_name": "Bluth", "avatar": "https://reqres.in/img/faces/1-image.jpg" } ```

$.data[0].email

This will return the email value of the object at the 0th index. ``` "george.bluth@reqres.in" ```

$.data[:].email

This will return the email of all the objects inside the data. ``` [ "george.bluth@reqres.in", "janet.weaver@reqres.in", "emma.wong@reqres.in" ] ```

:::caution[Important] JSON keys must start with a letter, an underscore, or a dollar sign. They cannot begin with a numeric character. However, in cases where you have keys with numeric prefixes, such as `$.0_image`, you can access them using bracket notation, like this: `$.["0_image"]`. ::: :::note Learn more about **[JSONPath](https://www.rfc-editor.org/rfc/rfc9535.html)** and how to define a proper expression. ::: ### Add JSON Predefined Path You can effortlessly define and manage **JSON Paths** for your API calls in FlutterFlow Studio to parse and extract the data you need. Once added you can [use](#using-json-path) them as **Predefined Path** while accessing the **JSON Body**. First, [create and test](https://docs.flutterflow.io/resources/backend-logic/create-test-api) your API call. Inside the **JSON Paths** section, click **+ Add JSON Path**, enter your **JSON Path**, and assign it a name. If the expression is valid, a preview of the response appears under **Response Preview**. Click the **Preview** icon to see the full response. If the response contains a list of items, the **Is List** option will be enabled automatically. Under the **Recommended** section, you'll find suggested JSON paths that might contain the data you need.

### Using JSON Path While accessing values from an API Call, you can either enter the custom JSON path or use the [predefined JSON path](#add-json-predefined-path). To use a predefined JSON Path, first, select your API response. Then, set the **API Response Options** to **JSON Body** and the **Available Options** to **JSON Path** or **Predefined Path**. Finally, specify the JSON Path Name or select from the predefined JSON Path to map the extracted data for use in your app.

## Advanced Settings You can make the API call private and change the proxy settings using advanced settings. ### Private API Calls Making an API call private is helpful if it uses tokens or secrets you don't want to expose in your app. Enabling this setting will route this API call securely via the Firebase Cloud Functions. ![private-cloud-func.png](https://docs.flutterflow.io/assets/images/private-cloud-func-5752d692200c53e625e1907c0d726101.png) To make an API Call Private, open the **Advanced Settings** tab, turn on the **Make Private** toggle, Click **Save,** and then **Deploy APIs**. Optionally, you can force a user to be authenticated via the Firebase authentication to make this API call. To do so, turn on the **Require Authentication** toggle. Private APIs are deployed as [**Cloud Functions**](https://firebase.google.com/docs/functions) within your Firebase project. While deploying, you can configure the following options: - **Use Custom Name for Cloud Function**: When enabled, allows you to specify a custom name for the deployed Cloud Function. By default, this option is disabled and Cloud Function is named as `ffPrivateApiCall`. - **Private API Cloud Function Instances**: You can configure the number of Cloud Function instances to optimize performance and manage costs. - **Min Instances**: Set the minimum number of active instances to reduce latency and avoid cold starts. Setting this value greater than 0 will keep instances warm but may incur additional costs. - **Max Instances**: Define the maximum number of instances that can be scaled up based on demand. **Note**: To minimize costs, you can set the **Min Instances** value to 0. For detailed pricing information, refer to the [**Cloud Functions Pricing page**](https://cloud.google.com/functions/pricing-overview).
:::note * If you make the API call private, **Firebase** should be connected to your project. Follow the instructions on [**this page**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for integrating Firebase with FlutterFlow Studio. * If you enable the **Require Authentication** toggle, **Firebase Authentication** must be configured appropriately. Check out [**this page**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) for setting up authentication. ::: ### Process Streaming Response When working with APIs that send data continuously, like Server Sent Events (SSE), you can enable this option. This ensures your app can handle the ongoing flow of data over a long-lasting HTTP connection to display real-time updates. Imagine you're building a live sports score application. The API provides real-time updates on match scores. To handle this continuous stream of data, you need to enable this option. :::note You can usually determine if an API supports streaming by checking its documentation. Look for keywords like "event stream" or "processing chunks. ::: :::note[Learn More] Learn more about adding and using [**Streaming APIs**](https://docs.flutterflow.io/resources/backend-logic/streaming-api). ::: ### Change proxy settings By default, when you test your API calls inside our builder, Run mode, and Test mode, we use a proxy to route your calls to avoid the CORS issue. However, if you want to use your proxy, you can disable these settings and provide your proxy URL. To disable current proxy settings and provide your proxy URL: 1. Open the **Advanced Settings** tab. 2. Disable the **Use Proxy for Test** and/or **Use Proxy for Run/Test Mode**. 3. Enable the **Use** **Custom Proxy URL**. 4. Enter the **Proxy Prefix URL** (e.g., **https://your-proxy-server.com**). ![proxy-settings.png](https://docs.flutterflow.io/assets/images/proxy-settings-9aa01af579d7fda154ac7ff56df5de6f.png) ### Cache API Results You can enable this option for a specific API call. So when your app runs, multiple calls to this endpoint with the same arguments will be cached. Learn more about caching [here](https://docs.flutterflow.io/resources/backend-query#backend-query-caching). ### Decode Responses as UTF-8 Enabling this option ensures that the data you get from a server or website is read as UTF-8, a common way of storing text. Usually, a server or website tells you how to read its data, but sometimes it doesn't. This option makes sure you read the data in UTF-8 way even if the website doesn't tell you to do so. ### API Interceptors An interceptor allows you to capture and modify API requests and responses before they are sent or received by your app. For example, it can be used for tasks such as adding authentication tokens, logging, and error handling. It acts as a middleman between your app and the API server. So, when you make an API call from your app, the request goes through the interceptor first. The interceptor can then inspect the request, make changes to it (like adding headers or modifying the URL), and even cancel the request if needed. Similarly, when the server responds to your request, the response passes through the interceptor before reaching your app. Let's see how to add an interceptor: 1. Navigate to the **Advanced Settings** tab. 2. Click on **+ Add Interceptors** and select **+ Create New Interceptor** to open the [Custom Action](https://docs.flutterflow.io/concepts/custom-code/custom-actions) editor. 3. Enter the **Action Name**. 4. In the boilerplate code, add your custom code within the `onRequest` function for request interception and modification and within the `onResponse` function for response interception and modification. :::tip You can copy the boilerplate code into ChatGPT and request the completion for the specific interceptor code. Here is an [example](https://chat.openai.com/share/9fec2562-4a17-4b4c-8bf2-88043c9dae57). However, final adjustments may be needed. ::: 1. **Save Action** and check for any errors. 2. The newly created interceptor will be added to the **API interceptors** list. :::tip[Additonally] * You can add multiple interceptors to any API call. * When the same interceptor is used by multiple APIs, you can create an [**API group**](https://docs.flutterflow.io/resources/backend-logic/create-test-api#grouping-api-calls) and add the interceptor under the **Advanced Group Settings**. However, you can override the interceptor for any API within the group if you wish to. :::

:::tip[Watch a video] If you prefer watching a video tutorial, here's the one for you:
::: ## FAQs
Why is my Predefined Path not showing any options?

This often happens if you added the Predefined Path but forgot to save the API call in FlutterFlow Studio. Ensure you click Save after making any changes to your API call so FlutterFlow Studio can properly recognize and display your predefined paths.

Why am I getting a “Current variable is not valid” error?

This error typically indicates that the widget isn’t receiving the data type it expects. For example, passing a list of colors directly to a text widget will trigger the error. In such cases, convert or supply the data as a string (or another compatible type) so the widget can properly display it.

# Create & Test API Call > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-logic/create-test-api In this guide, you'll learn how to create and test API calls in FlutterFlow Studio. Integrating API calls allows your app to interact with external services, bringing in real-time data and functionality that enhances your app's capabilities. In this guide, you'll learn how to create and test API calls in FlutterFlow Studio. Integrating API calls allows your app to interact with external services, bringing in real-time data and functionality that enhances your app's capabilities. ## Create API Call To use an API in your app, you first need to create the API call in FlutterFlow Studio. Simply select API Calls from the left navigation menu, click the **+ Add** button, and choose **Create API Call**. Enter an **API Call Name**, select the **Method Type** (GET, POST, DELETE, PUT, or PATCH), and input the API URL of the service you wish to access.

:::tip[Method Types] The Method Type specifies the type of operation the API call will perform. Here’s a breakdown of common method types: - **GET:** Retrieves data from the server. - **POST:** Sends data to create or update a resource. - **DELETE:** Removes a resource from the server. - **PUT:** Updates or creates a resource with full data. - **PATCH:** Partially updates a resource. ::: ### Dynamic API URLs If you want to use a dynamic URL, for example, `` where 2 is dynamic and `` where 5 is dynamic: 1. Replace the hard-coded value with a meaningful name inside the brackets (e.g., from `https://reqres.in/api/users/2`to `https://reqres.in/api/users/[user_id]`). 2. And then, [**create a new variable**](https://docs.flutterflow.io/resources/backend-logic/rest-api#creating-variables) with the same name you provided inside the brackets. The further instructions are based on the **Method Type** you selected. ### For `GET` & `DELETE` call If you selected `GET` or `DELETE` as the method type, follow the steps below: 1. Optional: If the API call requires request headers such as an authorization token, [add a header](https://docs.flutterflow.io/resources/backend-logic/rest-api#passing-request-headers). 2. Optional: If the API call requires query parameters such as page number or user id, [add query parameters](https://docs.flutterflow.io/resources/backend-logic/rest-api#passing-query-parameters). 3. Click **Add Call** to save the API Call. :::caution After making any changes, you must save the API call. :::

In the above demo, a `GET` API call is defined to fetch users' data from [REQ | RES](https://reqres.in/) (which provides hosted REST API to try out HTTP requests). A demo of using a dynamic URL in a GET request is as follows:

To add such an API call: 1. Replace the hard-coded value with a meaningful name inside the brackets (e.g., from `https://reqres.in/api/users/2`to `https://reqres.in/api/users/[user_id]`). 2. And then, [create a new variable](https://docs.flutterflow.io/resources/backend-logic/rest-api#creating-variables) with the same name you provided inside the brackets. The DELETE API Call can also be defined similarly; just make sure you select the **Method Type** as ***DELETE***. ### For `POST`, `PUT` & `PATCH` call If you have selected **POST request**, follow the steps below: 1. Optional: If the API call requires request headers such as an authorization token, [add a header](https://docs.flutterflow.io/resources/backend-logic/rest-api#passing-request-headers). 2. [Create a request body](https://docs.flutterflow.io/resources/backend-logic/rest-api#creating-request-body) for the API call. 3. Click **Add Call** to save the API Call. :::caution After making any changes, you must save the API call. :::

In this demo, a POST API call is defined with two variables, `userName` and `userJob`. The variables are used inside the JSON request body. The PUT and PATCH API calls can be defined similarly; make sure you enter a valid API URL endpoint and select the correct Method Type. ## Grouping API calls You can create a group of API calls that share the same base URL. Grouping the API calls helps you add all request headers (e.g., auth token) at once, and they will be automatically added for all the API calls inside the group. :::caution For [**private APIs**](https://docs.flutterflow.io/resources/backend-logic/rest-api#private-api-calls), headers defined within the group will not be automatically included. You'll need to manually add headers for APIs marked as private. ::: To create the API Group: 1. Click on the **+** button (top left side) and select the **Create API Group**. 2. Enter the **API Group Name**. 3. Enter the **API Base URL**. This should be the portion that is common in all the APIs. **Note**: Do not keep the '/' in the end. 4. You can add request headers by clicking on the **+ Add Header** button. See detailed instructions on how to [add headers](https://docs.flutterflow.io/resources/backend-logic/rest-api#headers). 5. Click **Add Group**. This will display the group on the left side. 6. Open the newly created API group, and click on the **+ Add API Call**. 7. Add the API call as you would normally do. **Note**: Inside the API endpoint, enter the URL portion that starts after the base URL.

## Import API definitions We allow you to add multiple API call definitions by importing them directly from the [Swagger/OpenAPI](https://swagger.io/) in bulk. With just a simple click, you can add a large number of APIs, significantly reducing the time and effort needed to create them manually. Furthermore, the ability to import Swagger/OpenAPI definitions directly into FlutterFlow Studio eliminates the risk of errors that may occur when creating API definitions manually, ensuring that applications are reliable and efficient. :::note We also add all settings that are required to run the API, such as [headers](https://docs.flutterflow.io/resources/backend-logic/rest-api#headers), [query parameters](https://docs.flutterflow.io/resources/backend-logic/rest-api#query-parameters), [variables](https://docs.flutterflow.io/resources/backend-logic/rest-api#variables), and body as they are defined in the Swagger file. However, you might need to replace the hard-coded values in [Body](https://docs.flutterflow.io/resources/backend-logic/rest-api#body) text with the [variables](https://docs.flutterflow.io/resources/backend-logic/rest-api#variables). ::: :::caution Please note that while it is possible to import APIs created with OAS 2.0 in FlutterFlow Studio, you might face some issues, such as the body request being lost during the import process. Our import functionality is built based on the OAS 3.0 standard, so for the best experience and compatibility, it is recommended to use APIs that adhere to OAS 3.0 or above. ::: To import API call definitions: 1. Click the **Import OpenAPI** icon. This opens the **Import API Definitions** dialog. 2. Drag and drop one Swagger or OpenAPI file onto the drop zone, or click **Browse files** and select the file. The file must be a `.json`, `.yaml`, or `.yml` file. The dialog accepts one file at a time. 3. If your project has no API calls or API groups yet and the file imports without warnings, FlutterFlow Studio imports the APIs right away and closes the dialog. Otherwise, the **Review API import** dialog opens. Review the changes, and then click **Import APIs** (for a new group) or **Apply updates** (for an existing group). 4. After the import, the API calls appear as a [group](#grouping-api-calls), named after the `info.title` value in the file. If the file has no title, add one to the file before you import it. Here's an example of importing API calls in bulk, taken from [here](https://editor.swagger.io/).

:::note Save or discard any unsaved edits to your API calls before you import. The import doesn't start while edits are pending. ::: ### Review changes before you import When you import a file into a project that already has API calls, the **Review API import** dialog shows what the import changes before anything is saved. Re-importing a file no longer replaces the group and discards your variables, response mappings, and settings.

At the top of the dialog, set the following: - **Import into**: Select **Create a new API group**, or select **Update** followed by the name of an existing group. FlutterFlow Studio preselects an existing group only when its name matches the title in the file. - **Import mode**: Appears when you update an existing group. - **Preserve configuration**: Applies the changes you select and keeps your variables, response mappings, and settings. - **Reset configuration**: Replaces the group with the uploaded file and resets its configuration. This option isn't available if some endpoints in the file couldn't be imported. Select **Change file** to upload a different file. The left side of the dialog lists **Group & shared changes** and each API call in the file. Each API call is marked **Added**, **Updated**, or **Removed**, with a count of each at the top. Select **Changes only** to hide API calls that are unchanged. In **Preserve configuration** mode, use the toggle on an API call to include or skip its changes. Select an item to see its details in three tabs: - **Configuration**: Field-by-field changes to the URL, variables, headers, and other settings. Select or clear a change to include or skip it. If you edited a field in FlutterFlow Studio and the file also changes it, the change is unchecked by default so that your edit is kept. Select it to apply the change from the file. - **Swagger source**: A side-by-side comparison of the **Previous Swagger** and **Uploaded Swagger** definitions, including the schemas that the API call references. Changes to response schemas appear here for review, but FlutterFlow Studio doesn't generate response mappings from them. - **After import**: A preview of the configuration that FlutterFlow Studio saves with your current selections. If an API call is used in your app, the details show how many actions or queries use it. Click **Apply updates** to save the changes you selected. If you removed API calls, FlutterFlow Studio asks you to confirm. In **Reset configuration** mode, the button is **Replace all**, and FlutterFlow Studio asks you to confirm that existing variable values, response mappings, shared headers, and API settings are reset. If you skip changes that don't conflict with your edits, they appear again the next time you import the file. :::note If the file contains endpoints that can't be imported, the dialog shows a warning count. Select **Show details** to see which endpoints. While warnings exist, you can't remove API calls or reset the group, so a partial import never deletes your existing API calls. ::: :::note If you import a file into a group that was created before this review existed, there's no previous definition to compare against. In that case, your edits and removals are kept unless you select them. ::: ## Testing API calls You should always test your API call before using it inside your app. We make it easy for you to try the API call inside our builder. To test the API call along with its response, follow the steps below: 1. Select an API call you have already created or are currently defining, and go to the **Response & Test** tab. 2. On the left side, you will see the **Variables** section, where you can enter the values for the variables defined for your API call. 3. On the right, the **Preview** section lets you check the API URL, request headers, request body, and response. In the **Test Response** tab, you can view the full API response, including both the JSON format and raw body text, as well as the response header. 4. Click **Test API Call** to trigger the API call. You'll notice that the status of the GET request is displayed, and if it's successful (status code `200`), the result returned from that request will also be displayed below. 5. Any value of the JSON result can be accessed by [defining the JSON path](https://docs.flutterflow.io/resources/backend-logic/rest-api#json-path).

The demo below shows the testing of creating a new user using a POST request. The API Call takes two variables: `userName` and `userJob`. The successful POST request returns a status code of `201`. :::note The testing of `PUT` and `PATCH` requests would also be similar to this. :::

## API Call [Action] Once the API calls are defined in your FlutterFlow Studio project, you can use them wherever needed. Open the Action Flow Editor on the widget where the API call should be triggered. After selecting the desired Action Trigger, search for "API Calls" in the Actions dropdown and select the API call you want to use. ![use-api-call.png](https://docs.flutterflow.io/assets/images/use-api-call-ee46df3313018e6348554a1c7c8fdd68.png) :::tip You can also add the API Call as a [**Backend Query**](https://docs.flutterflow.io/resources/backend-query/api-call-query) that gets triggered automatically when the page or widget is loaded on the screen. ::: Go to your project and follow the steps below to define the Action to any widget. 1. Select the **Widget** (e.g., Button) on which you want to define the action. 2. Select **Actions** from the Properties panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on the **+ Add Action**. 4. On the right side, search and select the **API Call** (under *Backend/Database*) action. 1. Select the **Group or Call Name** from the dropdown. 2. Optional: If your API call requires variables (e.g., auth token, query parameters, user id, etc.), pass their value by clicking on the **+ Variable** button. 3. The **Action Output Variable Name** helps you retrieve the response of an API call. By default, we set it to any random name. However, you can change it to a meaningful name if you wish to. (e.g., loginResponse). 4. You can add a conditional action that checks if the API call is succeeded. 5. If the API call is succeeded, all actions under the TRUE path will be executed. For example, [navigate](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action) to the home page if the login is successful. 6. If the API call is failed, all actions under the FALSE path will be executed. For example, [showing a snackbar](https://docs.flutterflow.io/resources/ui/pages/scaffold#snackbar) if the login is unsuccessful.

# SOAP APIs > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-logic/soap-api Learn how to use SOAP APIs in your backend logic with FlutterFlow Studio. SOAP APIs (Simple Object Access Protocol) provide a standardized way to communicate between systems, typically using XML as the message format and operating over protocols such as HTTP, SMTP, and more. Unlike REST APIs, which use a flexible request/response model and typically exchange data in JSON, SOAP APIs are built around a formal contract defined by WSDL. This contract ensures strict adherence to communication standards, making SOAP APIs more rigid but also more reliable and secure—ideal for enterprise applications requiring transactional integrity and guaranteed message delivery. SOAP APIs are particularly well-suited for scenarios where robust security and detailed error handling are required, such as in financial services or telecommunications. ### Difference between SOAP APIs and REST APIs: **Protocol and Message Format**: SOAP is protocol-based with XML messaging, while REST is more flexible, using HTTP methods and supporting multiple data formats like JSON and XML. **Connection Lifecycle**: SOAP operates with independent requests and responses, while REST is stateless, where each request is independent, making REST more scalable and easier to manage. **Use Case**: SOAP is preferred in scenarios where formal contracts and high security are required, while REST is more suitable for lightweight, scalable web services. **SOAP Example response** ```xml Red Dragons Silver Sharks 2-1 ``` **REST Example response** ```json { "event": "match_score", "data": { "team1": "Red Dragons", "team2": "Silver Sharks", "score": "2-1" } } ``` ## Building an App This guide provides a step-by-step instructions on how to add and use SOAP APIs to build an example app that displays a list of countries. Upon tapping on a country name, the user is taken to a details page where the country flag is displayed. By following these instructions, you can learn how to add SOAP APIs into your app and create a basic navigation flow. The final app looks like this:

:::note[What you'll learn] - How to create SOAP APIs. - Creating API with dynamic data in the request body. - Parsing XML response. - How to navigate and pass data to a new page. ::: To build such an app, you will need the following pages. 1. **HomePage**: It shows a list of all countries. 2. **CountryDetails**: Shows the country flag. Here's how you'll navigate between these pages: ![Navigation flow](https://docs.flutterflow.io/assets/images/navigation-flow-6713872bd4dceb0837937cdb61fffb33.avif) The steps to build the app are as follows: ### 1. Build UI Let's start with building the UI for both pages. #### 1.1 Home page On this page you display the list of all countries using [**ListView**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#listview-widget) and [**ListTile**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#listview-widget) widgets. ![HomePage](https://docs.flutterflow.io/assets/images/home-page-134fb34f64d264818ddd7863eef4c18a.avif) #### 1.2 Country details page This page shows the country flag using the [**Image**](https://docs.flutterflow.io/resources/ui/widgets/image) widget. ![CountryDetails Page](https://docs.flutterflow.io/assets/images/details-page-8c62cc0c8054409306e24291f135b027.avif) ### 2. Create APIs For building this example, we will use two APIs from Postman's [**Public SOAP APIs**](https://www.postman.com/cs-demo/workspace/public-soap-apis). Here are they: 1. [**getCountries**](https://www.postman.com/cs-demo/workspace/public-soap-apis/request/8854915-96a53688-6305-45be-ab8b-ca1d1c88f830) 2. [**getCountryFlag**](https://www.postman.com/cs-demo/workspace/public-soap-apis/request/8854915-4f5fae60-9ae1-4b77-8518-59e9143b8fb4) Before you build anything related to APIs in your app, you must create and test the APIs to make sure all the APIs are working correctly. So let's [create and test](https://docs.flutterflow.io/resources/backend-logic/create-test-api) these APIs in our project. #### 2.1 getCountries This API retrieves a list of all countries' names and codes. You can add this API by following the instructions [here](https://docs.flutterflow.io/resources/backend-logic/create-test-api). :::note It's **important** to note that you need to include the proper *Header* in your requests, such as "**Content-Type: text/xml; charset=utf-8**", and set the request *Body* type to "**Text**". ::: Here's how you do it:

#### 2.2 getCountryFlag This API gets you the country's flag based on its code. You can pass the country code dynamically into the request body by creating a variable. See how to do it [here](https://docs.flutterflow.io/resources/backend-logic/rest-api#creating-variables). **Request body** ![request-body](https://docs.flutterflow.io/assets/images/request-body-a74543aa5908052ab57a91ead422d9f9.avif) **Header** ![header](https://docs.flutterflow.io/assets/images/header-5bfd5e07131507fcd5758e077529bb49.avif) ### 3. Create custom actions The APIs you added in the previous step return the result in [XML](https://www.w3schools.com/xml/xml_whatis.asp) format, which needs to be parsed to extract relevant data or information. This can be accomplished using a [custom action](https://docs.flutterflow.io/concepts/custom-code/custom-actions). The custom action can utilize the '[xml](https://pub.dev/packages/xml)' package to parse the XML response and retrieve data in a format that can be easily displayed on UI widgets. For this example, you need to create two custom actions that parse the result for two APIs. Here are they: #### 3.1 parseListofCountries This custom action parses the result of [getCountries](#21-getcountries) API and gives the list of countries in a *List* variable with a *Type* *String*. Here's the code with an explanation in the comments: ```dart // Automatic FlutterFlow imports import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/custom_code/actions/index.dart'; // Imports other custom actions import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom action code // DO NOT REMOVE OR MODIFY THE CODE ABOVE! import 'package:xml/xml.dart'; Future> parseListofCountries(String xmlResponse) async { final document = XmlDocument.parse(xmlResponse); final countryList = []; // Create an empty list to hold the countries // Find all elements with tag 'm:tCountryCodeAndName' final countryElements = document.findAllElements('m:tCountryCodeAndName'); // Loop through all the 'm:tCountryCodeAndName' elements found above for (final countryElement in countryElements) { // Extract the country code from the element final countryCode = countryElement.findElements('m:sISOCode').single.text; // Extract the country name from the element final countryName = countryElement.findElements('m:sName').single.text; // Add the country code and name to the country list as a single string countryList.add('$countryCode - $countryName'); } print(countryList); return countryList; } ``` Here's how it looks after adding: ![Custom action to parse list of countries](https://docs.flutterflow.io/assets/images/custom-action-af569d65f98ed6e56c1d1f4e08195a66.png) #### 3.2 parseCountryDetails This custom action parses the result of [**getCountryFlag**](#22-getcountryflag) API. It uses method chaining to navigate to the desired element and retrieve the flag URL. Here's the code with an explanation in the comments: ```dart // Automatic FlutterFlow imports import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/custom_code/actions/index.dart'; // Imports other custom actions import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom action code // DO NOT REMOVE OR MODIFY THE CODE ABOVE! import 'package:xml/xml.dart'; Future parseCountryDetails(String xmlResponse) async { final document = XmlDocument.parse(xmlResponse); return document .getElement('soap:Envelope')! // Access the soap:Envelope element .getElement('soap:Body')! // Access the soap:Body element .getElement('m:CountryFlagResponse')! // Access the m:CountryFlagResponse element .getElement('m:CountryFlagResult')! // Access the m:CountryFlagResult element .text // Retrieve the text value of the element .trim(); // Trim any leading or trailing whitespaces } ``` Here's how it looks after adding: ![Custom action to parse country flag response](https://docs.flutterflow.io/assets/images/parse-country-flag-response-377ed062b1c56d4a256ff0c799e20325.png) ### 4. Showing a list of countries You can now proceed to display the country list in *HomePage*. Here are the steps you should follow: 1. Open the HomePage. 2. Create a [page state](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#creating-a-page-state) variable (i.e., *countries*) to hold the list of countries. This will be used to bind data in a ListView. ![Page state variable](https://docs.flutterflow.io/assets/images/page-state-variable-38a6dd1d354b5ee0a2b784545b4d1481.png) 3. Select the page and add the following action chain. 1. The API call to [getCountries](#21-getcountries). 2. On success, [add a custom action](https://docs.flutterflow.io/concepts/custom-code/custom-actions) to [parseListOfCountries](#31-parselistofcountries). It's **important** to note that you must pass the result of a previous API call as a function argument and set the **API Response Options** to **Raw Body Text**. Also, add the *Action Output Variable Name*. 3. Add the [update page state](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#update-page-state-action) action and set the variable (i.e., *countries*) value with the output of the custom action (previously added). Ensure you keep the **Update Type** to **Rebuild Current Page**.

4. On ListView, [generate dynamic children](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/generate-dynamic-children) using the page state variable. 5. The page state variable stores the country name and code as a single string (e.g., Australia - AT). To display the name and code separately in a *ListTile*, we can use a [inline function](https://docs.flutterflow.io/resources/functions/utility#inline-function-code-expressions). To display the country name, we can use `var1.split("-")[1].trim()`, where `var1` is the current item in the list. To display the country code, we can use the same expression and replace `[1]` with `[0]`.

### 5. Navigate to the country details page On tapping the country name (ListView > ListTile widget), you will navigate to the *CountryDetails* page and pass the country code. This will be used to retrieve the flag of the country in the next step. To do so: 1. Select the **ListTile** widget and add an [action to navigate](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action) to the *CountryDetails* page. 2. Inside this action, click on the **Define** button. This will open the *CountryDetails* page, where you can define a parameter that will accept the country code. 3. After defining the parameter, open this action again and pass the country code using the code expression we used in the previous step (e.g., `var1.split("-")[0].trim()`). **Parameter on CountryDetails page** ![Parameter on CountryDetails page](https://docs.flutterflow.io/assets/images/parameter-on-country-details-page-dd9b6607c8abbdae411027f142c886f0.png) **Passing country code while navigating to CountryDetails page** ![Passing country code while navigating to CountryDetails page](https://docs.flutterflow.io/assets/images/passing-country-code-0108630a062cae5785f4316069325fed.png) ### 6. Show country flag Whenever this page opens, it will have the country code (as a page parameter). You can use it to make an API call and get the respective country flag. Here are the step-by-step instructions: 1. Open the *CountryPage*. 2. Create a [page state](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#creating-a-page-state) variable with **Type** as **ImagePath** (i.e., *flagURL*) to hold the URL of the flag image. This will be used to display in the *Image* widget. ![PageState variable to hold flag URL](https://docs.flutterflow.io/assets/images/hold-flag-url-7e35a2108913fb7d71827ad82c21dfe0.png) 3. Select the page and add the following action chain. 1. The API call to [getCountryFlag](#22-getcountryflag). 2. On success, [add a custom action](https://docs.flutterflow.io/concepts/custom-code/custom-actions) to [parseCountryDetails](#32-parsecountrydetails). It's **important** to note that you must pass the result of a previous API call as a function argument and set the **API Response Options** to **Raw Body Text**. Also, add the *Action Output Variable Name*. 3. Add the [update page state](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#update-page-state-action) action and set the variable (i.e., *flagURL*) value with the output previously added custom action. Ensure you keep the **Update Type** to **Rebuild Current Page**.

4. Now simply use the page state variable to display the flag URL in the *Image* widget. ![Using page state variable to display image](https://docs.flutterflow.io/assets/images/use-page-state-to-display-04bdc5cd88b92b9be1ff101f9507e8e4.png) ## Get the example app Get the clonable version of this app [here](https://app.flutterflow.io/project/soap-countries-4tbmom). # Streaming APIs > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-logic/streaming-api Learn how to use streaming APIs in your backend logic with FlutterFlow Studio. Streaming APIs provide a continuous flow of data over a long-lived HTTP connection, enabling real-time updates for your application. Unlike REST APIs, which deliver data in response to specific requests, streaming APIs are designed to maintain an open connection between the client and the server, continuously sending data as it becomes available. This is particularly useful for applications that require live updates, such as live sports scores, stock market tickers, chat applications, and real-time notifications. This reduces latency and improves the user experience by providing immediate feedback. The most common protocol used for streaming APIs is Server Sent Events (SSE), but others like WebSockets can also be used depending on the application's requirements. ### Difference between REST APIs and Streaming APIs The primary difference between REST APIs and Streaming APIs lies in their data delivery methods: * **REST APIs**: + **Request/Response Model**: The client sends a request, and the server responds with the data. + **Connection Lifecycle**: Each request/response pair is independent, and the server closes the connection after sending the response. + **Use Case**: Suitable for applications where data doesn't change frequently and real-time updates aren't critical. + **Example response**: ``` { "event": "match_score", "data": { "team1": "Red Dragons", "team2": "Silver Sharks", "score": "2-1" } } ``` * **Streaming APIs (Server Sent Events)**: + **Continuous Data Stream**: The server maintains an open connection and continuously sends data to the client as it becomes available. + **Connection Lifecycle**: The connection remains open, allowing the server to push new data to the client without the client having to request it. + **Use Case**: Ideal for applications requiring real-time updates, such as live sports scores, real-time notifications, and live chat applications. + **Example response**: ``` event: match_score data: {"team1": "Red Dragons", "team2": "Silver Sharks", "score": "2-1"} event: match_score data: {"team1": "Red Dragons", "team2": "Silver Sharks", "score": "3-1"} event: match_score data: {"team1": "Red Dragons", "team2": "Silver Sharks", "score": "3-2"} ``` ## Example: AI Review Summary Let's see how you can use streaming APIs in FlutterFlow Studio by building an example that allows users to see an AI summary of product reviews. On page load, the app displays the AI summary in real-time, letting users watch the analysis unfold as it's being generated. The final app looks like this:

The steps to build the app are as follows: 1. [Build UI](#1-build-ui) 2. [Create API](#2-create-api) 3. [Create page state variable](#3-create-page-state-variables) 4. [Trigger and Parse API response](#4-trigger-and-extract-data-from-api-response) 5. [Extract chart data](#5-extract-chart-data) ### 1. Build UI The user interface includes a section for the average rating, and number of reviews, followed by a detailed summary of the reviews including pros, cons, and sentiment distribution visualization. Here are key widgets to build the page: * [**Text Widget**](https://docs.flutterflow.io/resources/ui/widgets/text): Displays the AI-generated summary of the reviews and a list of the positive and negative points mentioned in the reviews. * [**Chart (Bar chart) Widget**](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/chart/bar-chart): Visual representation of the sentiment distribution (positive, neutral, negative) in a bar chart.

![streaming-api-example-demo.png](https://docs.flutterflow.io/assets/images/streaming-api-example-demo-76340fcccad2d986236d0ff057a0e2eb.png) ### 2. Create API For building this app, we will use [OpenAI's Chat Completion API](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) to generate a summary based on given reviews. Before you build anything related to APIs in your app, it's essential to create and test the APIs to ensure they work correctly. So let's [create and test](https://docs.flutterflow.io/resources/backend-logic/create-test-api) the Chat Completion API in our project. Once created, open the **Advanced Settings** and **enable** the **Process Streaming Response** toggle. Here's how you do it:

### 3. Create page state variables In this example, to hold and display the result of the generated AI summary, you'll need two variables. 1. `summary`: This variable will hold the full text of the summary that includes the overall sentiment of the reviews, key points mentioned by customers, and lists of pros and cons. It is initialized as an empty string and will later be updated with the AI-generated text. 2. `sentimentValues`: This variable will store the sentiment distribution values. It is a list of *double* representing the number of positive, neutral, and negative reviews. **Note that**, these values will be used to provide the *Bar Values* in a bar chart. It is initialized with three zeros and will later be updated with the actual counts of positive, neutral, and negative reviews. ![streaming-page-state.png](https://docs.flutterflow.io/assets/images/streaming-page-state-dd31cbe47a26370ec079b4434bee871c.png) ### 4. Trigger and extract data from API response You can trigger the streaming API just like any other regular API. However, the method of extracting and parsing data differs from that of a standard API. Unlike non-streaming APIs, where you receive a response in an action output variable, the streaming API provides data through the following response actions: * **onMessage:** This action is triggered every time a new piece of data is received from the streaming API. You can use this action to update your UI or perform any logic with the incoming data in real-time. * **onError:** This action is triggered when there is an error in the streaming connection. You can use this action to handle errors gracefully, such as displaying an error message to the user or attempting to reconnect. * **onClose:** This action is triggered when the streaming connection is closed. You can use this action to perform cleanup tasks or to notify the user that the stream has ended. Whenever the data is received, you can access the response body via the **OnMessage > Set Variable menu > Action Parameters > OnMessageInput**. and then use the [**Response Stream Message Options**](#response-stream-message-options) to extract the data. For this specific example, we use the *Server Sent Event Stream Data JSON* option and then use this JSON path `$['choices'][0]['delta']['content']` to retrieve the story data. Here's how exactly you do it:
### 5. Extract chart data The API returns a detailed summary as text, but to display counts of positive, neutral, and negative reviews on chart, you need to extract these data from the text. To achieve this, you can write a simple [custom function](https://docs.flutterflow.io/concepts/custom-code/custom-functions). Once the stream ends, pass the full text to the custom function to extract the relevant data and save the output in the `sentimentValues` page state variable we created earlier. Here's how you do it:

:::tip * After saving the`sentimentValues`, it’s a good idea to remove the same data points from the generated review text to avoid redundancy. * Similarly, you can extract other data like 'pros' and 'cons' and display them the way you like. ::: ## Response Stream Message Options When working with Server Sent Events (SSE) in FlutterFlow Studio, it's essential to understand how to process and handle the various components of the event messages. FlutterFlow Studio provides several options that capture different parts of the SSE. Here are they: ### Server Sent Event Data JSON (Type: JSON) This field captures the result of JSON parsing. For example: ``` event: chat data: {"response": "hello", "version": 7} id: 2 ``` The Server Sent Event Data JSON would be: ``` { "response": "hello", "version": 7 } ``` **Note that** If the data is not in JSON format, it will be null: ``` event: ping data: Server time is 2024-06-28T11:52:56+00:00 id: 2 ``` The Server Sent Event Data JSON would be `null`. ### Server Sent Event Data Text (Type: String) This field contains just the text of the "data" field from the SSE. If there are multiple "data" entries, they are concatenated with a new line. For example, from the event: ``` event: ping data: Server time is 2024-06-28T11:52:56+00:00 id: 2 ``` The Server Sent Event Data Text would be: `Server time is 2024-06-28T11:52:56+00:00` And from the event: ``` event: journalEntry data: Today I went to the park. data: For Lunch I had a sandwich. id: 3 ``` The Server Sent Event Data Text would be: ``` Today I went to the park. For Lunch I had a sandwich. ``` ### Server Sent Event Name (Type: String) This field contains the text of the "event" field from the SSE. For example: ``` event: ping data: Server time is 2024-06-28T11:52:56+00:00 id: 2 ``` The Server Sent Event Name would be `ping`. ### Server Sent Event ID (Type: Integer) This field contains the text of the "id" field from the SSE, typically used to keep track of the last sent item from the server. For example: ``` event: ping data: Server time is 2024-06-28T11:52:56+00:00 id: 2 ``` The Server Sent Event ID would be `2`. ### Server Sent Event Retry (Type: String?) This field contains the "retry" field from the SSE, typically used to communicate to the client when to try reconnecting to the server. ### Message Text (Type: String) This includes the entire Server Sent Event (SSE) message, including new lines and fields ('data', 'event', 'id', 'retry'). For example: ``` event: ping data: Server time is 2024-06-28T11:52:56+00:00 id: 2 ``` ## FAQs
Why does it show 'null'?

The "null" value appears in the Server Sent Event Data JSON field when the data is not in JSON format. For instance, the following event data is not in JSON format: ``` event: ping data: Server time is 2024-06-28T11:52:56+00:00 id: 2 ``` The Server Sent Event Data JSON will be `null` because the data cannot be parsed as JSON. You can fix this by using the following expression inside the [Inline Function](https://docs.flutterflow.io/resources/functions/utility#inline-function-code-expressions) to handle the `null` case: ``` responseData ?? '' ``` This expression ensures that if `responseData` is `null`, it will return an empty string instead.

# Backend Query > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-query Learn about backend queries in your FlutterFlow Studio app, including how to set up and manage queries. **Backend Query** helps you to trigger a query automatically whenever a user navigates to the page containing the query. You can set a Backend Query on a particular widget or an entire page. The information retrieved using the Backend Query can be used in any widget present inside. ## Types of Query We offer you the following types of Backend Queries that you can specify on any widget or page. * [**Query Collection or Table**](https://docs.flutterflow.io/resources/backend-query/query-collection)**:** This query type is used to fetch a single record or a list of records from a Firestore Collection or Supabase Table. * [**Document from Reference**](https://docs.flutterflow.io/resources/backend-query/document-from-reference)**:** Used to retrieve the details from a document reference. * [**API Call Query**](https://docs.flutterflow.io/resources/backend-query/api-call-query)**:** Used to initiate an API call. * [**SQLite Query**](https://docs.flutterflow.io/resources/backend-query/sqlite-query): Used to execute the SQL statements. * [**Algolia Search**](https://docs.flutterflow.io/resources/backend-query/algolia-search-query)**:** Used to trigger an Algolia search on a Firestore Collection. ## Difference between Actions & Backend Query | **Aspect** | **Actions** | **Backend Queries** | |------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------| | **Trigger** | Triggered by user interactions such as taps, double taps, or long presses on widgets, or they can be executed automatically on page load. | Automatically triggered when the user navigates to a page or widget containing the query. | | **Usage** | Can be used to navigate between pages, show messages, update variables, make API calls, and more. | For apps needing instant updates like chat or live scores, Backend Queries can auto-refresh the UI with the latest database changes. | | **Multiplicity** | You can specify multiple actions on the same widget. | Only one Backend Query can be specified on a particular widget or page. | | **Conditional Execution** | Can be conditional, meaning they can execute different actions on certain conditions. | - | | **Caching** | - | Can include caching mechanisms to improve app performance by reducing the number of server calls and providing offline access to data. | | **Handling States** | - | Often involve handling loading states and empty states, as the data fetching process can take time and might not always return results. | | **Data Fetching** | - | Only used to fetch data from a backend. | ## Change loading indicator While the backend query is busy retrieving results, it shows the default *Project Theme Loading Indicator* (which you can change from [**Navigation menu**](https://docs.flutterflow.io/flutterflow-ui/builder#navigation-menu) *> Theme Settings > Design System > Loading Indicator*.) However, if you want to replace this with a custom loading indicator in a specific backend query, follow the instructions below:

To change the loading indicator: 1. Ensure you have added a backend query. 2. Open the **Backend Query** section (on the right side) and scroll down to the **Backend Query Loading Widget**. Open it by clicking on the arrow icon. 3. Set the **Loading Widget Type** to **Image**. You can also choose a [**Component**](https://docs.flutterflow.io/resources/ui/components/creating-components) if you have already designed a loading component. 4. Enable the **View in UI Builder**. This allows you to see your custom loading indicator on canvas (before you actually run the app). 5. Choose the **Image Type**, [add the image](https://docs.flutterflow.io/resources/ui/widgets/image#image-type), and adjust its **Padding** and **Width**. 6. To show the indicator in the center, turn on the **Center Image** toggle. 7. Run the app, and your custom loading indicator will appear while the data is being loaded.
## Copy Query Sometimes, you might want to display the same list of items with a little modification. For example, showing all Todo items and completed Todo items. In such a case, you can copy-paste the entire backend query to speed up the building process. This is helpful, especially when you have a complex backend query. To copy-paste the query: 1. Select the widget (e.g., ListView, GridView, etc.) where you have already added the backend query. 2. Select the **Backend Query** tab, and click the **Copy** button. 3. Now, select the widget (where you want to add the query), move to the **Backend Query** tab, and click **Paste Backend Query** button. 4. Click **Confirm**.
## Move query to parent widget You might want to utilize the same backend query on multiple widgets on a page. But if you do so, you end up making redundant server calls for the same thing. So, instead of copying it on every widget, you can move the query to any parent widget. The existing widgets will then use a generated variable derived from the parent widget's query. To move the query up to any parent widget, simply select the up arrow button and select the parent widget you would like the query to move to.
## Displaying empty list widget The *Empty List* widget is a widget used to display a message when there are no items in a list. This widget helps to provide a better user experience by displaying a message instead of just an empty screen. To display the empty list widget: 1. Ensure you have added a backend query on any scrollable widget, such as **ListView**, **GridView**, **Column**, **Row**, DataTable, and **StaggeredView**. 2. Select the scrollable widget (on which you have added the backend query), move to the properties panel, and turn on the **Show Empty List Widget**. 3. Set **Widget Type** to **Image** or **Component**. The further options are available based on what you choose. 4. Try toggling the **View in UI Builder**. This allows you to see your empty list widget on canvas (before you actually run the app). 5. You can also control the size and centering of the widget using the available options.
## Backend Query Caching Backend query caching refers to the process of storing the result of a backend query in a cache so that subsequent queries for the same data can be served directly from the cache rather than making a new query to the backend. Caching a query can bring significant benefits to your app, including improved performance and reduced server load. Additionally, caching can enable your app to function offline by serving cached results when there is no internet connection available. For example, an e-commerce app can cache product data, such as product descriptions, prices, and images, to avoid making unnecessary API calls for each page load. :::note Caching backend queries works for all [types of queries](#types-of-query). ::: :::tip[Single time Query] For Firebase queries, enable Single Time Query if you want the query to fetch data only once. Otherwise, the query operates in real-time, updating automatically as soon as the data changes. ::: ### When to cache In general, any data that is static, slowly changing, or read more often than they are updated can be cached to improve performance and reduce the load on the server. A few examples are 1. Static content such as images and videos. 2. Configuration data such as application settings or system parameters. 3. Data that is expensive to compute, such as complex reports or analytics. ### When NOT to cache Sometimes, it's not a good idea to cache the backend query. Here are some examples: 1. Large amounts of data can cause performance issues and may not be appropriate. 2. Sensitive or confidential data should not be cached, as it could lead to unauthorized access. 3. Frequently changing data, such as in real-time or near real-time scenarios, caching may not be appropriate as the cached data could quickly become stale or outdated. 4. Critical response time where the data needs to be up-to-date and accurate at all times. ### Example Let's see how to cache a backend query with an example app that shows a list of employees on the first page and employees' details on the second page. On the employee details page, the data is retrieved from a backend query and read more often than they are updated, so it's a good candidate to cache. To improve performance, you can cache the data on the details page so that it can be quickly retrieved and displayed to users. Here is how it looks:

:::note In the visual above, see how the loading indicator appears for the first time a query is made on the page. However, subsequent queries will retrieve the result from the cache, and the loading indicator will not be displayed again. ::: To cache the backend query: 1. Ensure you have added a backend query. For this example, to retrieve data from a Firebase document, we add a backend query at the page level as *Single Time Query*. We use a document reference to get the employee details.
![example-bq.png](https://docs.flutterflow.io/assets/images/example-bq-2e8203dff7f01fcac18d3e7ea5c25d0a.png)
Querying employee details using document reference
2. Open **Query Cache Settings** and **Enable Query Caching**. 3. Determine the **Scope** of the cache. If you set it to **App Level** and the *exact* same query is made on any other page of the app, it will display the result from the cache. However, if you set the **Page Level**, the cached result will be used only on that page if the query is made multiple times on the same page. 4. If the current query is completely new/different, create a **Query Name**. If not, and you want to use the cached result of this query (that might be created somewhere else), select the name from the list.

5. If we leave this example here, we'll have data inaccuracy issues. That means when any employee data is cached, the same data will be used for all employees, which is not what we want. We want to cache data for all individual employees. To do so, we can set the **Unique Key**. Here the unique key can be the employee id or the document reference. **Data inaccuracy without Unique Key**
**Adding Unique Key**

6. At this point, we have enabled the caching, but we still have one problem. Once the query is cached, it will be used forever, although we update the data in our backend. This is because we are not clearing or invalidating the cache at the appropriate time. To properly invalidate the cache, you can use the **Should Override Cache** property OR **Clear Query Cache** action. This helps you remove the cached data that has become stale or outdated. 1. The *Should Override Cache* property accepts a boolean (True/False). That means we can provide a variable (e.g., an *App State* variable named *isCacheOverride)* that knows when to override the cache. So create one and set it here. 2. Create one more *App State* variable, something like *lastCacheTime,* and set the current time as default. This will be used to save the time of results retrieved from the backend. You'll better understand how helpful it is in the logic we add in the next step.
![img_3.png](https://docs.flutterflow.io/assets/images/img_3-2cb11f7171f5524d3bc5c77565c48d51.png)
Setting Should Override Cache to App State variable

7. Now, we must add a logic that determines whether to override the cache (every time when the page is loaded) and set the *isCacheOverride* variable accordingly. Here is how it goes: 1. First, check if the *lastCacheTime* is set or not. If not, set the current time to it. 2. Then the idea is to create one custom action that checks if the current time is more than 30 minutes ahead of the *lastCacheTime*. **Note** that 30 minutes is the cache expiration time, and here, it is kept minimum just for simplification purposes; It's important to carefully choose the appropriate expiration time for your cache based on the nature of your data. 3. if **True** : 1. [Update](https://docs.flutterflow.io/resources/data-representation/app-state#update-app-state-action) the **lastCacheTime** with the current time and **isCacheOverride** to True. Make sure you keep the **Update Type** to **Rebuild Current Page** so that the backend query is made again, which will invalidate the cache and display updated data. 2. You can also add an action to [Clear Query Cache](#). 3. Continuing the same action flow, [wait](https://docs.flutterflow.io/resources/time-based-logic/wait-action) for 1 sec and again update **isCacheOverride** to **False** so that the cached result won't override on page load for the next 30 min.

:::note[Note] **Note** that in this example, we use both the *Clear Query Cache* action and the *Should Override Cache* property to clear or invalidate the cache. Although both perform the same task, it's generally considered better practice to explicitly *Clear Query Cache* rather than relying on the *Should Override Cache* bool. However, in certain cases, you may want to override the cache conditionally instead of with an explicit action, so the option is there. ::: Here is how the custom function looks in case you want to check: ``` bool isOverrideCacheAction(DateTime cacheTime) { // Add your function code here! return DateTime.now().difference(cacheTime).inMinutes > 30; } ```
![custom-func-cache-override.png](https://docs.flutterflow.io/assets/images/custom-func-cache-override-d3687d8170b91d2b91af9e9b031b0b1f.png)
Custom function to know if last cache time is more than 30 minutes
:::tip You can have a separate *lastCacheTime* variable for all the employee records to avoid any conflict with others. Failing to do so may keep on updating the common *lastCacheTime* variable, and you might not see updated data. For example, creating a list of JSON that contains the id and *lastCacheTime* of an employee might help. Like this: `{ "id": 1, "lastCacheTime": '2023-03-22T14:30:00+00:00', }` ::: ### Clear Query Cache [Action] This action provides a simple way to clear the query cache, which can be helpful in situations where the cached data is no longer accurate or needs to be refreshed. By executing this action, you reset the query cache, allowing the app to fetch and display the most up-to-date data. :::tip This can help improve app performance and ensure users see the most recent information available. ::: Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the [properties panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**. 3. Search and select the **Clear Query Cache** (under *State Management*) action. 4. Determine the **Scope** of the cache, whether it lives at the **App Level** or **Page Level**. 5. Set the **Query Name** to the one you gave while adding the query cache. 6. If you have set the **Unique Key** while caching a query, you should add the same key here as well. This ensures that the cache will be removed only for specific data.

# Query Collection / Table > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-query/query-collection Learn how to query a collection in your FlutterFlow Studio app. Quering Firestore Collection or Supabase Table helps you to retrieve a record (or a list of records) automatically whenever a user navigates to the page containing the query. The information that is present in the record can be used to update any widget present inside. :::note[Prerequisites] - To query Firestore collection, complete the [**Firebase setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) and have some data in a [**Collection**](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections). - To query Supabase table, complete the [**Supabase**](https://docs.flutterflow.io/integrations/supabase/setup) Setup and have some data in a [**table**](https://docs.flutterflow.io/integrations/supabase/setup#create-tables-in-supabase). ::: ## Defining the Query To add a Firestore collection or Supabase table query: 1. Select the widget or page where you want to run the query. 2. Open **Backend Query** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) and click **Add Query**. 3. Choose the backend source and records to return: - **Firestore:** Set the query type to **Query Collection**, select a **Collection**, then choose **List of Documents** or **Single Document**. - **Supabase:** Set the query type to **Supabase Query**, select a **Table**, then choose **List of Rows** or **Single Row**. 4. Configure any filters required by the query: - **Firestore:** Under **Filters**, click **+ Filter**, then select a field, relation, and comparison value. - **Supabase:** Under **Filters**, click **+ Add Filter**, then select a field, relation, and comparison value. To use the [full-text search](https://supabase.com/docs/guides/database/full-text-search), set **Relation** to **Search (Full-Text)**. Then choose a **Search Type**: - **Websearch (Recommended):** Supports user-friendly search syntax, including quoted phrases, `OR`, and excluding terms with a minus sign (`-`). - **All Words:** Returns rows that contain every search term. - **Phrase:** Returns rows that contain the search terms as a phrase. - **Raw tsquery:** Accepts PostgreSQL text-search operators for advanced queries. You can optionally, set **Language**, leave it empty to use the database's default configuration. Under **Value**, enter the text you want to find. 5. Under **Ordering**, click **+ Order By** for Firestore or **+ Add Order** for Supabase. Select the field and choose **Increasing** or **Decreasing**. 6. Configure the available optional settings: - **Hide Widget If No Match** (Firestore): Hides the queried widget when the query returns no matching documents. - **Ignore Empty Filter Values** (Firestore): Disabled by default, meaning the query will attempt to find documents with empty text fields if any filter value is empty. When enabled, the query will ignore fields with empty filter values instead. - **Filter on Null Values** (Firestore): By default, if any filter value is null, the query will ignore that filter. Enabling this option will include null filters in the query. - [**Enable Infinite Scroll**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#infinite-scroll-on-a-list-from-a-firestore-collection-or-supabase-table): Loads list results in pages as the user scrolls. Set the number of records loaded per page using **Page Size**. For Supabase, the table must have a primary key and the query must be ordered by it. - **Listen For Changes** (Firestore): Updates displayed documents when their data changes. This is enabled automatically when infinite scroll is turned on. 7. Click **Confirm**. 8. When a list query is applied to a flexible widget such as a **Column**, **Row**, or **ListView**, confirm that you want to generate dynamic children from the returned documents or rows when prompted.
:::caution[Limitations of Supabase Streaming with Filters] When using Supabase query with real-time updates enabled, you have the following limitations: - **Only One Filter is Supported:** Supabase streaming supports only a single filter. Combining multiple filters (e.g., `isActive = true AND city = 'Los Angeles'`) is not allowed. - **Delete Events are not Filterable:** Streaming queries do not detect deletions, even if the deleted row matches the filter condition. For example, If you are streaming rows with the filter `city = 'New York’` and a row is deleted, the query output will not reflect the deletion. - **Updates that remove Rows from Filters are not Tracked:** Changes that make a row no longer match the filter condition (e.g., updating `isActive` from `true` to `false`) will not trigger an update in the query output. For more details, refer to the limitations mentioned in the [**official Supabase docs**](https://supabase.com/docs/guides/realtime/postgres-changes?queryGroups=language&language=js&queryGroups=database-method&database-method=dashboard#delete-events-are-not-filterable). ::: ## Using Query Data The documents retrieved from the backend query can be used to set the record values to the widgets present inside. Follow the steps below to use the document record data: 1. Select the **widget** (eg, `Text`, `Image`, or `ToggleIcon`) on which you want to set the record data. 2. From the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel), select **Set from Variable**. 3. Choose the **Source** as the record variable (the variable gets automatically generated when you add the Collection query). 4. Under **Available Options**, select a field name from the dropdown. 5. You can also specify a **Default Value** (it is used if the record field is empty). 6. Click **Save**. You can follow similar steps for using the record data on the other widgets as well. **Display Data from Firestore Collection**

**Display Data from Supabase Table**

## FAQs
Why aren't real-time updates working for my table in Supabase project?

First, ensure that the **Single Time Query** option is disabled in the query where you've added it. Then, verify that the real-time feature is enabled for your table in Supabase project. You can find this option in the top-right corner of the table viewer. ![enable-realtime-updates-sb-table.avif](https://docs.flutterflow.io/assets/images/enable-realtime-updates-sb-table-95fa64a0cdbd78f1e79188e5bf7b1185.avif) Additionally, you can enable real-time updates when creating a new table. ![enable-realtime-updates-sb-table.avif](https://docs.flutterflow.io/assets/images/enable-realtime-updates-sb-table-2-7d1cd5f9ba25c093103146d03d897787.avif)

# Document from Reference > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-query/document-from-reference Learn how to retrieve a document from a reference in your FlutterFlow Studio app. This backend query would help you in retrieving information from a document reference. You will require the **Document from Reference** query if you have passed a document reference to a different page of the app and want to retrieve the actual document information from the reference. :::note[Prerequisites] In order to use this backend query, you should have: * Completed all the steps of [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for your project. * At least one **Firestore Collection** is defined in your project. ::: ## Defining the Query Go to your project page on FlutterFlow Studio and follow the steps below to define a **Document from Reference** backend query: 1. Select the **widget** (or page) on which to apply the query. 2. Select **Backend Query** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu). 3. Select the **Query Type** as ***Document from Reference***. 4. Choose a **Collection** from the dropdown to which the document reference belongs. 5. Select the **Source** as the record reference name.
## Using Query Data The document information retrieved from the backend query can now be set on the widgets present inside. Follow the steps below: 1. Select the **widget** (eg, `Text`) on which you want to set the record data. 2. From the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel), select **Set from Variable**. 3. Choose the **Source** as the record variable. 4. Under **Available Options**, select a field name. 5. You can also specify a **Default Value** (it is used if the record field is empty). 6. Click **Save**. You can follow similar steps for using the record data on the other widgets as well.
# API Call Query > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-query/api-call-query Learn how to perform an API call query in your FlutterFlow Studio app. You can use the **API Call Query** to trigger an API call automatically as soon as the page or widget is loaded. This is helpful if you want to retrieve the data from an API call and display it on a page or widget. For example, showing a list of items in a ListView, showing users details on several Text widgets.

:::note[Prerequisites] Before you add this query, ensure you [create an API call](https://docs.flutterflow.io/resources/backend-logic/rest-api) in your project ::: ## Adding API Call query Adding API call query comprises the following steps: 1. [Querying API call](#1-querying-api-call) 2. [Showing query data in UI element](#2-showing-query-data-in-ui-element) ### 1. Querying API call Go to your project page and follow the steps below to define an **API Call** backend query: 1. Select the **widget** (or page) on which to apply the query. 2. Select **Backend Query** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu). 3. Select the **Query Type** as ***API Call***. 4. Choose the API **Group or Call Name** from the dropdown. It would display all the API Calls created in your project. 5. If your API call requires variables (e.g., auth token, query parameters, user id, etc.), pass their value by clicking on the **+ Set Additional Variable** button. 6. Click **Confirm**.
### 2. Showing query data in UI element Once you have the API Call query defined, you can use the data retrieved from the query to display on widgets present inside. Follow the steps below: 1. Select the **widget** (e.g., `Text`) on which you want to display the data. 2. From the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel), select **Set from Variable**. 3. Select the **Source** as the **YOUR_API_CALL_NAME Response**. 4. Set the **API response Options** to **JSON Body**. 5. Set the **Available Options** to **JSON Path**. 6. Set the **JSON Path Name** to either the custom JSON path or use the already created JSON path. See how to [**create a JSON path**](https://docs.flutterflow.io/resources/backend-logic/rest-api#add-json-predefined-path). 7. Click **Confirm**.
# Algolia Search Query > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-query/algolia-search-query Learn how to perform an Algolia search query in your FlutterFlow Studio app. You can set up an **Algolia Search Backend Query** to automatically trigger a search as soon as the user navigates to the page. This allows users to find documents within a Firestore Collection by simply providing a search term. This approach is particularly useful for enhancing the user experience, such as dynamically refreshing search results in a **ListView** as the user types in a TextField, like real-time updates. :::note[Prerequisites] Before proceeding, ensure that you have **completed the [Algolia integration](https://docs.flutterflow.io/integrations/search/algolia-search#algolia-integration)** in FlutterFlow Studio. ::: To add an **Algolia Search Query**, begin by selecting the scrollable widget that will fetch the results, such as a **ListView**. In the **Properties Panel**, navigate to the **Backend Query** tab, click on **Add Query**, and set the **Query Type** to **Algolia Search**. Next, configure the search parameters: for **Firebase Collection**, select the Firestore collection you intend to search; for **Search Term**, choose **From Variable** and select the TextField's value (e.g., **Widget State > [Your TextField]**); and specify the optional **Max Results** to determine the number of search results.

# SQLite Query > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/backend-query/sqlite-query Learn how to perform SQLite queries in your FlutterFlow Studio app. SQLite Query can be set up to automatically execute SQL statements as soon as a page or widget loads. This feature is useful for fetching data from the database to display on a page or widget, such as populating a ListView with items or showing user preferences in Text widgets. ![img_4.png](https://docs.flutterflow.io/assets/images/img_4-47bd29266be6894e21641f3871e9798b.png) :::note[Prerequisites] Before you add this query, ensure you configure the database and define the query. Check detailed instructions [here](https://docs.flutterflow.io/integrations/database/sqlite). ::: ## Adding SQLite query Let's see how to display a list of items from the database using the SQLite query. Here are the steps: 1. [Add query](#1-add-query) 2. [Showing query data in UI element](#2-showing-query-data-in-ui-element) ### 1. Add query Go to your project page and follow the steps below to define an SQLite query: 1. Select the **widget** (or page) on which to apply the query. 2. Select **Backend Query** from the Properties Panel (the right menu). 3. Click **Add Query** and set the **Query Type** to **SQLite Query**. 4. Select the **Query Name**. (Only *Read Queries* will be displayed here.) 5. Click **Confirm**.
### 2. Showing query data in UI element Once you have the SQLite query defined, you can use the data retrieved from the query to display on widgets present inside. Follow the steps below: 1. Select the **widget** (e.g., `Text`) on which you want to display the data. 2. From the Properties Panel, open the **Set from Variable** menu **>** select **[your query name] Row** **>** select the column data that you want display here. 3. Click **Confirm**.
# Wait [Action] > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/time-based-logic/wait-action Learn how to use the Wait Action in your FlutterFlow Studio app to pause actions for a specified duration. The **Wait** action is used to pause the execution of a workflow for a specific amount of time. This is helpful when you want to delay the next step in a sequence, for example, to synchronize events, allow animations to complete, or ensure a condition is met before continuing. It’s a key concept in managing time-based logic within action flows. :::tip[Possible use cases] - **Show Splash Screen:** Delay the transition to the next page to allow the splash screen to be visible for a few seconds. - **Step-by-Step Tutorials:** Introduce timed delays between steps to guide users through a tutorial or onboarding flow. - **Chain Animations:** Add pauses between multiple animations for a more fluid and organized visual effect. :::
# Timer [Widget] > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/time-based-logic/timer-widget Learn how to use the Timer Widget in your FlutterFlow Studio app to manage timed events and actions. **Timer [Widget]** allows developers to create countdown or count-up timers within your page. It is particularly useful in scenarios where timing is crucial, such as quizzes, auctions, workout apps, and various time-sensitive activities. ## Use Cases - **Quizzes and Exams:** Enforcing time limits for answering questions. - **Auctions:** Displaying the remaining time for bids. - **Workouts:** Timing exercises and rest periods. - **Events:** Counting down to the start or end of an event. - **Productivity:** Using Pomodoro timers to manage work sessions and breaks. ## Timer Types - **Countdown Timer:** Counts down from a specified time to zero, often used in scenarios where a task or event needs to be completed within a set period. - **Count-up Timer:** Counts up from zero to a specified time or indefinitely, useful for tracking the duration of an event or activity. On adding the Timer widget to your page, you can specify the type of timer and other properties as mentioned here: ![timer-widget.png](https://docs.flutterflow.io/assets/images/timer-widget-003b5dec98bdbd979f826e8693f11640.png) ## On Timer End [Action Trigger] You can also specify a flow of actions when the timer ends. You can find this Action Trigger on clicking the Action Flow Editor on the Timer widget. ![timer-widget-action.png](https://docs.flutterflow.io/assets/images/timer-widget-action-d16ca9214fae45e4005bc40e35b5dec2.png) ## Controlling the Timer You can control the timer from anywhere on the page. Using any widget's Action Flow Editor, you can perform the following actions: - **Start Timer:** This starts the timer. If the timer is already started, triggering this type won't have any effect. - **Stop Timer:** This stops the timer. This will have effect only if the timer is started. - **Reset Timer:** This resets the timer and brings it to the initial state. ![timer-control.png](https://docs.flutterflow.io/assets/images/timer-control-61e5b36b9b03b1d9d93c08a4228b0f5d.png) ## Periodic Action vs Timer | Feature | Timer Widget | Periodic Action | |--------------------|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------| | **Purpose** | Used for single or non-repetitive timing events, often within user interfaces. | Used for repetitive tasks that need to run at regular intervals. | | **Usage** | To set a countdown timer, start/stop actions based on user input, or trigger actions after a specific duration. | For background tasks, monitoring, regular updates, and periodic checks. | | **Example** | Countdown timer in a quiz application. | Fetching new messages from a server every 5 minutes. | # Periodic Action > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/time-based-logic/periodic-action Learn how to use the Periodic Action in your FlutterFlow Studio app to perform actions at regular intervals. Periodic execution of logic refers to running a specific block of code or a set of actions at regular, defined intervals. This is useful for tasks that need to be repeated continuously or at specific time intervals. ## Use-cases - For tasks that need regular updates, such as fetching data from a server, monitoring system health, or updating a user interface. - In scenarios where periodic checks or maintenance tasks are required (e.g., cleaning up temporary files, sending periodic notifications). - Implementing polling mechanisms for checking changes in state or data. ## Start Periodic Action To create a periodic action workflow, add the **Start Periodic Action** action either on the **On Page Load** action trigger of your page or on any widget that should start the periodic action. The properties of the Periodic Action look like this: ![periodic-action.png](https://docs.flutterflow.io/assets/images/periodic-action-443603587a43e6ca0016f1e208f692d4.png) ## Stop Periodic Action You can call the **Stop Periodic Action** action from anywhere on the page or component to stop one or multiple periodic actions. :::danger[Dont forget to stop the Periodic Actions] Stopping a periodic action is crucial to prevent unnecessary resource consumption and potential performance issues. It ensures that tasks do not continue running in the background when they are no longer needed, which can help maintain the efficiency and responsiveness of your application. ::: ### Periodic Action vs Timer | Feature | Timer Widget | Periodic Action | |-------------|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| | **Purpose** | Used for single or non-repetitive timing events, often within user interfaces. | Used for repetitive tasks that need to run at regular intervals. | | **Usage** | To set a countdown timer, start/stop actions based on user input, or trigger actions after a specific duration. | For background tasks, monitoring, regular updates, and periodic checks. | | **Example** | Countdown timer in a quiz application. | Fetching new messages from a server every 5 minutes. | ### Periodic Actions vs Loops | Feature | Periodic Actions | Loops | |---------------------------|-----------------------------------------------------------------------------|------------------------------------------------------------------------| | **Purpose** | To execute a task at regular, defined intervals. | To execute a task repeatedly until a condition is met. | | **Execution Frequency** | Executes at specified time intervals (e.g., every 60 seconds). | Executes continuously until the loop condition is false. | | **Use Case** | Suitable for tasks needing regular updates, such as fetching new data. | Suitable for tasks requiring iteration over collections or repeated checks. | | **Control** | Can be started and stopped easily, allowing for controlled execution. | Runs until a break condition is met or the loop is explicitly stopped. | | **Resource Management** | Efficient, as it allows idle time between executions. | Can be resource-intensive if not managed properly, as it runs continuously. | | **Examples** | Fetching new offers from a server every 5 minutes. | Iterating over a list of items to process them one by one. | # Naming Variables & Functions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/style-guide Naming conventions for FlutterFlow Studio, including guidelines for widgets, components, state variables, constants, and more. To make your code more maintainable, readable, and consistent, it’s essential to adopt clear naming conventions for variables, functions, and components. Best practices for naming conventions in app development (especially for projects using Flutter), aim to improve code readability, maintainability, and consistency across the application. Here are some general guidelines tailored for different aspects of a Flutter project: Various naming styles (as suggested by [Dart Effective Style Guide](https://dart.dev/effective-dart/style#identifiers)): - **UpperCamelCase** (also known as PascalCase) names capitalize the first letter of each word, including the first. - **lowerCamelCase** (also known as camelCase) names capitalize the first letter of each word, except the first which is always lowercase, even if it's an acronym. - **lowercase_with_underscores** (also known as snake_case) names use only lowercase letters, even for acronyms, and separate words with _. ![various-naming-styles.png](https://docs.flutterflow.io/assets/images/various-naming-styles-1c972b9898f0f011be5caba60a9754a5.png) **General Principles** - **Be Consistent:** Whatever conventions you choose, apply them consistently across the project. - **Be Descriptive:** Names should be self-explanatory, reducing the need for additional comments to explain what a variable, function, or class does. - **Avoid Abbreviations:** Unless it's a well-known abbreviation, spell out words to avoid confusion. ## Variable Naming Convention This section outlines naming conventions for pages, components, state variables, custom data types, enums, and constants to ensure clarity and consistency throughout the project. ### Pages & Components Use **UpperCamelCase** for all widgets, components, pages, and screen names to maintain consistency and readability. FlutterFlow Studio ensures clarity by automatically adding "Widget" to widget names when generating code. For components, you can suffix the name with "Component" to clearly distinguish them. Similarly, for pages and screens, include "Page" or "Screen" in the name to indicate their purpose. This approach aligns with Dart conventions for class names and ensures a well-organized project structure. ![comp-style-guide.png](https://docs.flutterflow.io/assets/images/comp-style-guide-2ff5f0992fe7d38b846bdb92e807b6b1.png) :::tip[Do's] - **Use UpperCamelCase for Names:** Always use **UpperCamelCase** for widgets, components, pages, and screens. Examples: `CustomButton`, `UserProfilePage`, `MainViewComponent`. - **Include "Screen" or "Page" in Page Names:** Use "Screen" or "Page" in file names to identify UI screens or pages. Examples: `LoginScreen`, `SettingsPage`. - **Use Prefixes for Clarity When Necessary:** Add a prefix if it significantly improves clarity or prevents naming conflicts. Example: `AdminUserProfile` (to differentiate it from `CustomerUserProfile` or `UserProfile`). - **Be Descriptive and Clear in File Names:** Ensure names are descriptive enough to convey their purpose at a glance. Examples: `OrderConfirmationScreen`, `ProductDetailsPage`. ::: :::danger[Don'ts] - **Don’t Use Unnecessary Prefixes:** Avoid prefixes that do not add clarity or are redundant. Bad Example: `AppPrimaryButton` (if `PrimaryButton` is sufficient). - **Don’t Add "Widget" Explicitly:** Avoid adding "Widget" to class or component names manually, as FlutterFlow Studio already appends it during code generation. Bad Examples: `ButtonWidget`, `ProfileCardWidget`. - **Don’t Use LowerCamelCase for Class Names:** Reserve **lowerCamelCase** for variables and methods, not for components, or pages. Bad Examples: `loginButton`, `userProfile`. - **Don’t Mix Naming Conventions:** Maintain consistency with UpperCamelCase for all widgets, components, pages, and screens. Bad Examples: `userLogin`, `Profilecard`, `headerView`. - **Don’t Use Generic Names Without Purpose:** Avoid overly generic names that do not clearly convey the file’s intent. Bad Examples: `Main`, `View`, `Screen1`. ::: Note that the style guidelines for Pages and Components also apply to **[Custom Widgets](https://docs.flutterflow.io/concepts/custom-code/custom-widgets)**, as Pages and Components created in FlutterFlow Studio are internally generated as widgets. ### Custom Data Types & Enums When naming custom data types and enums, use **UpperCamelCase** for consistency and clarity. Ensure that names are descriptive, providing a clear representation of the entity or purpose. ![dt-style-guide.png](https://docs.flutterflow.io/assets/images/dt-style-guide-8a04300e5d3d1f20e1dbb7d13e96c3b2.png) :::tip[Do's] - **Use UpperCamelCase for Custom Data Types:** Name your custom data types using **UpperCamelCase**. Ensure that names are clear, concise, and descriptive, reflecting the entity they represent. Good Examples: `UserModel`, `ProductDetails`, `OrderItem`. - **Use consistent naming for Enum Names and Values:** Use **UpperCamelCase** for the enum name such as, `Status`, `ConnectionState`, `UserRole` and **lowerCamelCase** for its values e.g., `{active, inactive, pending}`. This approach aligns with Dart's enum naming guidelines and ensures consistency. - **Use Plural Names for Lists:** If the data type represents a List, use a plural name to clarify its purpose. Good Example: `OrderItems` (to represent multiple `OrderItem` objects). ::: :::danger[Don'ts] - **Don’t Use All Lowercase or Mixed Case for Custom Data Types:** Avoid using all lowercase or inconsistent casing in data model class names, as it reduces readability. Bad Example: `usermodel`, `product_details`. - **Don’t Use Vague or Non-Descriptive Names**: Avoid using generic or unclear names that do not clearly describe the data entity. Bad Example: `DataModel`, `Entity`, `Item`. - **Don’t Mix Naming Conventions for Enums:** Maintain consistent capitalization between enum names and their values. Bad Example: `enum UserRole { Admin, EDITOR, viewer }` ::: For datatype fields, we use the same convention as [State variables](#variables). ### Constants Flutter prefers using a lowercase `k` prefix for constants to indicate their immutability, especially for project-specific constants. This approach is more concise and aligns with Dart's common practices. Use **SCREAMING_SNAKE_CASE** only when contributing to global or legacy projects where it is already in use. :::tip[Do's] - **Start Constants with a k Prefix:** Always use a lowercase `k` followed by **UpperCamelCase** for constants in FlutterFlow Studio projects. - **Use Descriptive and Contextual Names:** Clearly describe the purpose of the constant. Avoid using abbreviations unless they are widely understood. Examples: `kDefaultPadding`, `kMaxUploadSizeMb` ::: :::danger[Don'ts] - **Don’t Omit the k Prefix for Constants:** Avoid using plain names for constants in a Flutter-specific project, as they might conflict with variables or methods. Bad Examples: `padding`, `uploadSize`. - **Don’t Use Vague or Generic Names:** Avoid using names that fail to describe the purpose of the constant. Bad Examples: `VALUE`, `DATA`, `X`, `Y`. ::: ### Variables State variable & Data Type field names follow the **lowerCamelCase** naming style to align with Dart's conventions. :::tip[Do's] - **Be Descriptive and Clear:** Use variable names that clearly describe their purpose, avoiding generic or vague terms. Examples: `isFormValid`, `errorMessage`, `availableProducts`. - **Prefix Boolean Variables with `is`, `has`, or `should`:** For readability, use prefixes that denote the variable's purpose when naming Boolean values. Examples: `isActive`, `hasErrors`, `shouldReload`. - **Use Consistent Prefixes to denote state:** When managing UI or asynchronous state, use prefixes like `current`, `selected`, or `pending` for better context. Examples: `currentTabIndex`, `selectedUserId`, `pendingAction`. ::: :::danger[Don'ts] - **Don’t Use Abbreviations or Single Letters:** Avoid abbreviations or single-character names that obscure the variable's intent. Bad Examples: `usrNm`, `f`, `cnt`. - **Don’t Use Generic Names:** Avoid using generic terms that do not convey the variable’s purpose. Bad Examples: `data`, `value`, `temp`. - **Don’t Start Variables with Uppercase:** Follow Dart conventions by starting variable names with lowercase. Bad Examples: `UserName`, `IsLoading`. ::: ## Function Naming Convention This section defines naming conventions for custom functions, actions, and action blocks to maintain consistency, readability, and ease of understanding across the codebase. ### Custom Functions & Actions Custom functions and custom actions created in the Custom Code tab of FlutterFlow Studio should follow the **lowerCamelCase** naming convention. These typically reflect an action or behavior. ![func-style-guide.png](https://docs.flutterflow.io/assets/images/func-style-guide-4884145ca292af50c547ddac71846d0b.png) :::tip[Do's] - **Be descriptive and concise:** Use clear, meaningful names that describe the action or purpose of the function (e.g., `validateForm` instead of `doCheck`, or `fetchUserData` instead of `userData`). - **Use action-oriented names:** Start with verbs to indicate behavior (e.g., `submitForm`, `processPayment`). ::: :::danger[Dont's] - **Avoid using underscores or spaces:** Names like `fetch_user_data` do not align with **lowerCamelCase** conventions. - **Avoid redundant prefixes or suffixes:** There’s no need to prefix with `custom` or suffix with `Func` unless absolutely necessary for clarity (e.g., `customSubmitFormFunc` is redundant). - **Don’t use overly generic names:** Avoid vague terms like `doSomething` or `functionOne`, which don’t provide context. ::: Note that **[Action Blocks](https://docs.flutterflow.io/resources/functions/action-blocks)** should follow the same naming convention as custom actions, as they are both technically Dart functions internally in the generated code. # Key Concepts > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts Learn about the key concepts important for building with FlutterFlow Studio - [Design System](https://docs.flutterflow.io/concepts/design-system): Discover how to create a consistent UI/UX across your app with a design system in FlutterFlow Studio. - [Layout](https://docs.flutterflow.io/concepts/layouts): 3 items - [State Management](https://docs.flutterflow.io/concepts/state-management): 2 items - [Navigation & Routing](https://docs.flutterflow.io/concepts/navigation/overview): 11 items - [File Handling](https://docs.flutterflow.io/concepts/file-handling): 4 items - [Customizations](https://docs.flutterflow.io/concepts/custom-code): 9 items - [Animations](https://docs.flutterflow.io/concepts/animations): 6 items - [Accessibility & Localization](https://docs.flutterflow.io/concepts/accessibility): 2 items - [Alerts](https://docs.flutterflow.io/concepts/alerts/alert-dialog): 3 items - [Notifications](https://docs.flutterflow.io/concepts/notifications): 2 items - [App Events](https://docs.flutterflow.io/concepts/app-events): Learn how to use App Events in FlutterFlow Studio. - [AI Agent](https://docs.flutterflow.io/concepts/ai-agent): Use AI Agent from the FlutterFlow Studio desktop app to set up supported AI agent CLI tools, connect them to your project, and build with natural-language prompts. - [Advanced](https://docs.flutterflow.io/flutterflow-cli): 3 items # Design System > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/design-system Discover how to create a consistent UI/UX across your app with a design system in FlutterFlow Studio. A design system is a guideline to create a consistent UI/UX across the app. A design system includes colors, typography, fonts, icons, app assets, a nav bar, an app bar, and pre-designed UI components such as buttons and text widgets. This is especially helpful when you are working in a team of builders and designers in a large company. Let's say you have an app with several different features and pages, each with its unique design. However, you notice that you are starting to create inconsistencies in the design across different pages, such as using different colors, fonts, and layouts. To solve this issue, you can create a design system outlining common design guidelines. Then, the team members can use this design system, which ensures the design remains consistent.
## Adding Design System You can add a design system from the [Library](https://docs.flutterflow.io/resources/projects/libraries) dependencies added to your project. A library can serve as a central repository for your design assets, components, and styles—effectively becoming a Design Library for your application(s). :::tip[possible use cases] - **Enterprise Applications:** Large organizations can develop a centralized design system as a library to ensure all internal applications maintain a cohesive look and feel, enhancing brand identity and user experience. - **Startup MVPs:** Startups can expedite the development of Minimum Viable Products (MVPs) by leveraging a pre-built design system library like [**shadcn**](https://marketplace.flutterflow.io/item/cNlm0zWW1Nfq11cFXBmp), allowing them to focus on functionality and user validation. - **Cross-Platform Consistency:** Teams aiming to deploy apps across multiple platforms (iOS, Android, Web) can use a popular platform based design system library to ensure uniformity in design, reducing the effort required for platform-specific adjustments. ::: To add a design system from a library, start by creating the design system in a new FlutterFlow Studio project and [publishing it as a library](https://docs.flutterflow.io/resources/projects/libraries#publishing-a-library). Next, [import](https://docs.flutterflow.io/resources/projects/libraries#importing-a-library) that library into the project where you want to use the design system. Then, navigate to **Theme Settings > Design System** and click **No Design System Selected**. From the dropdown that appears, **Select a library** you’ve just imported to apply its design system to your project.

## Import Figma Theme You can bring your Figma design system directly into your FlutterFlow Studio project. This streamlines the design-to-development process by automatically importing colors and typography from your Figma file, helping you maintain visual consistency and reduce manual effort. To import a Figma theme into your FlutterFlow Studio project, go to **Theme Settings > Design System** and click **Connect To Figma**. Authenticate your account and grant access to Figma. Once connected, paste your Figma file URL to fetch the theme. You’ll see a list of all imported colors; start mapping them to your project colors. You can filter these colors by whether they’re mapped or unmapped, and you also have the option to bulk delete any imported colors. After that, you can customize your project typography using the imported text styles. :::note All imported colors are accessible anytime under **Colors > Custom Colors**. :::

If you prefer watching a video tutorial, here is the guide for you:

--- ## Loading Indicators To customize the **Loading Indicators** used in the app, you can make changes in this section. You have the option to specify the **Indicator Type**, **Color**, and **Radius**, and the preview of the changes will be displayed below.

:::tip Avoid mis-sized loading indicators or components, which lead to jumping layouts. Ensure loading components match the size and position of the content they replace. ::: If you prefer watching a video tutorial, here is the guide for you:

--- ## Scrollbar Theme To open the scrollbar settings, go to the **Theme** panel > **Design system & app theme** > **Scrollbar**. From here, you can customize the appearance of the scrollbar that shows up on scrollable elements like ListView, GridView, StaggeredView, Row, and Column. :::note The scrollbar currently shows up by default only on platforms where Flutter natively supports it, such as web and desktop environments. ::: You can modify its color, adjust its thickness, give it a rounded border, and more. In the 'Preview' section, you'll also be able to see the immediate visual effect of your changes. Here are all the properties you can customize: 1. **Thumb color:** This changes the color of the draggable portion of the scrollbar, often called the "thumb". ![Scrollbar theme settings with Thumb color set to Tertiary and an orange thumb in the Preview.](https://docs.flutterflow.io/assets/images/thumb-color-light-a3852956ce4332914bd804ff80d81cd6.png) 2. **Thickness:** This increases width (in a vertical scrollbar) or height (in a horizontal scrollbar). ![Scrollbar theme settings with Thickness set to 20 and a thick thumb in the Preview.](https://docs.flutterflow.io/assets/images/thickness-light-82401487312540e41ff3314c5323c1da.png) 3. **Border radius:** This sets the curvature of the scrollbar's corners. By adjusting the border-radius, you can give the scrollbar a more rounded appearance (higher values) or a more squared appearance (lower values). ![Scrollbar theme settings with Border radius set to 0 and a square-cornered thumb in the Preview.](https://docs.flutterflow.io/assets/images/border-radius-light-1b40694a45f0e875691aa2413f4a6988.png) 4. **Min thumb length:** This refers to the smallest size that the draggable portion (thumb) of a scrollbar can be. This ensures that users can always see and interact with the thumb, even when the content is very long. ![Scrollbar theme settings with Min thumb length set to 50.](https://docs.flutterflow.io/assets/images/min-thumb-length-light-1fa308ba29d33b20df445351f6e6dada.png) 5. **Main axis margin:** This refers to the space or gap along the primary direction of the scrollbar. For instance, in a vertically scrolling list, it refers to the top and bottom spacing, and in a horizontally scrolling list, it refers to the left and right spacing. ![Scrollbar theme settings with Main axis margin set to 40 and the thumb inset in the Preview.](https://docs.flutterflow.io/assets/images/main-axis-margin-light-08e4b9eb4268447d785181c675cfaa24.png) 6. **Cross axis margin:** This refers to the space or gap along the cross direction of the scrollbar. For instance, in a vertically scrolling list, it refers to the left and right spacing, and in a horizontally scrolling list, it refers to the top and bottom spacing. ![Scrollbar theme settings with Cross axis margin set to 10 and the thumb raised in the Preview.](https://docs.flutterflow.io/assets/images/cross-axis-margin-light-75b7fb798f150751f410f19743f63253.png) 7. **Thumb always visible:** This determines whether the draggable "thumb" element of the scrollbar constantly remains visible or fades out when not in use. When enabled, you can also specify whether to show the track as well with custom color and border color. 8. **Interactive**: Using this property, you can set different colors for different states of the thumb, including when it's hovered over or being dragged. ![interactive](https://docs.flutterflow.io/assets/images/interactive-0737de8ab3ff2050e4cfb129b96d39b8.gif) --- ## Pull to Refresh Style From here, you can customize the appearance of the pull to refresh (i.e., the loading circle). You can modify its color, background color, and stroke width. In the 'Preview' section, you'll also be able to see the immediate visual effect of your changes.

## Colors This section allows you to customize the colors of your app, giving you control over the visual appearance of your application. From here, you can configure colors for both light and dark themes. Additionally, you can preview existing theme colors, import colors from Coolors, and even extract colors from images. ### Add or replace color By default, we add 16 predefined colors for light and dark themes. However, you might want to add a new color or replace the existing color to align better with your brand identity. To add a new color: 1. Click **Add Color** button. 2. The new color will be added as **Custom Color.** Click on it and enter the [Hex color value](https://www.w3schools.com/colors/colors_hexadecimal.asp). 3. You can also edit the name of the custom color. 4. Click **Use Color**.

To update an existing color in a light and dark mode theme, click on the color and enter the hex color value.

### Explore Project Colors We allow you to browse through the commonly used colors in your app and some pre-defined color schemes that might align with your app branding. To do so: 1. Click on the **Explore Project Colors**. 2. **Select page** you want to preview. 3. To find common colors, scroll down and click **Find Common Colors**. This will list out all the colors being used in the app. Use the 'done' and 'cancel' icons to accept or reject colors. 4. To explore the pre-defined color schemes, switch to the **Explore** tab, scroll through all the schemes, and tick to see the preview. 5. Click the 'refresh' button to get back to the original theme. 6. To proceed further, click **Save Changes**.

### Import from Coolors Importing colors from [Coolors](https://coolors.co/) website is a quick and easy way to add your preferred color scheme to your app. Coolors offers a vast library of color palettes that you can import with just a few clicks, saving you time and effort in creating your own custom color palette. To import from Coolors: 1. Go to the [coolors.co](https://coolors.co/palettes/trending), identify the palette you would like to add, click on the **options menu** (three dots), and then click on the **Export palette**. 2. Now, select the **Code**, and then copy the contents below the `/* Object */` section. 3. Open your project, and navigate to **Theme Settings > Colors**. 4. Click on the **Import from Coolors** button. This will open a new popup window. 5. Paste the copied content and then click **Import**. New colors will be displayed under the **Custom Colors** section.

### Extract from Image This feature provides an easy way to create visually striking themes by utilizing the colors present in an image. You can generate a color palette that harmonizes perfectly with the colors in the image, resulting in stunning designs that capture the essence of your image. To extract and use color from the image: 1. Navigate to **Theme Settings > Colors**. 2. Click the **Extract from Image** button and select the image. 3. A pop-up will appear that displays the extracted color from the image. To proceed further, click **Extract & Continue**. 4. In the next step, click on any color to see and select the extracted color. 5. Click **Done**.

### AI Generated Theme Colors With 'AI Gen Theme,' simply describe the desired color theme for your app, such as 'Tiger in the Jungle' or 'Kids bedtime story,' and watch as a comprehensive color scheme tailored to your needs magically appears.

### Video guide If you prefer watching a video tutorial, here's the one for you:

## Typography & Icons This section puts you in complete control of your app's text styling. With options to add responsive and custom fonts, you can ensure your app looks unique and consistent across all screen sizes. Moreover, you can also add custom icons to your app, allowing you to create unique and visually appealing user interfaces. ### Define Text Styles (Typography/Fonts) To change the font family at the project level, open the **Theme** panel, go to the **Fonts** section, and search for and select a new primary or secondary font. :::note The *Primary Font Family* is the font that you will use the most throughout your app. The *Secondary Font Family* is the font that you will use to serve slight variation or contrast to the primary font. ::: You can customize the following properties of each text style: - **Font:** The font family for this style, from [*Google Fonts*](https://fonts.google.com/) or your uploaded Custom Fonts. - **Size:** The size of the text. - **Weight:** The font weight, from *Thin* to *Black*. - **Letter spacing:** The space between characters. - **Color:** The color of the text, chosen from your theme colors or the color picker. - **Italic:** A toggle for the *Italic* font style. You can also create fully custom text styles to match your design needs, going beyond the default styles like Display, Headline, or Title. Click the **+** icon in the **Typography** header to add a new text style, and then edit its name and properties. ![The Typography section of the Theme panel, with Display Large expanded to show its font, size, weight, letter spacing, color, and italic settings.](https://docs.flutterflow.io/assets/images/typography-light-757a5ca6fdbca68b6560b3baed28e7e2.png) :::tip[PLANS] Custom Text Styles are available on the **Business** plan and higher. Check our [**pricing plans**](https://flutterflow.io/pricing). ::: #### Adding responsive text styles When developing a mobile app, it's important to consider the different platforms on which it will run. You might notice that the text looks smaller on platforms with higher screen resolution, such as tablets, web, or desktops. This can impact the user experience and make your app difficult to read. To solve this issue, you can add responsive text that adjusts the font size based on the platform. See how the texts are displayed with and without responsive font style: **With responsive Text** ![with-responsive-text](https://docs.flutterflow.io/assets/images/with-responsive-text-e92f3ca8860018d5c26a5adf95ede1cf.avif) **Without responsive text** ![without-responsive-text](https://docs.flutterflow.io/assets/images/without-responsive-text-58150c933c57c50652d32bed6fbb01cf.avif) You can add the responsive style by following the instructions below: 1. Open the **Theme** panel and go to the **Typography** section. 2. In the **Typography** header, click the device icon (**Make sizes differ per device**). 3. Now, all the styles are available under three tabs: *Phone*, *Tablet*, and *Desktop*. Modify each style under the different platform tabs that you are supporting. 4. Run the app and see how the texts are displayed by changing the platform.

### Custom Fonts Adding Custom Fonts to your app makes it stand out from others. This section allows you to upload your own fonts. You can upload the custom font files of types `.ttf`, `.otf`, and `.woff.` Once the font is uploaded, you can use it directly from the widget or add it to the text style section to create a general theme. :::note Before you upload the Custom Fonts, make sure you have permission to use the font in your application. ::: To add the *Custom Fonts*: 1. Open the **Theme** panel. 2. In the **Typography** section, click **Custom fonts**. 3. Click **Add font**. 4. Enter the **Font Family Name** and click **Upload Files**. 5. Select and upload your font. 6. Click **Add Font**. The newly added font will be displayed. 7. To use a custom font directly in a widget, move to the property panel, click on the already applied font family, select the **Custom Fonts** tab, and then choose the font. 8. To use a custom font for a common text style, expand the style in the **Typography** section, click its **Font**, select the **Custom Fonts** tab, and then choose the font.

If you prefer watching a video tutorial, here's the one for you:

### Custom Icons Custom icons help reinforce your brand identity and add a unique touch to your app. Before uploading icons to FlutterFlow Studio, you’ll first need to generate them using an icon font generator like [FlutterIcon](https://www.fluttericon.com/) or [IcoMoon](https://icomoon.io/). We’ve also built our **[own SVG to Custom Icon Generator](https://icons.flutterflow.app)** to make the process even easier — feel free to use that instead. :::note Make sure you have the proper rights or licenses to use the icons in your application. ::: **Steps to Generate and Add Custom Icons** 1. Head over to the [IcoMoon](https://icomoon.io/app/#/select). 2. Import your custom icon (.svg) or select from the free icons set. 3. Select the **Generate Font** tab. 4. Click on the Settings button (gear icon) beside the download text on the bottom right side. 5. Enable **Generate Dart class for Flutter**. 6. Click on the **Download** button and then extract the downloaded file.

7. Open your FlutterFlow Studio project, open the **Theme** panel. 8. In the **Typography** section, click **Custom icons**. 9. Click **Add icon family**. 10. Click **Upload icon file**. 11. Select and upload the `.ttf` file from the downloaded folder > fonts. 12. Upload the Dart file generated with it: the `filename.dart` file in the downloaded folder (next to the fonts folder). 13. Click **Add icons**. #### Use the Custom Icon To use a custom icon, add the **Icon** widget, move to the properties panel, and scroll down to the **Icon** section. Click on the already selected icon, select the **Custom Icons** tab, and then select your icon.

If you prefer watching a video tutorial, here is the guide for you:

## Theme Widgets Creating a theme for widgets ensures that your app looks consistent and has a cohesive design. The Theme widgets can be reused, making it easy to update the styles of your app. If you decide to change any property of the widget, such as color scheme or fonts, you can update the theme widget instead of going through every widget individually. This can save a lot of time and effort, especially in larger projects. For example, creating theme widgets for different types of buttons such as 'primary_button', 'secondary_button', and 'tertiary_button' with specific attributes like width, color, icon, border radius, and padding. Then, these widgets can be directly added to a page or applied to an existing widget. ### Adding theme widgets To add a theme widget to your app, you must create it and then use it on your page by dragging it from the Widget Palette or applying it to the existing widget. Here's how you do it: 1. Open the **Theme Settings** (from the navigation menu) > **Theme Widgets**. 2. Click **Create Widget** button. 3. Enter the **Theme Widget Name** and then select the widget. 4. Create a theme for the widget using its properties available on the right side and then click **Save**.

5. You can also make any widget a theme widget by right-clicking and selecting **Save as Theme Style Widget**.

6. Now, you can add this widget directly from the widget tree or Widget Palette.

7. To apply this widget styling to an existing widget, select the widget, move the **Properties Panel > Widget Styling >** click **Theme Style Unset >** select the theme widget. :::caution After applying theme widget styling, any previously set properties will be overridden except the properties with *Set from Variable*. However, you are free to modify the existing widget properties as you like. :::

### Video guide If you prefer watching a video tutorial, here's the one for you:

## FAQs
How is the theme widget different from creating a template and component?

The Theme Widget allows you to customize the visual appearance of a single widget, whereas templates consist of multiple widgets that create a unique UI layout with a specific purpose. On the other hand, components are fully-featured custom widgets that combine multiple widgets and actions to complete a task.

# Building Layout > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/layouts Learn how to build layout in your FlutterFlow Studio app. In FlutterFlow Studio, you build a page layout using Widgets. **Widgets**, such as [Text](https://docs.flutterflow.io/resources/ui/widgets/text), [Buttons](https://docs.flutterflow.io/resources/ui/widgets/button), [Images](https://docs.flutterflow.io/resources/ui/widgets/image), and [Icons](https://docs.flutterflow.io/resources/ui/widgets/icons), are visible on the screen. Others, like [Containers](https://docs.flutterflow.io/resources/ui/widgets/container), Rows, Columns, and Stacks, are not directly visible but help arrange and position the visible elements on the page. These widgets are categorized into four main types: Layout Elements, Base Elements, [Page Elements](https://docs.flutterflow.io/resources/ui/pages/scaffold), and Form Elements. To build a page, you combine different widgets from these categories to get the desired look and feel of your app. ## Understanding Layout Concept One of the most common layout patterns is to arrange widgets either **vertically** or **horizontally**. To display widgets in a vertical layout, use the **Column** widget. For a horizontal layout, use the **Row** widget. If you need to place one widget on top of another, use the **Stack** widget. :::note **Composing widgets** is a fundamental aspect of creating layouts in FlutterFlow Studio. It involves combining different widgets to form a cohesive and functional user interface. Understanding how to effectively compose widgets allows you to design complex layouts and create intuitive, user-friendly apps. Learn more about composing widgets [**here**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack). ::: ## Building Layouts: Exercise Let's walk through an exercise to build the following layout: ![build-layout-page.avif](https://docs.flutterflow.io/assets/images/build-layout-page-708a22947554f59924e51a2e876092f7.avif) The steps to build the given layout are as follows: 1. [Sketch the layout](#1-sketch-the-layout) 2. [Add Image section](#2-add-image-section) 3. [Add info section](#3-add-info-section) 4. [Add reviews section](#4-add-reviews-section) #### 1. Sketch the layout When you are just starting out with building apps, this step is very crucial. Before you actually start adding widgets to the page, sketch a picture of how the main layout will be broken into smaller parts. Breaking down the given layout into sections looks like this: ![breaking-main-layout-2.png](https://docs.flutterflow.io/assets/images/breaking-main-layout-2-cd4430869a74e015f6e0021330903d14.avif) Next, identify the widgets that can replace those sections, such as Column, Row, and Stack. Once you have a clear idea of which widgets to use, you can begin adding them. In the figure above, the main section is replaced with the Column widget and is divided into smaller sections. The next step is to look carefully at these smaller sections and, if required, divide them into further small sections and replace them with the appropriate widget. You can repeat this process until you achieve the desired level of granularity. Splitting the smaller section further looks like this: ![divide-smaller-section-2.png](https://docs.flutterflow.io/assets/images/divide-smaller-section-2-b2b0ea71f1867fc5686d49de5168e1d1.avif) :::note A page can only have one parent widget. i.e., you can't have two containers (at the same level) on a page. For that, you can wrap the two containers inside the Column widget, which makes the Column widget a single parent. ![The widget tree of a page whose body is a single Column that holds two Container widgets.](https://docs.flutterflow.io/assets/images/column-as-single-parent-light-9c9e0c38dfd11cedc8565f487463d3fc.png) ::: #### 2. Add Image section The top section includes the Image and IconButton widgets. To place the IconButton on top of the Image, wrap them inside a Stack widget. Here's how you do it:

#### 3. Add info section The info section consists of a few Text widgets inside the Column.

#### 4. Add reviews section The review section consists of multiple different widgets. First, add a Column to separate the reviewer's information (image and name) from the actual review text. Next, display the reviewer's information inside a Row widget using the CircleImage and Text widgets. Here’s exactly how you do it:

## Common Layout Widgets Apart from Row, Column, and Stack widgets, there are some other widgets that are widely used for building the page layout. Here are some of them: - [Container](https://docs.flutterflow.io/resources/ui/widgets/container) - [Card](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/card) - [ListView](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid) - [GridView](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid) - [TabBar](https://docs.flutterflow.io/concepts/navigation/tabbar) - [PageView](https://docs.flutterflow.io/concepts/navigation/pageview) - [Form](https://docs.flutterflow.io/resources/forms) ## Video guides To learn more about building layout, watch our videos:

# Responsive Layout > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/layouts/responsive Learn how to create responsive layout in your FlutterFlow Studio app. FlutterFlow Studio is great at creating applications adaptable to a wide range of screen sizes, devices, and platforms. Ensuring that our screens maintain their aesthetic appeal across all these variations is crucial. Below, we outline various methods to enhance the responsiveness of your UI screens. **Note:** Please check out the examples in the order they're given, as they use the same example. Jumping to sections might make things confusing. ### Global Properties Let's start by demonstrating how screen width and height values change when you switch between devices in Test Mode. First, create a new project. In the Home Page, under a Column parent, add two Text widgets. Label one "Screen Width" and the other "Screen Height." ![The widget tree and canvas of a page where a Column holds two Text widgets that show Screen Width and Screen Height.](https://docs.flutterflow.io/assets/images/screen-width-height-light-249abf8bedf7c73d17fb60ecb94185a2.png) Next, we'll display the changing values alongside these titles. For each Text widget, set its value to a variable. Select *Combine Text* from the options. Your first Text value should be either "Screen Width: " or "Screen Height: ". Then, add another Text value that will show the corresponding value. This second Text value is also set from a variable. Choose 'Global Properties,' and then select either 'Screen Width' or 'Screen Height' from the list. These options hold the current screen width/height values. Repeat this process for both Text widgets. ![The Set from Variable menu with Global Properties expanded, listing Screen Width and Screen Height.](https://docs.flutterflow.io/assets/images/setting-global-properties-light-a302f168b075824356cad6d75bb04467.png) Now, when you switch to Test Mode and try out different devices, you'll see the screen width and height values update accordingly. **Running app on Test Mode for desktop device sizes** ![running-app-on-test-mode-for-desktop-device-sizes.avif](https://docs.flutterflow.io/assets/images/running-app-on-test-mode-for-desktop-device-sizes-a33815a0c05375fd8501943ab6d49d17.avif) **Running app on Test Mode for mobile device sizes** ![running-app-on-test-mode-for-mobile-device-sizes.avif](https://docs.flutterflow.io/assets/images/running-app-on-test-mode-for-mobile-device-sizes-52410bce4805003848c8de270648d02a.avif) This is to show you that these screen values are always accessible as global properties. You can use them to design your UI logic effectively. ## Expanded & Flex Let's explore a fundamental method to make columns and rows adapt to different screen widths and heights. While designing a Row or Column, it's important to avoid assigning fixed sizes to the children, unless specifically required by the design. Take, for instance, the navigation bar we're creating for our web version. It includes the page name, several navigation icons, and a search bar. Notice how the search bar adjusts its length based on the available width. This adaptability is achieved because the widths of the children are set relative to the available space in the horizontal section. ![web-version-of-our-shopping-app-example.gif](https://docs.flutterflow.io/assets/images/web-version-of-our-shopping-app-example-aa9a2440bf6f2a5e6b5b3e8b0ba3922f.gif) To design the same navbar, create the following widget hierarchy: ``` - Container (named as webHeader) - Row - Row - TextField (named as searchBar) - IconButton ``` The second Row is further broken down into the following: ``` - Row 2 - Text (named as pageName) - Row 3 (named as navIcons) - IconButton - IconButton - IconButton ``` The Widget Tree labels both nested rows **Row**. The names `Row 2` and `Row 3` only tell them apart in this guide. ![Widget Tree showing ProductList > Column > webHeader > Row with a nested Row (pageName, navIcons with three IconButtons), searchBar, and IconButton, next to the canvas with the header Row selected.](https://docs.flutterflow.io/assets/images/row-breakdown-light-47d35a3da8a6c330b58b2732b63f0a22.png) A TextField inside a Row needs a width or an Expansion setting, so set the `searchBar`'s Expansion to *Expanded* (the third icon) for now. The search bar then occupies the maximum available space. However, we want both `Row 2` and the `searchBar` to share the space equally. To achieve this, simply adjust the Widget properties. For `Row 2`, set its Expansion property to *Flexible* (the middle icon) and assign a Flex value of 1. Repeat the same steps for the `searchBar`. This change ensures they are allocated space in a 1:1 ratio, based on what's available. After this adjustment, you'll notice that the remaining space, following the placement of the *search IconButton* on the right, is evenly divided between `Row 2` and the `searchBar`. ![Editor with searchBar selected in the Widget Tree, the header split evenly on the canvas, and the Expansion row set to Flexible with a Flex value of 1.](https://docs.flutterflow.io/assets/images/test-expansion-light-07e2f9151bb05f282277599ef74aa5dc.png) We encourage you to test with different web dimensions and sizes to see how well this adapts. Depending on your design needs, there are various approaches to managing space. Let's consider a different scenario: What if we want the searchBar to always occupy 40% of the screen width, with `Row 2` taking up the remaining space after placing the `searchBar` and `search IconButton`? To do this, first set the `searchBar`'s **Width** to 40 with **%** selected, and then set its Expansion to *Default* (the first icon). Set the width first, because the editor doesn't let a TextField in a Row use *Default* without one. ![searchBar properties with Expansion set to Default and Width set to 40 with % selected.](https://docs.flutterflow.io/assets/images/set-searchbar-light-f8395397b97e037426e88d14d07bc5f8.png) Next, adjust the `Row 2` widget's Expansion setting to *Expanded* (the third icon). With these settings, you'll see that `Row 2` now occupies all the space left over after allocating 40% to the `searchBar` and placing the `search IconButton`. Note: We've also styled the `searchBar` with a fill color, rounded corners, and a prefix icon to improve its appearance. ![ProductList page with the Categories title and nav icons on the left, a 40% width search bar reading 'Search for your shoes...' and a search icon on the right, and three category cards below.](https://docs.flutterflow.io/assets/images/enhanced-searchbar-light-f8e130f367d4022846c379ea279aa952.png) You can also go ahead and improve the spacing between the `pageName` and `navIcons` by adjusting the MainAxisAlignment to *Space Between* (represented by the last icon). Feel free to try this out with different screen sizes to see how it effectively adapts to the available space. ## Wrap method Another effective method to enhance the responsiveness of a row or column containing multiple items is through the use of the Wrap widget. Let's consider a scenario with a Row of category cards. ![Widget Tree with a Row selected that holds card1, card2, and card3, next to the canvas showing three category cards: Limited Edition, Casual Shorts, and Shoes.](https://docs.flutterflow.io/assets/images/row-of-cards-light-e186995309f270ad45451cb42d93b865.png) You might observe that when the screen size is adjusted to resemble mobile dimensions, the cards begin to get cut off at the edges. ![row-card-resize.gif](https://docs.flutterflow.io/assets/images/row-card-resize-c2acaeb8d8830a78f3662c0d9f63e380.gif) To resolve this issue, simply replace the parent Row widget with a Wrap widget. Make sure to set the Wrap Direction to 'Horizontal' in the Wrap properties. You'll then see that the previously overflowing cards neatly move to the next line, as illustrated in the example. ![row-card-resize.gif](https://docs.flutterflow.io/assets/images/row-card-resize-2-f65d7398b92533417391457ad854c746.gif) The Wrap widget efficiently manages layout for varying screen sizes by automatically adjusting its children into multiple rows or columns. It prevents overflow and ensures a clean, responsive design, especially useful for adapting content like category cards from desktop to mobile views. ## Responsive Breakpoints Moving on to more complex layout scenarios, where the UI significantly differs between mobile and web platforms, it's important to first understand breakpoints. **Breakpoints** in responsive design are like thresholds for different screen sizes. They act as specific points where the layout of a user interface meets a certain screen size requirement and then changes to accommodate it. When the screen size crosses one of these thresholds, the layout adjusts. FlutterFlow Studio has default breakpoints for different screen sizes, but you can also adjust these to better suit your app's design needs. ### Customize Responsive Breakpoints Open the **Theme** panel, and under **Design system & app theme**, click **Breakpoints**. The popover shows the widest screen, in pixels, that each layout applies to. You can change these values if needed. ![Theme panel filtered to Design system & app theme > Breakpoints, with the Breakpoints popover showing Mobile up to 599, Tablet up to 899, Tablet (landscape) up to 1199, and Desktop for everything wider.](https://docs.flutterflow.io/assets/images/custom-responsive-breakpoints-light-646957a8f878ea93c746e5ca3adef6cb.png) The following sections will also rely heavily on *Responsive Visibility,* so let's proceed. ## Visibility of Nav Bar & App Bar In many designs, the App Bar and Nav Bar are typically included in mobile or mobile + tablet screens, and often omitted in desktop formats. FlutterFlow Studio makes it easy to enable or disable the Nav Bar and App Bar. Just go to App Settings, select Nav Bar & App Bar, and toggle the 'Show Nav Bar' option. Upon enabling it, the **Responsive Visibility** icons appear next to the toggle. Icons for mobile, tablet, tablet (landscape), and desktop let you choose where the Nav Bar should appear. The Nav Bar needs at least two pages, which you add under **Pages**. Generally, it's advisable to enable it only for mobile, or mobile and tablet. Let's follow these steps to configure it for our app. ![App Settings with Nav Bar & App Bar selected, Show Nav Bar on, and Responsive Visibility set to mobile and tablet only, with the Layout preview and the ProductList and LayoutDemo pages listed under Pages.](https://docs.flutterflow.io/assets/images/appbar-navbar-visibility-light-bda5aa849d880a67860130c4114ac03c.png) Now, when testing directly in our editor, observe how the navbar appears only for mobile and tablet screen sizes. This same approach can be applied to the App bar as well. ![appbar-navbar-visibility-resize.gif](https://docs.flutterflow.io/assets/images/appbar-navbar-visibility-resize-2aad6b0af11e814a4f0dbbf3ac048507.gif) ## Responsive Visibility In our previous examples, we improved many aspects, but some responsive issues still remained. For instance, our NavBar displayed the same navigation icons on both top header and bottom navbar. Additionally, when the screen width was reduced to mimic mobile dimensions, the header elements became cramped and difficult to interact with. To address this, we can leverage FlutterFlow Studio's Responsive Visibility feature to implement distinct AppBar and SearchBar designs for mobile, while maintaining the current design for web. Imagine we've created a new widget, `mobileAppBar` , and added it to our layout. This widget cleverly separates the categories header and search bar vertically and includes a back navigation button. The goal is to activate this mobile-friendly layout for mobile and tablet screens, while preserving the 'webHeader' for tablet (landscape) and desktop views. ![responsive-visibility.avif](https://docs.flutterflow.io/assets/images/responsive-visibility-748f5a277989829f4c2427b745a218c8.avif) To implement this, we can go to its widget properties and toggle the device icons as shown in the following demo.

And now you have a more responsive screen for this shopping app use case that looks good in both mobile and desktop formats. With these adjustments, your shopping app now boasts a highly responsive screen that seamlessly adapts to both mobile and desktop formats. This ensures an optimal user experience across all devices, maintaining both functionality and aesthetic appeal. ## Responsive Value **Responsive Values** allow you to define different property values, such as widths, heights, font sizes, or padding, for different device sizes (mobile, tablet, desktop, and wide). At runtime, your app evaluates the screen width and automatically applies the appropriate value based on your configurations. :::note[possible use cases] - **Adaptive Layouts**: Automatically adjust element sizes to deliver a consistent UI across devices. - **Better Readability**: Increase font size on larger screens to improve legibility. - **Improved Spacing**: Use different padding or margins on tablets and desktops to optimize content flow. ::: To set a responsive value, select a widget and choose a property that supports responsiveness. Click **Set from Variable > Responsive Value**, then enter different values for each screen size: - Mobile (below `Breakpoint Small`) - Tablet (below `Breakpoint Medium`) - Desktop (below `Breakpoint Large`) - Wide (above `Breakpoint Large`) As you preview on different devices, the property will automatically adjust based on the selected screen size. :::tip[Customizing Breakpoints] You can adjust the default screen size breakpoints (mobile, tablet, desktop, wide) in FlutterFlow Studio’s **Theme** panel. See how to [**Customize Breakpoints**](#customize-responsive-breakpoints). :::

# ConditionalBuilder > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/layouts/conditional-builder Learn how to display different widgets based on certain conditions in your FlutterFlow Studio app. The `ConditionalBuilder` widget allows you to dynamically display different widgets based on certain conditions (either [single](https://docs.flutterflow.io/resources/functions/conditional-logic#single-condition) or [multiple](https://docs.flutterflow.io/resources/functions/conditional-logic#multiple-conditions-andor)). Using this widget, you can define different conditions, each associated with a specific widget to be displayed when that condition is true. It's like having a switch that shows different things depending on what's happening in your app. For example, displaying different charts based on user roles. For team members, an individual progress chart can be shown. Team leads can view the overall progress of the entire team, while project managers can see over project progress chart. Just like the below: ![conditional-builder-widget-demo.png](https://docs.flutterflow.io/assets/images/conditional-builder-widget-demo-183b8ff6c3c63a19d3e8bd8be6880b31.png) ## Adding ConditionalBuilder widget To add the `ConditionalBuilder` widget to your app: 1. Add the **ConditionalBuilder** widget (from the **Base Elements**) to where you want to display dynamic widgets. 2. Move to the **Properties Panel** **>** **Conditional Builder Properties,** andUnder the **First Condition**, provide the **IF** [condition](https://docs.flutterflow.io/resources/functions/conditional-logic) by clicking on **UNSET**. 3. Now, besides the **THEN**, click **Empty**. This will automatically select the **IF** widget in the widget tree. Inside that, add a widget that you want to display if this condition is true. 4. To add one more condition-based widget, click on the "+" button, add a condition for the **ELSE IF** section, and add a widget inside the **Else If** widget in the widget tree. 5. If none of the conditions are satisfied, add a default widget to display inside the **Else** widget. 6. Use the **Show In UI Builder** option to see that particular widget in the [canvas area](https://docs.flutterflow.io/flutterflow-ui/canvas). You can see only one widget at a time.
# Wrap > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/layouts/wrap Learn how to add the Wrap widget in your FlutterFlow Studio app. The Wrap widget is similar to Row and Column as it shows its children one after another. If there is not enough space to show your item, the Wrap widget will automatically place it in a new row or column. ## Adding Wrap widget Here's an example of how you can use a Wrap widget in your project: 1. First, drag the [**Container**](https://docs.flutterflow.io/resources/ui/widgets/container) widget from the **Layout Elements** tab (in the Widget Panel) or add it directly from the widget tree and set its **width** to **infinity** and **height** to **200**. 2. Add the **Wrap** widget from the **Layout Elements** tab inside the Container. 3. Add the **Button** widget inside the Wrap widget. 4. Copy-Paste and add a few more Button widgets. ![add-wrap-widget.gif](https://docs.flutterflow.io/assets/images/add-wrap-widget-22e05ab20c3829a655e8b53114fe0050.gif) See how the Button that won't fit in the remaining space is placed in the next line. ## Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. ### Changing Direction In the example above you saw that the items are added in the horizontal direction, which is a default axis for adding items. To change the direction in which the items are added: 1. Select the **Wrap** from the widget tree or from the canvas area. 2. Move to the Property Editor and scroll down to the **Wrap Properties** section. 3. Spot the **Direction** dropdown, change it to **Vertical**. The Horizontal Direction makes the Wrap widget work like a Row while the Vertical Direction makes the Wrap widget work like a Column. ![wrap-change-direction.gif](https://docs.flutterflow.io/assets/images/wrap-change-direction-ee904fc260c4adb4ffd0d05cad584d74.gif) ### Adding Space Between Items To add space between items: 1. Select the **Wrap** from the widget tree or from the canvas area. 2. Move to the Property Editor and scroll down to the **Wrap Properties** section. 3. In the **Spacing** input box, enter the value as 10. If the **Direction** is set to **Horizontal**, Wrap will insert the empty space of 10px vertically between the items. and If the **Direction** is set to **Vertical**, Wrap will insert the empty space of 10px horizontally between the items. 4. In the **Run** **Spacing** input box, enter the value as 15. If the **Direction** is set to **Horizontal**, Wrap will insert the empty space of 15px horizontally between the items. and If the **Direction** is set to **Vertical**, Wrap will insert the empty space of 15px vertically between the items. ![wrap-space-between-items.gif](https://docs.flutterflow.io/assets/images/wrap-space-between-items-3bbbf369615a39c1581569b2711c0f6a.gif) ### Adjust Alignment The default Main Axis for a Wrap Widget is the horizontal axis, so adjusting this will change how the child widgets are horizontally distributed in the Wrap widget. To change the Alignment: 1. Select the **Wrap** from the widget tree or from the canvas area. 2. Move to the Property Editor and scroll down to **Alignment**. 3. Select from the options displayed including **Start**, **Center**, **End**, **Space** **evenly**, **Space** **between**, and **Space** **around**. ![wrap-adjust-alignment.gif](https://docs.flutterflow.io/assets/images/wrap-adjust-alignment-a902a53a8ddb0577580119dbd7c7a464.gif) ### Adjust Run Alignment The default Run Axis for a Wrap Widget is the vertical axis, so adjusting this will change how the child widgets are vertically distributed in the Wrap widget. To change the Run Alignment: 1. Select the **Wrap** from the widget tree or from the canvas area. 2. Move to the Property Editor and scroll down to **Run Alignment**. 3. Select from the options displayed including **Start**, **Center**, **End**, **Space** **evenly**, **Space** **between**, and **Space** **around**. ![wrap-run-alignment.gif](https://docs.flutterflow.io/assets/images/wrap-run-alignment-c25ae3830a53093f5fd8384926c94de7.gif) ### Adding Items From Bottom By default, the new items are always added from top to bottom direction. In a very rare case, you may need to change this behavior. To add items from the bottom to top: 1. Select the **Wrap** from the widget tree or from the canvas area. 2. Move to the Property Editor and scroll down to **Vertical Direction**. 3. Set the Dropdown value to **Up**. 4. Try adding items. ![wrap-add-items-from-bottom.gif](https://docs.flutterflow.io/assets/images/wrap-add-items-from-bottom-69bccc1a469b5e87a62343c4db9742ad.gif) ### Clipping The Items If you add several items to the Wrap widget that exceed the size of the patent widget, the Wrap widget will continue to display the overflowing items. However, you can choose to hide the overflowing items using the Clip Behaviour property: To clip the overflowing items: 1. Select the **Wrap** from the widget tree or from the canvas area. 2. Move to the Property Editor and scroll down to **Clip Behaviour**. 3. Change it to **Clip Content**. ![wrap-clip-items.gif](https://docs.flutterflow.io/assets/images/wrap-clip-items-28e043558d15d6cca365f7aaeea92c68.gif) --- ## Video guide If you prefer watching a video tutorial, here's the one for you:

# Flex > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/layouts/flex Learn how to add the Flex widget in your FlutterFlow Studio app. The **Flex** widget can be used as an alternative to **Row** and **Column**. It allows you to dynamically set the layout axis (horizontal or vertical) based on specific conditions or logic. This is especially useful for creative responsive layouts - where child elements should be horizontal when the screen is wide, and vertical when the screen is narrow. ![flex.png](https://docs.flutterflow.io/assets/images/flex-aaafa4fc69ce98d225fc76b00662819c.png) ## Adding Flex Widget To use the Flex widget, add it from the **Layout Elements** section of the **Widget Palette**, then add child widgets inside it. From the properties panel, set a condition for the **Is Horizontal** property. When this condition evaluates to `True`, the items will be laid out horizontally. Consider an ecommerce app where recent orders are displayed vertically on mobile devices and switch to a horizontal layout on larger screens to make better use of the available space.

Here's another example of using a Flex widget on a create account page to dynamically align the signup fields based on screen size.

:::tip[Best Practices] - If you only need a simple vertical or horizontal arrangement, consider using [**Row**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack) or [**Column**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack). - For very large numbers of children, consider using [**ListView**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#listview-widget) or [**GridView**](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#gridview-widget) instead of **Flex**, as they offer better performance for scrolling large lists of items. - When the content exceeds the screen limit, you can enable scrolling to make the content accessible. However, if you want to avoid scrolling altogether and still fit all the content on the screen, consider using a [**Wrap**](https://docs.flutterflow.io/concepts/layouts/wrap) widget. ::: ## Customization When **Is Horizontal** property is disabled, the Flex widget behaves like a Column, and when enabled, it acts as a Row. Settings like [main axis alignment](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack#main-axis), [cross axis alignment](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack#cross-axis), [scrollability](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack#scrollability), and [spacing](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack#spacing) work the same way they do for the Column and Row widgets. # State Management > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/state-management An overview of state management & state variables in FlutterFlow Studio. State management is a crucial concept focused on maintaining and controlling the **state** of an application. Simply put, it involves monitoring the changes within your app and updating the user interface to reflect these changes. The UI (user interface) displays information based on state variables. When these state variables change, the UI updates to reflect the changes. ## State Variables In FlutterFlow Studio, there are a few types of state variables that you can create:
![app stage overview](https://docs.flutterflow.io/assets/images/state_management_overview-fcd8004bf3a66a6cdbc87536a335b637.png)
App State is shared across multiple pages in the application. Component State is specific to a component. Page State is shared across widgets on the page.
- State variables are themselves [**variables**](https://docs.flutterflow.io/resources/data-representation#variable) - meaning they have a *name* and a *data type*. - They also have an initial value that is set when you create the variable. - Once you create a state variable, it's value can be used to change the configuration of widget properties - like any other variable. - You can update the value of state variables using the **[Update State Variable](#updating-state-variables)** action. ### Creating State Variables - To create an **App State variable**, refer to this **[guide](https://docs.flutterflow.io/resources/data-representation/app-state#create-app-state-variable)**. - To create a **Page State variable**, refer to this [**guide**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#creating-a-page-state). - To create a **Component State variable**, refer to this [**guide**](https://docs.flutterflow.io/resources/ui/components/component-lifecycle#creating-a-component-state). Note: Users cannot create **widget state variables**. These are automatically exposed by FlutterFlow Studio when a Form widget is used. ### Updating State Variables - To update an **App State variable**, refer to this **[guide](https://docs.flutterflow.io/resources/data-representation/app-state#update-app-state-action)**. - Refer to the [**Page Lifecycle**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle) guide to learn about updating **[Page State variables](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#update-page-state-action)**. - Refer to the [**Component Lifecycle**](https://docs.flutterflow.io/resources/ui/components/component-lifecycle) guide to learn about updating **[Component State variables](https://docs.flutterflow.io/resources/ui/components/component-lifecycle#update-component-state-action)**.

:::tip[Learn from video] You can learn more about state management from this video:
::: ## Rebuild [Action] The **Rebuild** action allows you to refresh a page or a component’s UI. This is especially useful when data changes dynamically; for example, after an API call, a database update, a custom action, or a class method modifies the internal state, and you want the latest data or UI state to be reflected instantly. The Rebuild action provides different update types depending on where it is used: - **Rebuild Page:** When on a page, you will see the **Rebuild Current Page** option, which refreshes the entire page’s UI. - **Rebuild Component:** When on a component, you will see the **Rebuild Current Component** option, which refreshes only that specific component. - **Rebuild Containing Page:** When on a component, you will see this option as well, which refreshes the entire page that contains the component. For example, if you have a **"Confirm"** button inside a dialog component that updates an order’s status, selecting this action will refresh the parent page to instantly show the updated order list. ![rebuild](https://docs.flutterflow.io/assets/images/rebuild-51b6826a3452f3174ff2b8e615f78627.avif) # Widget State > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/state-management/widget-state Widget state refers to the data or information that a widget holds, which can change over time and affect the widget's appearance or behavior. In FlutterFlow Studio, the state is particularly important for form widgets, such as text fields, checkboxes, and radio buttons, as it allows these widgets to respond to user interactions. **Widget state** refers to the data or information that a widget holds, which can change over time and affect the widget's appearance or behavior. In FlutterFlow Studio, the state is particularly important for form widgets, such as text fields, checkboxes, and radio buttons, as it allows these widgets to respond to user interactions. Additionally, **Widget Focus State** refers to the state that indicates whether a widget, such as a text field, currently has focus or not. When a widget has focus, it is ready to receive user input, and its appearance typically changes to indicate this (e.g., a text field with a blinking cursor). **Key Points:** - **Dynamic Data:** Represents values that change over time (e.g., user input in a text field). - **Automatic Management:** FlutterFlow Studio handles the state, so developers do not need to write explicit state management code. - **Reactive Updates:** Changes in the state automatically update the widget's display. ![widget-state.png](https://docs.flutterflow.io/assets/images/widget-state-39a918ddf281ee26e78cda1368918400.png) ## Managing Widget States FlutterFlow Studio simplifies state management by providing built-in support for handling widget states. This means developers do not need to manually create or manage the state of form widgets. Instead, FlutterFlow Studio automatically manages the state for these widgets, ensuring a seamless and intuitive experience. Some examples of widget states exposed by FlutterFlow Studio: - **Text Fields:** The state of text fields is automatically managed, including the input text and validation states. - **Checkboxes:** The state of checkboxes is managed, indicating whether they are checked or unchecked. - **Radio Buttons:** The state of radio buttons is managed to reflect the selected option. In the following example, we find widget state and widget focus state of a TextField being exposed by FlutterFlow Studio on the page it was created and available as an option in the variable menu. ![using-widget-state.png](https://docs.flutterflow.io/assets/images/using-widget-state-12d396c12118d4cfb1607a772829fef1.png) :::tip[Scope] **Widget states** are mostly available for access on the page or component where they were created. However, when you add a component to a page, the widget states exposed in the component will also be available in its parent page. For instance, consider a component with two `TextFields` – one for the username and another for the password. This component could be utilized in both sign-in and sign-up pages. In such cases, you need to be able to retrieve the values from each TextField as if they were added directly to the page. You can access the widget state of a component's widgets on your page, just as you would for other widgets. Simply navigate to the **Set Variable menu > Widget State > [component_name] > [your_widget]**.
::: FlutterFlow Studio allows you to update the state of these widgets through actions exposed by the platform. For example, if you want to clear a TextField when the Send button is clicked on a form-like page, then in the Actions Flow, you can find relevant actions such as **Clear TextField**. This enables dynamic interaction and state management directly within the visual development environment. ![managing-widget-state.png](https://docs.flutterflow.io/assets/images/managing-widget-state-4c54f8309e04934c13235f8d65a5117c.png) ## Action Triggers for Form Widgets FlutterFlow Studio allows you to bind action triggers to widget states, such as calling an API on focus change of a textfield or changing the appearance of a button when a checkbox is checked. **Most common Action Triggers exposed by form widgets:** - **On Focus Change:** Triggered when a widget, such as a text field, gains or loses focus. For example, showing additional tips or validation messages when the user starts typing in a text field. - **On Submit:** Triggered when a form or text field is submitted. For example, validating input and submitting data when the user presses the enter key or clicks a submit button. - **On Change:** Triggered when the value of a widget changes. For example, real-time validation or updating state as the user types in a text field or changes a selection in a dropdown. - **On Completed:** Triggered when a specific input is completed, such as entering a pincode. For example, automatically moving to the next step in a process after a complete and valid pincode is entered. - **On Selected:** Triggered when an option is selected in widgets like choice chips, checkboxes, radio buttons, or sliders. For example, updating the UI or performing actions based on the selected option. These triggers allow developers to create interactive and responsive applications by defining specific actions that occur in response to user interactions with form widgets. ![action-triggers-widget-state.png](https://docs.flutterflow.io/assets/images/action-triggers-widget-state-06bf4658efc13383380f0a863b4d8b31.png) # Overview > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/overview Learn how to add navigation in FlutterFlow Studio. Navigation in FlutterFlow Studio is a crucial aspect of app development, enabling users to move between different pages or screens. This is achieved through a system of routing, where each page is assigned a unique route identifier. Understanding how navigation works and what happens to the navigation stack under the hood can help you create a seamless user experience. ## What are Routes? Routes are essentially the paths that define different screens or pages within the app. Each route is associated with a specific screen and has a unique identifier that allows the app to recognize and navigate to it. For example, a route could point to the home screen, a product details page, or a user profile page. | Page | Route | |------------------|------------------| | Home | /home | | Product Details | /product-details | | Cart | /cart | ## Navigation Stack Logic The **navigation stack** is a data structure that keeps track of the routes as they are pushed and popped off the stack. It follows the Last In, First Out (LIFO) principle, meaning the last screen that was navigated to is the first one to be navigated away from when the user presses the back button. Here’s how the navigation stack logic works in FlutterFlow Studio: ### 1. Pushing a Route When you navigate to a new screen, that route is pushed onto the top of the stack. For example, if you are on the home screen and navigate to the profile screen, the profile screen route is pushed onto the stack. ![pushroute.avif](https://docs.flutterflow.io/assets/images/pushroute-cc5b83d167d62aa624456a276a131eff.avif) ### 2. Popping a Route When you navigate back, the topmost route is popped off the stack, and the previous screen becomes visible. For example, if you are on the profile screen and press the back button, the profile screen route is popped off, revealing the home screen. ![poproute.avif](https://docs.flutterflow.io/assets/images/poproute-9da2a09d047959456e62dda3b2b3c9c9.avif) ### 3. Replacing a Route Sometimes, you might want to replace the current route with a new one without adding to the stack. This is useful for actions like logging in, where you don’t want users to navigate back to the login screen after they have logged in. For example, after a successful login, replace the login screen route with the home screen route. ![replaceroute.avif](https://docs.flutterflow.io/assets/images/replaceroute-a31973716265cb977d00fc85c50fd311.avif) ## Navigation Actions In FlutterFlow Studio, there are three main navigation actions you can use to navigate between different screens in your app. Here are they: 1. [Navigate To (Push a Route)](#1-navigate-to-push-a-route) 2. [Navigate Back (Pop a Route)](#2-navigate-back-pop-a-route) 3. [Replace Route](#3-replace-route) ### 1. Navigate To (Push a Route) This action involves navigating to a new screen by pushing a new route onto the navigation stack. **What Happens Under the Hood:** - When you push a route, a new screen is placed on top of the current stack. This means the previous screen is still in the stack but is not visible to the user. - The new screen becomes the active screen that the user interacts with. :::note Learn more about adding this action in the [**page navigation guide**](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action). ::: ### 2. Navigate Back (Pop a Route) This action involves navigating back to the previous screen by popping the current route off the navigation stack. **What Happens Under the Hood:** - When you pop a route, the current screen is removed from the stack, and the previous screen becomes active again. - This action effectively reverses the last push operation. :::note Learn more about adding this action in the [**page navigation guide**](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-back-action). ::: ### 3. Replace Route This action involves replacing the current route with a new route. Unlike pushing a route, replacing a route does not add to the stack but swaps the current route with the new one. **What Happens Under the Hood:** - The current screen is removed from the stack, and the new screen is added in its place. :::note - This is useful when you want to prevent the user from navigating back to the previous screen. - This action is essentially the **Navigate To** action with the **Replace Route** option enabled. Learn more about adding this action in the [**page navigation guide**](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action). ::: # Page Navigation > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/page-navigation Learn how to navigate between pages in FlutterFlow Studio. Page Navigation in FlutterFlow Studio is handled through routing, where each page is identified by a unique route. Navigation can be programmed to happen on events like button clicks, leading to actions such as pushing a new route (opening a new page) or popping a route (returning to a previous page). FlutterFlow Studio simplifies the routing process, allowing you to visually design the navigation flow of your app. Let's see how to do that in FlutterFlow Studio:
### Navigate To [Action] The Navigate To Action allows you to set the next page and modify other navigation-related properties: | Action Property Name | Type | Description | |---------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **Allow Back Navigation** | Toggle | Toggle this to prevent the user from navigating back to this page after moving to the next page | | **Replace Route** | Toggle | Use this option to replace the current page in the navigation stack. For example, if a user navigates from Page A to Page B and then to Page C, pressing the back button on Page C would normally return to Page B. However, if **Replace Route** is enabled on Page B, the route changes to Page A -> Page C; therefore, pressing the back button on Page C will take the user back to Page A. | | **Transition Type** | Drop Down | This allows you to specify an animation that will be applied while navigating away from a screen. Options include **Default, Instant, Fade In, Slide Up, Slide Down, Slide Left, Slide Right,** and **Scale**. | | **Transition Duration** | Double | Set the duration of the transition animation in milliseconds | | **Page Parameters** | | Use this to send data to the next page during navigation. | :::note[Note] **Allow Back Navigation** does not affect the Android back button. To disable the Android back button, set **Disable Android Back Button** property on the destination page. :::
![Nav.png](https://docs.flutterflow.io/assets/images/Nav-d529f8e9c3602314f487d0cf3a6ab17d.png)
Properties of a Navigate To Action
### Navigate Back [Action] In the next page you are navigating to, ensure that you add a 'Navigate Back' action to the AppBar or wherever you want users to navigate from. Let's add a ' Navigate Back' action to our subsequent page, from which we navigated in the previous section:
# Passing Data between Pages > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/passing-data Learn how to pass data between pages in FlutterFlow Studio. As you build your app, you'll often encounter the need to pass through or transfer data from one page to another. For instance, when a user taps on a product item, you may want to send product data to the next page to display its details. ## Page parameters This process of passing data between pages is accomplished using **Parameters**. When navigating from one page to another, you can send parameters to configure the destination page based on the data from the current page. This is useful for tasks like passing a user ID to a profile page or specific details to a detailed view page. To create a page parameter, follow the steps:

When a page parameter is set to Required, it indicates that this parameter is mandatory when navigating to this page. Users must provide this value; otherwise, FlutterFlow Studio will throw errors. However, if you are creating an optional parameter, please ensure this option is unchecked. Additionally, you can specify a default value in the Default Parameter Value field to safeguard against incoming values that are empty or null. This step is optional. ![Page-Params.png](https://docs.flutterflow.io/assets/images/Page-Params-da3dd75f70356ff8b7bb002e2c199dd4.png) If you have created a **Required** Page Parameter and there is a Navigation Action already set on your previous page, FlutterFlow Studio will throw errors because this required parameter has not yet been sent from the previous page. Let's fix that:
:::note Passing data can only be tested in **Run** and **Test** Mode (it can not be tested in Preview Mode). ::: ## When to use Page Parameters? Page parameters are used to pass essential data between pages that is not persisted in the app’s global state but is necessary for specific functionalities or displays on the subsequent page. Here’s a breakdown of typical uses: - **Contextual Data:** Information that defines the context of the new page, such as identifiers for items or entities that the page must display. This could include identifiers for transactions, specific products, or user profiles that were selected on the previous page. - **Configuration Options:** Settings or options chosen by the user that affect how the next page functions or appears. For example, filter or sort preferences selected on a list page that need to be applied on a subsequent results page. - **Operational Parameters:** Values needed for calculations or logic on the next page that are generated through user activities on the current page. These could be values like quantities, dates, or configuration details necessary to perform operations or initiate processes on the next page. Page parameters are thus essential for maintaining a seamless user experience, enabling the new page to function as intended based on the specific needs and inputs from a previous interaction. ## Allowed Data Types You can pass any supported data from one page to another via *page parameter(s)*. You can think of a *page parameter* as a variable that holds the value being passed from one page to another. :::note If you are using Firestore Database, most of the time, you would pass the *Document* (an actual record inside the Firestore collection) and *Document Reference (points to actual document)* between the pages. ::: --- ## Video guide If you prefer watching a video tutorial, here's the one for you:
# Overview > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/special-page-navigations Learn how to add Special Page Navigations in FlutterFlow Studio. FlutterFlow Studio provides special navigation widgets like Tab Bar, NavBar, and PageView for advanced navigation scenarios: - **Tab Bar**: Used for navigating between different sections of your app with tabs, ideal for organizing content into categories. Learn more [here](https://docs.flutterflow.io/concepts/navigation/tabbar). - **NavBar**: A bottom navigation bar that helps users switch between major sections of your app seamlessly. Learn more [here](https://docs.flutterflow.io/resources/ui/pages/scaffold#nav-bar). - **PageView**: Allows for swipeable pages, perfect for creating onboarding screens or multi-step forms. Learn more [here](https://docs.flutterflow.io/concepts/navigation/pageview). # TabBar > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/tabbar Learn how to use the TabBar widget in FlutterFlow Studio to create a horizontal row of tabs for navigating different content views in your app. The TabBar widget displays a horizontal row of tabs, allowing users to switch between different content views by tapping on the tabs. Each tab typically represents a different section or category of content. It can be used in various types of apps, such as news apps with different categories, e-commerce apps with product categories, or social media apps with different sections like feeds, notifications, and messages. ![TabBarDemo.avif](https://docs.flutterflow.io/assets/images/TabBarDemo-d5bf1d3b69572bef578ea1da432a07b1.avif) ## Adding TabBar widget To add the TabBar widget to your app: 1. Add the **TabBar** widget from the **Layout Elements** tab. 2. By default, it adds three tabs to the page and shows the first one in the canvas. In the widget tree, it is represented as **Tab** and **TabBar Page**. To see another tab in the canvas, select the **TabBar** widget, move to the **Properties Panel,** and ****set the **Active Tab** to the one you want to see. 3. To customize the Tab: 1. Select the **Tab >** Move to **Properties Panel**. 2. Use the **Text** property to change the label of the Tab. 3. You can also [add Icon](https://docs.flutterflow.io/resources/ui/widgets/icons), align it horizontally, and set its margin. **Tip**: To only display Icon, remove the Text value. 4. Inside the **TabBar Page**, you can replace the existing **Text** widget with any widget of your choice. 5. To add a new tab, move to the **Properties Panel > Active Page >** click **+ Add Page**. :::tip - If you want to adjust the height of a TabBar Page, wrap a TabBar widget inside a container and then set the container’s height. - You can find the currently selected tab index from *set from variable menu > widget state > TabBar Current Index*. :::
## Change tab in response to widget action If you want to change the tab selection in response to a widget action, such as a button click, you can do so by adding the [Control Tab Bar](#control-tab-bar-action) action. ## Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. ### Customizing label To customize the tab label: 1. Select the **TabBar** widget > move to the **Properties Panel > Label Properties**. 2. To set different colors when the tab is selected and unselected, use the **Selected Color** and **Unselected Color** properties. 3. To add some space around the label, use the **Label Padding** property. 4. Use the **Label Style** property to change its [styling](https://docs.flutterflow.io/resources/ui/widgets/text#common-text-styling-properties). You can also set the label styling for the unselected tab text by enabling the **Custom Unselected Label Style**.
### Customizing tab By default, the tab in the TabBar widget is displayed with an indicator style, which includes a line under the tab to indicate the currently viewed page. However, you have the flexibility to change the tab's styling to achieve different visual effects. Instead of the indicator style, you can customize the tab to appear as a row of buttons or a toggle button, depending on your design requirements and preferences. To change the tab styling: 1. Select the **TabBar** widget > move to the **Properties Panel > Tab Properties**. 2. Choose the **Tab Bar Style** from **Indicator**, **Button** and **Toggle Button**. 3. When the style is set to **Indicator**, you can set the indicator **Color** and **Weight** (thickness). ![customizing-indicator-style.png](https://docs.flutterflow.io/assets/images/customizing-indicator-style-b7a47fa5c321f45886a3d56f30de3d4b.png) 4. When the style is set to **Button**, you have the following options to customize: 1. To set the tab background color for selected and unselected states, use the **Fill Color** and **Idle** **Fill Color,** respectively. 2. To set the border color for selected and unselected states, use the **Border Color** and **Idle Border Color,** respectively. Also, make sure to set the **Border Width** to see the border. 3. To adjust the rounded corner of each tab, use the **Border Radius** property. 4. You can also set the **Elevation** and **Button Margin** properties for all tabs. ![customizing-button-TabBar-style.png](https://docs.flutterflow.io/assets/images/customizing-button-TabBar-style-f1f73cb838dc1c4108e5c896afee3728.png) 5. When the style is set to **Toggle** **Button**, you have the following options to customize: 1. To set the tab background color for selected and unselected states, use the **Fill Color** and **Idle** **Fill Color,** respectively. 2. To set a border around all tabs, use the **Border Color** and **Border Width** properties. 3. To add a divider between the tabs, use the **Div** **Border Color** and **Border Width** properties. 4. You can also set the **Elevation** and **Button Margin** properties for all tabs. ![customizing-toggle-button-TabBar-style.gif](https://docs.flutterflow.io/assets/images/customizing-toggle-button-TabBar-style-07fbd2de26b3f0c8650363011009897b.gif) ### Setting initial tab index You might want to display a specific tab as selected as soon as the TabBar is loaded. To do so, move to the **Properties Panel > General Properties >** enter the **Initial Tab Index** value. Please **note** that the tab index starts from 0. So, if you want to set tab 1, you should enter 0. If you want to set tab 2, you should enter 1, and so on. ![tab-index.webp](https://docs.flutterflow.io/assets/images/tab-index-00877bde5779f8893f72fc07f031352a.webp) ![setting-initial-tab-index .gif](https://docs.flutterflow.io/assets/images/setting-initial-tab-index-6852460a76701225d98cfde9a9aa6cc2.gif) ### Change the tab bar position Sometimes you might want to change the default tab bar position, i.e., from top to bottom. You can do so by navigating to **Properties Panel > General Properties >** changing the **Tab Bar Position** value. ![change-the-tab-bar-position.gif](https://docs.flutterflow.io/assets/images/change-the-tab-bar-position-943b2d2684eb747fac67e63083316fcc.gif) ### Making TabBar Scrollable When you have a large number of tabs, they may not all fit on the screen. To address this, you can make the tabs scrollable, allowing the user to scroll horizontally to view all the tabs. To make a TabBar scrollable, select the TabBar widget > move to the **Properties Panel > General Properties >** enable the **Tab Bar Scrollable** option. :::note If there are fewer tabs, you can control the alignment using the **Tab Bar Horizontal Alignment** property. However, for fewer tabs, you may not need to make them scrollable, but the option is available if required. :::
### Set margin Margin adds a space between the TabBar and its border. To change the margin, select the **TabBar** widget, move to the **Properties Panel > General Properties >** find the **Tab Bar** **Margin** property, and change the values. ![set-margin .gif](https://docs.flutterflow.io/assets/images/set-margin-f67175f0b39524cb5cf59d3b6cf1cf48.gif) ### Disable swipe to switch tab By default, you can switch to another tab by swiping and clicking on the tab. In case you want to disable the swiping behavior, you can do so by navigating to **Properties Panel > General Properties >** disabling the **Allow Swiping to Switch Tabs**.
### Keeping tab state alive By default, when you switch to a different tab, the state of the previous tab is lost and gets rebuilt when you switch back to it. However, in certain scenarios, you may want to maintain the state of each tab to preserve user input, scroll positions, data from an API call, or any other relevant data. This is called keeping the tab state alive. To keep the tab state alive, select the **TabBar** widget **> Properties Panel > General Properties>** enable **Keep Tab State Alive**.
## Control Tab Bar [Action] By using this action, you can gain more control over the tab-switching behavior of the TabBar widget. For instance, you can enable users to move to the next or previous tab with a single tap of a button or to quickly jump to a specific tab based on their preferences.

### Types of action These are the types of actions you can add to the TabBar. - **Previous**: Switch to the previous tab in the TabBar. - **Next**: Switch to the next tab in the TabBar. - **First**: Switch to the first tab in the TabBar. - **Last**: Switch to the last tab in the TabBar. - **Jump to**: Switch to a specific tab in the TabBar. Please **note** that the tab index starts from 0. So, if you want to jump to tab 1, you should enter 0. If you want to jump to tab 2, you should enter 1, and so on. ### Adding Control Tab Bar action Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**. 3. Search and select the **Control Tab Bar** (under *Widget/UI Interactions*) action. 4. Set the **Tab Bar to Control** to the **name** of the tab bar added to your page. 5. Select the [action type](#types-of-action).

## Video guide If you prefer watching a video tutorial, here's the one for you:
# PageView > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/pageview Learn how to use the PageView widget for creating swipeable pages, perfect for creating onboarding screens or multi-step forms. The PageView widget is used to create swipeable pages. In page view, you can add multiple child widgets, each of which is considered a page and can be scrolled horizontally or vertically. The PageView is useful when you have a collection of pages that you want to display one at a time, especially if you want the user to be able to swipe between them, such as in an onboarding screen, an app that shows a short video by swiping up or down just like Instagram, TikTok, Youtube shorts, etc. ![PageViewDemo](https://docs.flutterflow.io/assets/images/PageViewDemo-8515173fd8c7f97e54d5d4fef3983cf7.avif) ## Adding PageView widget To add the PageView widget to your app: 1. Add the **PageView** widget from the **Layout Elements** tab. 2. By default, it adds three pages and shows the first one in the canvas. In the widget tree, it is represented as **PageView Page**. To see another page in the canvas, move to the **Properties Panel >** set the **Active Page** to the page you want to see. 3. To add a new page, move to the **Properties Panel > Active Page >** click **+ Add Page**. 4. To delete any page, select the **PageView Page** (which you want to delete) from the widget tree or the canvas area and press the **Delete** key on the keyboard. 5. By default, PageView Page contains an [Image](https://docs.flutterflow.io/resources/ui/widgets/image) widget; however, you can customize it as per your requirement. For example, if you want to use the PageView widget to create an onboarding experience, you could wrap (`⌘` + B) the default image widget inside the Stack widget and then add some more widgets.
## Adding infinite scroll The PageView widget is an incredibly versatile widget that can be utilized in a variety of situations to create interactive applications. For example, you might want to use it in an app that involves reading books, magazines, or similar content to mimic the experience of flipping through pages. In such situations, you might consider adding an infinite scroll on this widget, which automatically loads the new pages as you swipe. We have already covered how to [add infinite scroll on ListView](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#adding-infinite-scroll) widget, which will give you an overall idea of how to add infinite scroll on the PageView widget as well. ## Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. ### Changing the scroll direction By default, the PageView comes with a horizontal scroll for the pages. To change the scroll direction to vertical, move to the **Properties Panel > Page View Properties >** set the **Axis** to **Vertical**.
### Enable/disable swipe to scroll This widget allows you to change the page using a swipe gesture as well as clicking on the indicator (3 dots at the bottom indicate which page is being viewed). You can change this behavior and only allow changing the page on click of the indicator. To do so, move to the **Properties Panel > Page View Properties >** disable **Allow swipe scrolling**.
### Keep page state alive By default, a PageView rebuilds a page when you swipe away and return to it. This resets its state, such as text entered in a form, and runs its API calls and backend queries again. To preserve pages you've visited, open **Properties Panel > Page View Properties** and turn on **Keep Page State Alive**. The PageView retains form input and scroll position when you swipe back to a page. It also avoids rerunning that page's API calls and backend queries. This setting also applies to pages generated from a list and to pages that use infinite scroll.

:::caution Keeping pages alive uses more memory. For pages generated from a list or loaded with infinite scroll, the memory use grows with every page that the user views. For pages generated from a list, the kept state belongs to the page position, not to the list item. If the list is re-sorted or filtered, the state stays at the same position and appears on whichever item is now there. ::: ### Update page on swipe Sometimes you might want to rebuild the page on which the PageView widget is contained. i.e., rebuilding the outside of the page view widget. You might want to load data or show/hide UI elements based on the page currently being displayed. For example, you could display a floating action button only on a certain page or show/hide certain widgets based on the page index. To do so, move to the **Properties Panel > Page View Properties >** turn on the **Update Page on Swipe**. Here's an example of displaying the current page index on a page that contains the PageView widget.
### Trigger action on swipe You might want to trigger an action when the page is swiped in the PageView widget. For example, you might want to load data for a specific page only when the user swipes to it instead of loading all the data upfront. To trigger action on swipe: 1. Select the widget from the widget tree or canvas area. 2. Select **Actions** from the Properties Panel (the right menu), and click **+ Add Action**. 3. You will notice that the **Type of Action** (aka callback) is already set to **On Page Swipe**. That means actions added under this will be called whenever the page is swiped. 4. Now, you can add any action here. Here is an example showing the [snackbar](https://docs.flutterflow.io/resources/ui/pages/scaffold#snackbar) message whenever the page is swiped to the second page.
### Setting initial page index You might want to display a specific page as soon as it is loaded. To do so, move to the **Properties Panel > Page View Properties >** enter the **Initial Page Index** value. Please **note** that the page index starts from 0. So, if you want to set page 1, you should enter 0. If you want to set page 2, you should enter 1, and so on. ![setting-initial-page-index.png](https://docs.flutterflow.io/assets/images/setting-initial-page-index-0e4bce1a95e33b2bef3bc25dacd1c5b7.png) ### Set margin Margin adds a space between the PageView content and its border. To change the margin, select the **PageView** widget, move to the **Properties Panel > Page View Properties >** find the **Margin** property, and change the values.
### Customize the indicator The Indicator helps you identify which page is currently being viewed. You can change the appearance of the Indicator using the various properties available under the *Indicator Properties* section. To customize the indicator: 1. Select the **PageView** widget, and move to the **Properties Panel > Indicator Properties**. 2. To change the indicator position, 1. Find the **Horizontal Alignment** property and adjust the value by using the slider or entering a value. A value of -1 will place the Indicator all the way to the left, while a value of 1 will place the Indicator all the way to the right. 2. Similarly, you can also change the indicator position vertically using the **Vertical Alignment** property. A value of -1 will place the Indicator all the way to the top, while a value of 1 will place the Indicator all the way to the bottom. 3. To add padding around the indicator, find the **Padding** property and enter the values in L (Left), T (Top), R (Right), and B (Bottom) properties to get the desired result. 4. To change the active and inactive color, use the **Active Color** and **Inactive Color** properties to change the color. 5. To change the indicator dot size, use the **Dot Width** and **Dot height** properties. 6. To change the size of an active dot, you can use the **Expansion Factor** property. For example, if you enter 2, the active dot size will be twice its normal size. :::note The width of the active dot is calculated by multiplying the value of the **Dot Width** property with the value of the **Expansion Factor** property. That means if the Dot Width is set to 40 and *Expansion Factor* is set to 2, then the width of the Active dot will be 80. ::: 1. To add space between the indicator dots, use the **Spacing** property. 2. To adjust the rounded corner of indicator dots, use the **Border Radius** property. 3. To show only the border, enable the **Outline** toggle. 4. If you want to hide the indicators, disable the **Show Indicator** toggle.
### Scroll PageView on button press If you use the PageView widget to create the onboarding experience, you may probably want to allow users to scroll the pages on button press (e.g., next, previous, and skip buttons) in addition to the swipe to scroll. You can do so by adding the PageView and then defining the Control Page View action on the Tap of a Button widget.

Here's an example of scrolling PageView on button press: 1. First, [add the PageView](#adding-pageview-widget) widget. 2. [Customize the PageView](#customizing) widget and add buttons to go to the previous and next pages. 3. Now select any button and define the [Control Page View action](#control-page-view-action). ## Control Page View [Action] By using this action, you can gain more control over the scrolling behavior of the PageView widget. For instance, you can enable your users to move to the next or previous page with a single tap of a button or to quickly jump to a specific page index based on their preferences. ### Types of page view action These are the types of actions you can add to the pageview. - **Previous**: Scroll to the previous page in the pageview. - **Next**: Scroll to the next page in the pageview. - **First**: Scroll to the first page in the pageview. - **Last**: Scroll to the last page in the pageview. - **Jump to**: Scroll to a specific page in the pageview. Please note that the page index starts from 0. So, if you want to jump to page 1, you should enter 0. If you want to jump to page 2, you should enter 1, and so on. ### Adding Control Page View action Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**. 3. Search and select the **Control Page View** (under *Widget/UI Interactions*) action. 4. Set the **Page View to Control** to the **name** of the page view added to your page. 5. Select the [**Page View Action Type**](#types-of-page-view-action).

## Video guide If you prefer watching a video tutorial, here's the one for you:
# Deep & Dynamic Linking > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/deep-dynamic-linking Learn how to implement deep and dynamic linking in your FlutterFlow Studio app. :::danger[Support for Dynamic Links] Firebase Dynamic Links shut down on August 25, 2025. Read more about the [**announcement here**](https://firebase.google.com/support/dynamic-links-faq). To replace them, use [**FlutterFlow Studio Dynamic Links**](https://docs.flutterflow.io/concepts/navigation/flutterflow-dynamic-links), or a third-party service such as [**Branch.io**](#deep-links-with-branchio). ::: Adding deep and dynamic linking allows you to share a special type of link that takes the user right inside the specific page of your app. You can also send the custom data with a link to load the page content based on the data. For example, you could share an interesting social media post with your friends, and they can directly access its content without manually searching the post inside the app. It just works like any website link would work. The figure below illustrates how it works:
![img.png](https://docs.flutterflow.io/assets/images/img-16416344289e75695c203df1f638b767.png)
Deep and Dynamic link flow
When you click on the link, first, it checks if the app is installed. If not, the link opens the Playstore or Appstore (based on your device) to install the app. After installing, if the page requires authentication, you'll see a login page. After successful login, you can access the content shared with you. The best thing to note here is that even if the app has a different flow for accessing the page content (e.g., Home Page -> All Posts -> Single Post), you can bypass the flow and directly open a specific page (e.g., Single Post). ## Deep Link The deep link allows you to create a URL that will open a specific page in your app. For the deep links to work, you must have the app installed on your device. ### URL Scheme (structure) The deep link consists of three parts. It begins with the scheme followed by the host and page name, such as `designersapp://designersapp.com/profile`. ![img_1.png](https://docs.flutterflow.io/assets/images/img_1-e9bcc7b4c7a527a117dd98d2e4e33f33.png) If the page name is not provided (i.e. `designersapp://mydesignersapp.com/)`It will open the app's landing page. ![img_2.png](https://docs.flutterflow.io/assets/images/img_2-67ea88901a2b863a7c95e0e5858a017c.png) ### Adding Deep Link Let's build an example of sharing and opening a profile page using the deep link. The example looks like the below:
Sharing and opening a deep link
The steps to add the deep link are as follows: 1. [Set URL scheme](#1-set-url-scheme) 2. [Setting page URL](#2-setting-page-url) 3. [Sharing deep link](#3-sharing-deep-link) 4. [Testing deep link](#4-testing-deep-link) #### 1. Set URL scheme In this step, You will set the URL scheme. To do that: 1. Navigate to **Settings & Integrations > General > App Details.** 2. If you want to add deep linking on multiple pages and all of them require users to log in, turn on the **Pages Requires Authentication by Default**. 3. In **URL scheme** fields, by default we add the values based on your project name. To change it, enter the **scheme** **name** (before "://") and **hostname** (after "://"). 4. If you want users to navigate back to the home page instead of closing the app when they press the back button from a deep link page, enable the **Pages Are Subroutes of Root Page** option. ![img_3.png](https://docs.flutterflow.io/assets/images/img_3-efe840e2cf4de2fb903743d38cf7ebe5.png) :::tip We recommend enabling this option to increase user engagement with your app. ::: #### 2. Setting page URL The page URL points to the specific page in your app, which is used on the Web and for deep linking on mobile. To set the page URL: 1. Select the page that you would like to open via a deep link. 2. Move the **properties panel** on the right and open the **Route Settings** section. 3. By default, the Route is the current page name. Edit this if you want a different name in the page URL. 4. By default, the page does not require authentication when it opens via the deep link. However, checkmark the **Requires Authentication** if your app works only after login.
Setting page URL
#### 3. Sharing deep link You can share the deep link of the current page by adding the [share action](https://docs.flutterflow.io/concepts/navigation/share-action). To share the deep link of the current page: 1. Select the page that you would like to open via a deep link. 2. From that page, select any widget (e.g. share button) from the widget tree or the canvas area. 3. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action flow Editor** in a new popup window. 1. Click on the **+ Add Action**. 2. On the right side, search and select the **Share** action. 3. Set the **Value Source** to **From Variable**. 4. Set the **Source** to **Global Properties**. 5. Set the **Available Options** to **Link To Current Page** and click **Close**.
Sharing deep link
#### 4. Testing deep link Deep links can not be tested in Run Mode. Instead, you will need to test the deep links on a real device/emulator. Before you test the deep link, you need to get it first. The easiest way to get it is to run the app on a device/emulator, click on the share button and then copy the deep link. Now, you can test the deep link in two ways:
Using CLI tools If you have Android Studio with the SDK platform tools installed, you can run the following command in the terminal and replace it with your deep link. Copy ``` adb shell am start -a android.intent.action.VIEW \ -c android.intent.category.BROWSABLE \ -d "designersapp://designersapp.com/profile" ```
Using Firefox mobile browser You can also test the deep link in a Firefox mobile browser. To do so, open the browser, paste the URL in the search bar, open the options menu and click on the **Open in app**. Here is how you do it:
Using Firefox mobile browser to open the deep link
## Dynamic Links with Firebase Dynamic Links [Deprecated] :::caution Firebase Dynamic Links has been retired. FlutterFlow Studio no longer generates Firebase Dynamic Links code for your app, and a saved **Use Firebase Dynamic Links** setting no longer enables the service. This section is kept for reference. To create dynamic links, use [**FlutterFlow Studio Dynamic Links**](https://docs.flutterflow.io/concepts/navigation/flutterflow-dynamic-links). ::: The dynamic link opens a specific page in your app. Unlike the deep link, the dynamic link survives the app install. That means if the user has not installed the app, they can be taken to the respective store to install the app. After the app is installed, users can be taken straight to the intended app page. For the dynamic link to work, you need to enable the [deep link](#adding-deep-link). You can think of a dynamic link as the additional benefit of the deep link. :::note FlutterFlow Studio uses [**Firebase Dynamic Link**](https://firebase.google.com/docs/dynamic-links) (a product from Firebase) to create dynamic links. ::: Let’s walk through an example of sharing and opening a profile page using a dynamic link. The example will look like this:
Dynamic link example
The steps to add the dynamic link are as follows: 1. [Setting up a domain](#1-setting-up-a-domain) 2. [iOS setup](#2-ios-setup) 3. [Set URL scheme](#3-set-url-scheme) 4. [Setting page URL](#4-setting-page-url) 5. [Sharing dynamic link](#5-sharing-dynamic-link) 6. [Testing dynamic link](#6-testing-dynamic-link) ### 1. Setting up a domain The dynamic link requires a domain name that will be used as the URL prefix in the link. To set up the domain name, follow the steps below: 1. Open the [Firebase console](https://console.firebase.google.com/), and click on **Dynamic Link ** (on the left side menu). 2. Click on the **Get Started** button. This will open a popup. 3. Enter the domain name. If you don't own a domain, you can select the free **Google Provided Domain** that ends with a **page.link**. To set up your own domain, follow the guide [here](https://firebase.google.com/docs/dynamic-links/custom-domains). 4. If you chose Google Provided Domain, you could **Finish** the setup.
>
Setting up a domain for the dynamic link
### 2. iOS setup You must complete additional configuration for the dynamic link to work on the iOS devices. Setting up iOS includes: #### 2.1 Add App Store and Team ID to the Firebase project To add the App Store and Team ID to the Firebase project: 1. Open the [Firebase console](https://console.firebase.google.com/), and click on **Project Overview** (on the left side menu). 2. Select the iOS project and click on the Settings (gear) icon inside. 3. Scroll down to see your selected iOS project. 4. Find the **App Store ID** field, click on the edit icon (pencil icon), enter the ID, and click * *Save**. To know where is your App Store ID, click on the question mark icon beside the label. 5. Similarly, find the **Team ID** field, click on the edit icon (pencil icon), enter the ID, and click **Save**. To know where is your Team ID, click on the question mark icon beside the label.
Adding App Store and Team ID to the Firebase project
#### 2.2 Adding Associated Domain capability to App Store To add the Associated Domain capability on App Store: 1. Open the [Apple Developer homepage](https://developer.apple.com/account) and select * *Certificates, IDs & Profiles**. 2. Select **Identifiers** (far left menu) and then click on your app identifier. 3. Checkmark the **Associated Domains** and click **Save**.
Adding Associated Domain capability to App Store
### 3. Set URL scheme In this step, You will set the URL scheme. To do that: 1. Navigate to **Settings & Integrations > General > App Details.** 2. If you want to add deep linking on multiple pages and all of them require users to log in, turn on the **Pages Requires Authentication by Default**. 3. Also, turn on the **Use Firebase Dynamic Links**. 4. In **URL scheme** fields, by default, we add the values based on your project name. To change it, enter the **scheme** **name** (before `://`) and **hostname** (after `://`). 5. If you want users to navigate back to the home page instead of closing the app when they press the back button from a deep link page, enable the **Pages Are Subroutes of Root Page** option. * *Tip**: we recommend enabling this option to increase user engagement with your app. ![img_4.png](https://docs.flutterflow.io/assets/images/img_4-982d4b2527f6ec15aef536da88b9733a.png) ### 4. Setting page URL The page URL points to the specific page in your app, which is used on the Web and for deep linking on mobile. To set the page URL: 1. Select the page that you would like to open via a dynamic link. 2. Move the **properties panel** on the right and open the **Route Settings** section. 3. By default, the Route is the current page name. Edit this if you want a different name in the page URL. 4. By default, the page does not require authentication when it opens via the dynamic link. However, checkmark the **Requires Authentication** if your app works only after login.
Setting page URL
### 5. Sharing dynamic link You can share the dynamic link of the current page by adding the [**Generate Current Page Link **](https://docs.flutterflow.io/concepts/navigation/generate-current-page-link) action and then sharing it using the [**Share Action**](https://docs.flutterflow.io/concepts/navigation/share-action). To share the dynamic link of the page: 1. Select the page that you would like to open via a deep link. 2. Select any widget (e.g., share button) from the widget tree or the canvas area. 3. First, add the action to [Generate Current Page Link](https://docs.flutterflow.io/concepts/navigation/generate-current-page-link#adding-generate-current-page-link-action). 4. Now chain the next action to share the dynamic link. 5. To do that, click on the **+** button at the bottom of the box and select **Add Action**. 6. On the right side, search and select the **Share** action. 7. Set the **Value Source** to **From Variable**. 8. Set the **Source** to **Widget State**. 9. Set the **Available Options** to the **Current Page Link** and click **Close**.
Sharing dynamic link
### 6. Testing dynamic link Dynamic links can not be tested in Run Mode. Instead, you will need to test the links on a real device/emulator. Before you test the dynamic link, you need to get it first. The easiest way is to run the app on a device/emulator. Click on the share button and then copy the dynamic link. Now you can test the link in a Firefox mobile browser. To do so, open the browser and paste the URL into the search bar. Here is how you do it:
Testing Dynamic Link
## Passing Data with a Link In most cases, you might want to pass custom data with a link. For example, you send the product page link with a discount code and share the profile page with its profile ID. Passing custom data with the link can be used to retrieve the information required to display on the page.
Passing profile id in the link
To pass custom data with the link, you need to have the following: 1. Make sure you have a parameter defined on a page you want to pass in a dynamic link.
![img_5.png](https://docs.flutterflow.io/assets/images/img_5-0f8209160033e995ee2a0e3a6fcc4434.png)
Adding parameter on page
2. In the **Route Settings**, include a parameter as part of the route by prefixing it with a colon (**:**) for example, `profilePage/:profileId`.
![img_6.png](https://docs.flutterflow.io/assets/images/img_6-d13a06bd905292dea8a8211cb0d81484.png)
Including a parameter in the route
That's all you need to pass custom data with a **Deep Link** or **Dynamic Link**. ## Deep Links with Branch.io Since **Firebase Dynamic Links** have been deprecated and can no longer be used for new Firebase projects, we can integrate a powerful alternative: **[Branch.io](https://branch.io/)** — a cross-platform solution for deep linking and deferred linking. With Branch, we can support robust deep linking inside FlutterFlow Studio apps without writing a backend from scratch. ### Branch.io Configuration Start by setting up your project in the [Branch Dashboard](https://dashboard.branch.io). Once you’ve created a project: **1. Note down your Branch Key** Once you create a project, the first thing you’ll need to do is note down your **Branch Key**.

This key uniquely identifies your app and will be required later when setting up your FlutterFlow Studio configuration. **2. Set up Redirect Links** In the Branch dashboard, you’ll find settings to define fallback URLs — these determine where users are sent if your app isn’t installed. Typically, you would redirect users to the App Store, Play Store, or a custom landing page.

Setting up redirects is important because it ensures that your links don't break and that users always have a seamless experience, even if they need to install the app first. **3. Create a Smart Link** After setting up your project and redirects, you can create a new Smart Link from the **Quick Links** tab in the Branch dashboard. Here you’ll be able to set a link title, alias, add analytics tags, and customize the social media preview (such as the image, title, and description). Once saved, Branch will generate a Smart Link that’s ready to use across your campaigns and app flows. Here's a short demo:
### FlutterFlow Studio Configuration Setup To make **Branch Smart Links** work in your FlutterFlow Studio app, you’ll need to update the native configuration files via the **Custom Code** tab in your project. 1. First, create environment variables for: - `branchHostUrl` (e.g., `brnch4.app.link`) - `branchKey` (your Branch key, use it for production and optionally `branchKeyTest` for dev environments. You can toggle modes through Branch dashboard and also through FlutterFlow Studio environment toggling). 2. Then navigate to, FlutterFlow Studio > Custom Code **🔧 Android Setup** 1. Create two variables in `AndroidManifest.xml` file named `branchKey` and `branchHostUrl` and bind them to the environment variables we earlier created. 2. Add an `intent-filter` block to your **Main Activity** through the **Activity Tags** hook: ```xml ``` 3. Add an **App Component** block for meta-data: ```xml ``` **🍎 iOS Setup** 1. In `Info.plist`, add a new variable called `branchKey` and bind it to the environment variable. 2. In `Info.plist`, add the following code snippet. ```xml branch_key {{branchKey}} ``` 3. In `Runner.entitlements`, add a new variable called `branchHostUrl` and bind it to the environment variable. 4. In `Runner.entitlements`, add the following code snippet. ```xml com.apple.developer.associated-domains applinks:{{branchHostUrl}} ``` Branch automatically hosts and serves the `apple-app-site-association` file needed for Universal Links. You don’t need to manually upload it to your domain. **FlutterFlow Studio Routing Setup** FlutterFlow Studio also defines a Custom URI Scheme (like `myapp://`) by default. Even if you're using Branch for web-based Smart Links, it’s a good idea to keep this in sync. 1. Go to: Settings & Integrations > App Settings > App Details 2. Scroll to **Routing & Deep Linking** section. 3. Under Custom URI Scheme, match the URI host/domain to what’s defined in your Branch dashboard (e.g., `brnch4://` or `dreambrush://`). ![custom-uri.png](https://docs.flutterflow.io/assets/images/custom-uri-20835b4d1c0d276769203e5441f65618.png) Even if your links mainly use `https://`, FlutterFlow Studio's routing engine may still use the custom URI internally. Keeping this field consistent prevents confusion or route mismatches. You're now ready to use Branch Smart Links in a FlutterFlow Studio app with seamless deferred deep linking, App/Universal Link verification, and environment-based configuration. ### Integrate Flutter Branch SDK To integrate Branch with your FlutterFlow Studio app, you'll use the [`flutter_branch_sdk`](https://pub.dev/packages/flutter_branch_sdk) Dart package. This will allow your app to listen to Branch links and respond accordingly. 1. Go to your **FlutterFlow Studio project > Settings and Integrations > Pubspec Dependencies** tab, and add the following dependency. ```js flutter_branch_sdk: ^5.0.1 ``` Make sure to use the latest version available from [pub.dev](https://pub.dev/packages/flutter_branch_sdk) 2. Create a Custom Action to initialize the Branch SDK. This ensures the Branch session is set up when your app starts. ```js import 'package:flutter_branch_sdk/flutter_branch_sdk.dart'; Future initBranch() async { // Add your function code here! await FlutterBranchSdk.init(); } ``` Call this action inside the **Final Actions** of your `main.dart`. 3. Create another custom action to listen for Branch link clicks and optionally route the user: ```js // Automatic FlutterFlow imports import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/custom_code/actions/index.dart'; // Imports other custom actions import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom action code // DO NOT REMOVE OR MODIFY THE CODE ABOVE! import 'dart:async'; import 'package:flutter_branch_sdk/flutter_branch_sdk.dart'; import 'package:flutter/services.dart'; StreamSubscription? _branchSubscription; // stream subscription that listens for branch links final Set _handledBranchLinks = {}; Future handleBranchDeeplink(Future Function(dynamic data) onLinkOpened) async { // Add your function code here! if (_branchSubscription != null) return; // If already listening, ignore link _branchSubscription = FlutterBranchSdk.listSession().listen( (data) async { final clicked = data['+clicked_branch_link'] == true; if (!clicked) return; final uniqueId = data['~referring_link'] ?? data['deeplink_path'] ?? ''; if (_handledBranchLinks.contains(uniqueId)) return; _handledBranchLinks.add(uniqueId); await onLinkOpened(Map.from(data)); // call action defined by user & pass the link data. }, onError: (error) { if (error is PlatformException) { print('[Branch] PlatformException: ${error.code} - ${error.message}'); } else { print('[Branch] Unknown error: $error'); } }, ); } ``` You can pass custom key-value pairs like `"page": "paywall"` or `"navigation_type": "bottom_sheet"` when creating the Branch link, and retrieve them here to decide which screen to navigate to in FlutterFlow Studio. Be sure to test both fresh installs (deferred deep links) and existing app sessions to confirm that your actions run as expected. :::tip For a complete walkthrough, check out the tutorial video:
::: ## Branch Deeplinking Library If you’d prefer not to integrate Branch.io from scratch, we have introduced the **Branch Deep Linking Library** that you can import from the Marketplace completely free. This library sets up everything you need for routing users into your app using Branch’s smart links — with native configuration, link handling, and deep link helpers already wired in. ### Install Library You can install the [Branch Deeplinking Library from the Marketplace](https://marketplace.flutterflow.io/item/oAco1HzQHxtOVE1ssTcC). Refer to the [Add Library Item](https://docs.flutterflow.io/marketplace/adding-purchasing-item#add-library-item) instructions to see how to add it to your account. ### Branch Setup You’ll need three values from your Branch dashboard: - **Branch Key**: Your production or test key from the Branch dashboard. - **Custom Link Domain**: Your primary Branch link domain (e.g., yourapp.app.link). This is used to generate and handle smart links. - **Alternate Link Domain**: An additional Branch domain (e.g., yourapp-alternate.app.link) that points to the same link data and behavior. This is recommended for ensuring better deliverability across platforms and channels, and must be included in your platform configuration. We recommend storing these values in Environment Variables so you can: - Manage them per environment (e.g., dev vs prod Branch keys). - Easily assign them to the library’s configuration when adding it to a project. **Adding Library Values** When you add the **Branch Deep Linking Library** to your project (ensure you are on +0.0.7 and above), it will prompt you to provide four values: - `branchApiKey` - `branchLinkDomain` - `branchAlternateLinkDomain` - `isTestMode` Use the environment variables you created to populate these values. :::note `isTestMode` should be set to false when running your app in production. ::: Here’s a quick demo to show how to configure those values inside your library panel.

#### Initialize the Branch SDK Open your `main.dart` file in FlutterFlow Studio and add the `initBranch` custom action under the **Final Actions** section. This ensures the **Branch SDK** is initialized when your app launches.
### Handle Branch Deeplink [Custom Action] To receive and act on deep link data, go to your **Entry Page** or **Logged-In Page** and add the `handleBranchDeeplink` action as the first action in the page flow. This `handleBranchDeeplink` action listens for incoming Branch Deeplinks and handles routing logic. This action should be added to your **Entry Page** or **Logged-In Page** under the **onPageLoad** trigger. It initializes a stream listener that waits for Branch links to be opened (either deferred or direct). Ensure this is the first action of your **on Page Load** action trigger. **`onLinkOpened` Action Callback** When a link is received, the `onLinkOpened` callback is triggered with the [**link data**](#linkdata-action-parameter), allowing you to perform custom navigation or logic. You can perform your navigation logic in this action callback.

#### `linkData` Action Parameter The `handleBranchDeeplink` action receives a `linkData` object that contains all the metadata sent with the link. The `linkData` parameter is a Map containing useful information from the Branch link. In the Dreambrush app example, we get the following link data: ```jsx { "$og_title": "Check out my Ai Image on DreamBrush!", "$publicly_indexable": true, "imageId": "QiC94EaGNoonEKzln07A", "~creation_source": 4, "$og_description": "This image was created with DreamBrush app. You can check it out here.", "+click_timestamp": 1750099254, "$match_duration": 100000, "~feature": "Ai Image Creation", "$tags[0]": "generation", "+match_guaranteed": true, "$alias": "", "$canonical_identifier": "/imageDetails/QiC94EaGNoonEKzln07A", "+clicked_branch_link": true, "~id": "1461141612502859827", "+is_first_session": false, "~campaign": "Image Generation", "~referring_link": "https://dreambrush.app.link/DZ9liDTc6Tb", "~channel": "Share" } ``` :::caution[Link Structure] Your link data might not look *exactly* like the example shown above. However, it will follow a **similar structure** with comparable keys and values. ::: Some of the important keys we should know about: - **`$canonical_identifier`:** The original route path used when the link was generated (e.g., `/imageDetails/:id`). You can explicitly set this value when creating a link through the **[Generate Link](#generate-link-custom-action)** action. If you don’t set it, Branch will infer it based on the link's destination or content metadata. - **`~referring_link`:** The full Branch URL that was clicked. - **`$og_title`:** This is the headline that will appear in the link preview. This is set by the user through the **[Generate Link](#generate-link-custom-action)** action. - **`$og_description`:** This is the description text shown below the title in the link preview. This is set by the user through the **[Generate Link](#generate-link-custom-action)** action. - **`~channel`**, **`~feature`**, **`~campaign`** and **`$tags[0]`** are part of Branch’s user-defined analytics and attribution metadata. These fields are explicitly set by users when creating a link (e.g., via the **[Generate Link](#generate-link-custom-action)** action), and they help organize and analyze your link performance across platforms and campaigns. - **`page`:** This is a suggested custom key that can be set by the user when generating the link. It typically defines the target page or screen the app should navigate to when the link is opened (e.g., "paywall", "productPage", "onboardingStep2"). While not a reserved Branch key, it's a commonly used naming convention for handling deep links and routing logic within the app. - Any other custom parameters added during link creation (e.g., `productId`, `referrer`, etc.). Ensure the key and value are both `String`. This lets you write flexible, conditional navigation logic based on what was shared. For example, in the following example, we can even show a bottom sheet based on the page value.

Use the link data from this callback to: - Navigate to a page. - Show a bottom sheet. - Load content from Firestore using a referenced ID. #### Using Global Context to Navigate In certain app structures, especially when the home page is removed from the navigation stack early, standard navigation using the local context may fail. To ensure deep linking and routing continue to work reliably in these scenarios, you can override the local context with the global navigator context. This approach ensures that navigation logic is not tied to the widget hierarchy at the time of execution, making it more robust and flexible. See a **[detailed example](#dreambrush-example)** using the DreamBrush app. :::danger[Testing Deeplinks] It’s recommended to test deep links on a **physical device**, as link verification (especially for Universal Links or App Links) may not consistently work on emulators or simulators. We recommend using **[Local Run](https://docs.flutterflow.io/testing/local-run)** to run your apps on physical devices. ::: ### Generate Link [Custom Action] The `generateLink` action allows you to create a custom Branch Smart Link directly from your FlutterFlow Studio app. This is especially useful when you want to let users: - Share app content (like a post, product, or image). - Invite others with referral codes. - Trigger deep links that take recipients to specific app screens. The action accepts the following parameters: - **`canonicalIdentifier`** – A unique path for the content (e.g., `/imageDetails/:id`). This becomes the key reference used when routing the user back into the app. - **`title`** – The link's title (used in social previews or analytics). - **`description`** – (Optional) A short description of the content. - **`metadata`** – A dynamic map of custom parameters to include with the link (e.g., page: "imageDetails", imageRef: "abc123", etc.) - **`linkProperties`** – A dynamic map for configuring how the link behaves (e.g., set the `feature`, `channel`, `campaign`, or `stage` for analytics). :::caution[JSON maps] Due to a limitation, if you plan to leave map-type variables (like `metadata` or `linkProperties`) empty, you must still pass them as **empty maps**, not `null`. Ensure all keys and values are **plain strings**, avoid nested JSON or non-string types. Incorrect structure may cause the Link Generation action to fail silently. ::: ### Branch Helper Functions These functions help you safely work with deep link data, extract values, and conditionally navigate based on link metadata. - **`isTargetingPage(linkData, targetPage)`** - Checks whether the page value in the link data matches a specific screen name. The `page` parameter is set by the user when generating the link from Branch dashboard or FlutterFlow Studio. For example, if the target page value in your deep link is "paywall", you can use this function to check for this value and navigate accordingly. - **`getCanonicalIdentifierFromLink(linkData)`**: Helper function that returns the canonical path (e.g., `/imageDetails/abc123`) that was originally attached to the smart link. Useful for extracting the base route or content reference associated with the shared link. - **`getReferringLinkFromLink(linkData)`**: Helper function that retrieves the full Branch smart link URL from the data (typically under the `~referring_link` key). Useful for tracking, analytics, or verifying the source of the link. - **`getLastPathSegmentFromMap(linkData, key)`**: Extracts the last path segment (e.g., `abc123`) from a URI stored inside a link data field (e.g., `/imageDetails/abc123`). This is especially useful when your deep link contains a structured path, like `/imageDetails/abc123` and you want to retrieve just the ID (`abc123`). - **`getLinkValue(linkData, key)`**: Safely retrieves any single value from the link data Map. Returns null if not found. (e.g., retrieving `showPromo` attribute value from the `linkData`). :::caution If you're trying to retrieve default Branch keys like `~channel` or `$canonical_identifier`, make sure to include the special character (e.g., `~` or `$`) as part of the key string. ::: - **`createLinkProperties(...)`**: Returns a Branch Link Properties map used when generating a smart link. You can define values like: feature, campaign, stage, channel, alias or tags or custom fallback URLs. Useful for organizing and tracking generated links for marketing or referrals. ### DreamBrush Example In the DreamBrush app, we can use `generateLink` after a user finishes generating an image. The link could include: - **canonicalIdentifier**: Current Page Route that is `/imageDetails/:imageRef`. - **page**: Target page name `imageDetails`. - **title**: "Check out my AI image!" This link can then be shared via WhatsApp, email, or social media — and when clicked, it brings the recipient directly to that content inside the app. Here's a quick example of generating a Branch link from a page that uses a **Firebase Document ID** as a route parameter.

Now in your `handleBranchDeeplink` action callback, add the additional logic to handle such custom links:

To demonstrate how to use the global context for navigation, add a new **Execute Custom Code** Action just before the **Navigate To** Action, and insert the following code. ```jsx final context = appNavigatorKey.currentContext!; ``` This ensures that the navigation logic uses the global navigator context, which is essential if your app structure removes the home page early in the lifecycle. In such cases, relying on a local context may cause deep linking to fail—using a global context guarantees that navigation still works reliably. :::caution[Paid Plans] Note: The **Execute Custom Code** Action is available only on the [**paid plans**](https://www.flutterflow.io/pricing). :::
### FAQs
Why isn't my deep link working when I navigate to another page from the home page? This often happens because the Home Page gets removed from the navigation stack, especially when **Allow Navigate Back** is disabled in the **Navigate To** Action. Since the deep link handler is typically defined on the Home Page, it gets disposed once the page is removed, causing deep links to stop working when triggered later. ✅ Preferred Solution: **Use Global Context for Navigation** Instead of relying on the Home Page's presence to handle deep links, configure your navigation logic to use the global navigator context. This ensures navigation will work even if the Home Page has been removed from the stack. You can do this by adding an **Execute Custom Code** Action before the **Navigate To** Action. See the **[complete example](#using-global-context-to-navigate)**. ✅ Alternative (but limited) Solution: **Keep the Home Page in Stack** If you're not using global context, you can prevent this issue by keeping the Home Page in memory: Enable "Allow Navigate Back" on any navigation actions from your Home Page, even if the navigation isn't triggered from deep links directly. This keeps the Home Page alive so it can continue listening for deep link events.
Why is my Branch link generation failing? This often happens because one or more of the inputs passed to the action (like `metadata` or `linkProperties` or `customParams` when using `createLinkProperties` helper function) contains invalid JSON formatting. Branch expects these values to be passed as a map of plain `String` key-value pairs, not as nested JSON, objects, or dynamic types. Ensure both **Key and Value's expected type** is `String` and `String` and try again.
Why isn’t deep linking working when testing from a simulator? Deep linking, especially Universal Links and deferred deep linking may not work reliably on iOS or Android simulators/emulators due to platform limitations. Simulator Limitations: - **iOS:** Simulators cannot verify Universal Links properly (no App Store, limited AASA domain support). - **Android:** Some versions fail to auto-verify App Links or handle deferred deep links without Play Services. ✅ Recommended: Always test deep linking on a physical device for accurate behavior.
# FlutterFlow Studio Dynamic Links > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/flutterflow-dynamic-links Learn how to create links that open a specific page in your app and send people without your app to the app store or your web app. FlutterFlow Studio Dynamic Links are short web links, such as `https://your-project-id.fflink.app/Ab3dE7x`, that open a specific page in your app. When someone opens a link on a device that doesn't have your app, the link sends them to the App Store, Google Play, or your web app instead. FlutterFlow Studio Dynamic Links replace Firebase Dynamic Links, which shut down in August 2025. ![A shared link opens the linked app page after sign-in if required. Without the app, users can install it and open the link again, or open the web app.](https://docs.flutterflow.io/assets/images/ff-dynamic-links-intro-63ba17c667c8aeab710646f9636e683c.png) With FlutterFlow Studio Dynamic Links, you can do the following: - Create links in FlutterFlow Studio to share in emails, ads, or social posts. - Let your app create links, so that users can share the page they're on. - Set the title, description, and image that chat and social apps show for a shared link. - Track clicks, app opens, and campaigns for each link. :::note Deep links that use your app's URL scheme, such as `myapp://myapp.com/profile`, keep working when you turn on FlutterFlow Studio Dynamic Links. For more information about deep links, see [**Deep & Dynamic Linking**](https://docs.flutterflow.io/concepts/navigation/deep-dynamic-linking). ::: ## Before you begin Make sure that your project meets the following requirements: - Deep linking is on. It's on by default, so most projects don't show a switch for it. If **App Details** shows an **Enable Deep Linking** switch, turn it on. - The pages that you want links to open have a route. To set a page's route, select the page, and then open **Route Settings** in the properties panel. - Your project has a Dynamic Links add-on unit. For more information, see [Add the Dynamic Links add-on](#add-the-dynamic-links-add-on). You also need the following information for each platform that you enable: - **Android**: the SHA-256 fingerprint of the key that signs your app. For an app on Google Play, use the app signing key from **Play Console > Test and release > App integrity**, not your local upload key. - **iOS and macOS**: your 10-character Apple Team ID, from the **Membership** section of the Apple Developer portal. If your app is on the App Store, also have its App Store ID, a 9- or 10-digit number. - **Web**: the URL of your web app, if you host it somewhere other than your FlutterFlow Studio web publishing address. ## Add the Dynamic Links add-on FlutterFlow Studio Dynamic Links is a paid add-on. Each project that uses it needs one Dynamic Links unit, which costs $10 per month or $96 per year. The team plan pays for units used by team projects, and the project owner's plan pays for units used by personal projects. Only a team owner or the owner of a personal project can buy a unit. You also need a paid team plan or a paid personal plan. If you collaborate on someone else's personal project, ask its owner to change the **Enable FlutterFlow Studio Dynamic Links** switch. You can't see the owner's plan, so the switch is unavailable to you, and a tooltip next to it explains why. To buy a unit, do the following: 1. Go to **Settings and Integrations > Dynamic Links > Setup**. 2. Click **Add-on** next to **Enable FlutterFlow Studio Dynamic Links**, and then follow the prompts. The **Add-on** button appears only when the project's plan has no Dynamic Links unit and the feature is off. While FlutterFlow Studio checks your plan, the switch is unavailable and the page shows **Checking your plan…**. On the desktop app, the button opens your account or team page in a browser, where you complete the purchase. FlutterFlow Studio assigns a unit to your project when you register your app, not when you buy the unit. Registering again after a failed attempt reuses the project's unit instead of taking another one. When you turn off FlutterFlow Studio Dynamic Links in a project that is registered, FlutterFlow Studio asks you to confirm in a **Turn off Dynamic Links?** dialog. If you click **Turn off**, the project releases its unit, and you can use the unit in another project. To create links in the project again, turn the switch back on and register your app again. If a project is already using FlutterFlow Studio Dynamic Links but its plan has no unit for it, the project keeps working. Turning the switch off shows a warning that you need the add-on to turn it on again. A project releases its unit in the following cases: - You turn off FlutterFlow Studio Dynamic Links. - You move the project between a personal account and a team, or to a different team. - The owner of a personal project changes. - The plan that pays for the unit no longer includes it, such as after a downgrade or cancellation. If a project no longer has a unit, the **Setup** and **Links** tabs show a message that names the cause and explains how to get a unit back. The links that you already created keep working, and your app still builds. You can't create new links, either in FlutterFlow Studio or from your app. On the **Links** tab, **Create a link** is unavailable. On the **Setup** tab, the button that sends your settings reads **Register app** instead of **Update**. Click it to register your app again with an available unit. A project's unit belongs to the plan that pays for it, so the unit doesn't move with the project. When you share a project with a team, stop sharing it, switch its team, or transfer ownership of a personal project, and the project uses FlutterFlow Studio Dynamic Links, the confirmation includes a **Dynamic Links** note that the project releases its unit. After the change, register your app again with a unit from the plan that the project now bills to. ## Set up FlutterFlow Studio Dynamic Links To set up FlutterFlow Studio Dynamic Links, do the following: 1. Go to **Settings and Integrations > Dynamic Links > Setup**. You can also click **Set up Dynamic Links** in the **Routing & Deep Linking** section of **Settings and Integrations > General > App Details**. 2. Turn on **Enable FlutterFlow Studio Dynamic Links**. 3. Under **Platforms**, enable each platform where you want links to open your app, and then complete its fields. A link opens in a browser on any platform that you leave off. - **Android**: under **SHA-256 fingerprints**, click **Add fingerprint**, and then enter the fingerprint of the key that signs your app. To let more than one build open your links, such as a test build signed with a different key, add a fingerprint for each key. FlutterFlow Studio saves a new row only after you enter a value, so an empty row doesn't block your builds. To remove a fingerprint, click the **Remove** icon next to it, or clear its field. - **iOS**: in **Apple Team ID**, enter your Team ID. If your app is on the App Store, enter its ID in **App Store ID (optional)**. Without an App Store ID, people who open a link on iOS without your app see your web app or a preview page instead of the App Store. - **macOS**: turn this on to let your Mac app open links. It uses the same Apple Team ID as iOS. This option appears only if your project builds for macOS. Only release builds open links. For more information, see [Build for macOS](#build-for-macos). - **Web**: in **Web app URL**, check the address of your web app. FlutterFlow Studio fills it in from your published web address. Links open here on Windows, Linux, and other devices that can't open your app. The **Package name** and **Bundle ID** come from **App Details**. To change them, edit them there. ![FlutterFlow Studio Dynamic Links setup](https://docs.flutterflow.io/assets/images/ff-dynamic-links-setup-2145226c9a12728b21c5f18c2fb856b6.png) 4. Click **Register app**. FlutterFlow Studio assigns your project's link domain and shows it in **Link domain**. Each project gets its own domain, based on its project ID, such as `your-project-id.fflink.app`. You can't change the domain or use a custom domain. FlutterFlow Studio adds the settings that Android, iOS, and macOS need to open your links in your app, so you don't need to edit any native files. Wait a few minutes before you test your links. On iOS and macOS, reinstall your app first, because the app checks which links it can open only when it's installed. :::note Register your app before you build it, because builds need the link domain. Registering is the only step that you do by hand. After that, FlutterFlow Studio sends changes to your app's link settings automatically a few moments after they save. This includes a new SHA-256 fingerprint, Apple Team ID, App Store ID, web app URL, **Package name**, **Bundle ID**, or platform, and it includes changes that the AI agent makes. If your links don't reflect a change, click **Update** to send it again. FlutterFlow Studio doesn't send settings that are incomplete, such as iOS turned on without a Team ID, until you fill in the missing fields. ::: :::tip If Android opens your links in the browser instead of your app, check the SHA-256 fingerprint first. A fingerprint from the upload key instead of the Play App Signing key is the most common cause. ::: ### Build for macOS On macOS, only release builds open links in your Mac app. FlutterFlow Studio signs release builds with the Apple Team ID that you entered, so build them on a Mac that is signed in to that team, such as in Xcode. Debug builds, including Local Run, sign locally and open links in the browser. They build on any Mac. If you turn on **macOS** without a valid 10-character Apple Team ID, your Mac app doesn't claim your link domain, so links don't open it. ### Use custom Runner.entitlements code on iOS If your custom code for `Runner.entitlements` already declares `com.apple.developer.associated-domains`, such as for a domain from another link service, FlutterFlow Studio adds your link domain to your list. Your entries stay as they are, and your link domain is added once. If your code sets that key to something other than an `` of `` entries, FlutterFlow Studio can't add the link domain, and your app would open links in the browser. In that case, the project shows an error that tells you to change the value to an array. If FlutterFlow Studio can't read your code, the project shows a warning instead. For more information about custom entitlements, see [Configuration Files](https://docs.flutterflow.io/concepts/custom-code/configuration-files#entitlementsplist-ios). ### Deploy to the App Store When iOS is on, your app signs the Associated Domains capability. If you deploy your app with the one-click App Store deployment, FlutterFlow Studio turns on Associated Domains for your App ID before it creates the signing files, so you don't need to turn it on in the Apple Developer portal. If FlutterFlow Studio can't turn it on, the build log says so. In that case, turn on **Associated Domains** for your App ID under **Certificates, Identifiers & Profiles** in the portal. For more information about deploying, see [Apple App Store Deployment](https://docs.flutterflow.io/deployment/apple-app-store-deployment). ## Open the right page in your app When someone opens a link and your app is installed, the app opens on the page that the link points to, with the link's page parameters. This works whether the app is already running or starts because of the link. If the linked page requires authentication, users must sign in before viewing it. To run more actions after the page opens, such as logging which campaign brought the user in, select an Action Block in **When a link opens the app** on the **Setup** tab. The Action Block can take any of the following parameters. FlutterFlow Studio matches them by name. | Parameter | Type | Value | | --- | --- | --- | | `routePath` | String | The route of the page that the link opened. | | `routeParameters` | JSON | The page parameters that the link carried. | | `campaignSource` | String | The link's campaign source. | | `campaignMedium` | String | The link's campaign medium. | | `campaignName` | String | The link's campaign name. | | `campaignTerm` | String | The link's campaign term. | | `campaignContent` | String | The link's campaign content. | An Action Block parameter with any other name causes a build error. The Action Block doesn't run in web apps. On the web, a link opens its page in your web app directly. ## Create links You can create links in FlutterFlow Studio or let your app create them while it runs. Register your app on the **Setup** tab before you create links. ### Create a link in FlutterFlow Studio Create a link in FlutterFlow Studio when you want to share the same link with many people, such as in a newsletter or an ad. 1. Go to **Settings and Integrations > Dynamic Links > Links**. 2. Click **Create a link**. 3. In **Name**, enter a name that helps you find the link later. People who open the link don't see the name. 4. In **Destination**, choose the page that the link opens. Only pages with a route appear. 5. Under **Parameters**, set the values of the page's parameters. 6. Optional: under **Preview when shared**, enter the title and description that chat and social apps show for the link. 7. Optional: under **Campaign tracking (optional)**, enter **Source**, **Medium**, **Campaign**, **Term**, and **Content** values to identify traffic from this link in the **Analytics** tab. 8. Click **Create link**. ![Create a dynamic link](https://docs.flutterflow.io/assets/images/ff-dynamic-links-create-link-52e90fd8c6187e8a8674cc240771fb56.png) To copy a link, click the **Copy link** icon next to it in the list. ### Create links from your app To let users share links, add the [Generate Current Page Link](https://docs.flutterflow.io/concepts/navigation/generate-current-page-link) action to your app. ## What happens when someone opens a link | Where the link opens | With your app installed | Without your app | | --- | --- | --- | | iOS | Your app opens on the link's page. In a browser that doesn't hand the link to your app, such as the in-app browser in Instagram, Facebook, TikTok, or LinkedIn, or Safari after someone pastes the link, people see the page described after this table. | A page with **Open in app** and **Get the app** buttons. **Get the app** leads to the App Store. With **Skip Preview Page** on, the link goes straight to the App Store. Without an App Store ID, the link opens your web app, or shows a page with **Open in app** if you don't have a web app. | | Android | Your app opens on the link's page. | An **Open the app** page that leads to Google Play. | | macOS | Your Mac app opens on the link's page, if you turned on **macOS** and the app is a release build. Debug builds open the link in the browser. | Your web app opens on the link's page. | | Windows, Linux, and other devices | Not applicable. | Your web app opens on the link's page, with the link's campaign values as `utm_` parameters. Without a web app URL, a preview page appears. | When someone shares a link in a chat or social app, that app shows the link's preview title, description, and image. ### Open links on iOS from in-app browsers On iOS, an installed app opens a link only when iOS handles the tap itself. Some in-app browsers load the link in their own web view instead, and Safari doesn't open the app for a link that someone types or pastes. In these cases, people who have your app still see a page, so the page offers both choices instead of sending everyone to the App Store: - **Open in app** opens your app on the link's page. - **Get the app** opens your app's page in the App Store. The page shows the link's preview image, title, and description. It doesn't redirect on its own, so people have to tap a button. If someone taps **Open in app** on a device without your app, Safari shows an error that it can't open the page. To skip this page and send iPhone visitors straight to the App Store, turn on **Skip Preview Page**. Leave it off if people open your links inside social apps, because the App Store listing can't open your app on the linked page. The **Open in app** button appears after you click **Update** on the **Setup** tab. Apps that you already published don't need a rebuild. Until you click **Update**, the page shows only **Get the app**. Because the app can't tell that someone tapped **Open in app**, those visits count as fallbacks in the **Analytics** tab, not as opens. ## Manage links On the **Links** tab, each link shows its destination and how many times people clicked it and opened your app from it. For each link, you can do the following: - To change a link's name, destination, preview, or campaign, click the **Edit link** icon. - To copy a link, click the **Copy link** icon. - To stop a link from working, click the **Deactivate** icon, and then confirm in the **Deactivate this link?** dialog. - To turn a deactivated link back on, click the **Reactivate** icon. The link works again with the same short code. :::caution After you deactivate a link, it stops working everywhere that you shared it, including printed QR codes, emails, and posts. Anyone who opens it sees a **Link not found** page until you reactivate it. ::: Reactivating a link doesn't need a Dynamic Links unit, because it doesn't create a new link. ## View analytics The **Settings and Integrations > Dynamic Links > Analytics** tab shows the following for your project's links: - **Clicks**: how many times people opened your links in the last 30 days. - **Opens**: how many times your app reported opening from a link. - **Fallbacks** and **Fallback rate**: the number and percentage of visitors who went to an app store page or a preview page because your app didn't open. - A daily chart for the last 30 days, in UTC, and breakdowns by platform and by link. Previews that chat and social apps load when someone shares a link don't count as clicks. ![Dynamic Links analytics](https://docs.flutterflow.io/assets/images/ff-dynamic-links-analytics-cdaaef043e31e956050d54cb302f2074.png) :::tip If fallbacks rise on one platform, links on that platform have probably stopped opening your app. Check that platform's settings on the **Setup** tab, such as the Android SHA-256 fingerprint. ::: ## Move from Firebase Dynamic Links Firebase Dynamic Links has been retired, and FlutterFlow Studio no longer generates Firebase Dynamic Links code for your app. If your project saved the Firebase setting earlier, **Settings and Integrations > General > App Details** still shows it as **Firebase Dynamic Links (retired)**, and the **Dynamic Links** tab in **App Settings** explains that the setting no longer enables the service. The setting doesn't stop you from configuring FlutterFlow Studio Dynamic Links. To move a project from Firebase Dynamic Links, do the following: 1. In **App Details**, turn off **Firebase Dynamic Links (retired)**. The switch is available only to turn the setting off. 2. Follow the steps in [Set up FlutterFlow Studio Dynamic Links](#set-up-flutterflow-studio-dynamic-links). Until you configure FlutterFlow Studio Dynamic Links, existing [**Generate Current Page Link**](https://docs.flutterflow.io/concepts/navigation/generate-current-page-link) actions that have **Generate Short Link** off return ordinary app deep links, and actions that have it on show a project error. After you configure FlutterFlow Studio Dynamic Links, the actions create FlutterFlow Studio Dynamic Links. Links that Firebase created don't move to FlutterFlow Studio Dynamic Links, so create new links to replace any that you shared. Custom code that imports the Firebase Dynamic Links package no longer builds, because the package is removed from generated apps. Update that code to use another link solution. ## Limits FlutterFlow Studio Dynamic Links have the following limits for each project: - Your app can create up to 60 links per minute and 1,000 links per day, and up to 10 links per minute from any one IP address. Links that you create on the **Links** tab don't count toward these limits. - Your links can receive up to about 600 clicks per minute. - Links don't expire. To stop a link from working, deactivate it. # Generate Current Page Link > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/generate-current-page-link Learn how to generate the current page link in your FlutterFlow Studio app. The action creates a link to the page that the user is on, with the page's current parameter values. It returns the link in the action output **Current Page Link**, which you can pass to the [Share](https://docs.flutterflow.io/concepts/navigation/share-action) action.
Sharing and opening a dynamic link
:::note[Prerequisites] To create short links with link previews and store redirects, first perform all the steps to [**set up FlutterFlow Studio Dynamic Links**](https://docs.flutterflow.io/concepts/navigation/flutterflow-dynamic-links#set-up-flutterflow-studio-dynamic-links). Without FlutterFlow Studio Dynamic Links, the action can return only an [**ordinary app deep link**](#use-the-action-without-flutterflow-studio-dynamic-links). ::: ## Adding Generate Current Page Link action Go to your project page on FlutterFlow Studio and follow the steps below to define the Action to any widget. 1. Select the **Widget** (e.g. share button) on which you want to define the action. 2. Select **Actions** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu), and click **Open**. This will open an **Action flow Editor** in a new popup window. 1. Click on the **+ Add Action**. 2. On the right side, search and select the **Generate Current Page Link** action and click **Close**. The action has the following options: - **Link Preview Properties**: the **Title**, **Preview Image**, and **Description** that chat and social apps show for the link, and a **Name** that labels the link on the **Links** tab. - **Skip Preview Page**: under **iOS Settings**, sends people who open the link in a browser on iOS straight to the App Store, without the preview page first. Leave it off so that people who open the link in apps such as Instagram or Facebook can still tap **Open in app**. For more information, see [FlutterFlow Studio Dynamic Links](https://docs.flutterflow.io/concepts/navigation/flutterflow-dynamic-links#open-links-on-ios-from-in-app-browsers). - **Campaign (optional)**: the **Source**, **Medium**, **Campaign Name**, **Term**, and **Content** values that the **Analytics** tab groups traffic by. You can set each one from a variable. FlutterFlow Studio Dynamic Links are always short, so the action doesn't show the **Generate Short Link** option. ![ff-dynamic-links-action.png](https://docs.flutterflow.io/assets/images/ff-dynamic-links-action-d6343227625d670ae066347a8c3a0ebd.png) ## Use the action without FlutterFlow Studio Dynamic Links Firebase Dynamic Links has been retired, and a saved **Use Firebase Dynamic Links** setting no longer turns the service on. If FlutterFlow Studio Dynamic Links isn't configured for your project, the action shows a **Generate Short Link** switch and a warning in the action's properties. - **Generate Short Link** off: the action returns an ordinary app deep link. The link is built from your app's URL scheme and host, and keeps the page's route, query parameters, and fragment. It has no link previews and no store redirects. The project shows a warning that explains this, but the app builds. - **Generate Short Link** on: the action can't generate a link. The project shows an error until you either turn the switch off or configure FlutterFlow Studio Dynamic Links in **App Settings > Dynamic Links**. If you configure FlutterFlow Studio Dynamic Links later, the action creates short links and the **Generate Short Link** switch no longer appears. To move a project over, see [Move from Firebase Dynamic Links](https://docs.flutterflow.io/concepts/navigation/flutterflow-dynamic-links#move-from-firebase-dynamic-links). # WebView > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/webview Learn how to use the WebView widget in FlutterFlow Studio to display website content directly within your app. The WebView widget lets you display the website content right inside your app. It's useful in a case where you don't want your users to leave your app to view the web page. ## Adding WebView widget To add the WebView widget to your app: 1. Add the **WebView** widget from the **Base Elements** tab. 2. Head over to Properties Panel, adjust the **Width** and **Height**, and then enter the Webview URL.(e.g., https://flutterflow.io/,https://en.wikipedia.org/wiki/Main_Page). 3. Certain web pages may have restrictions that prevent them from being viewed within the WebView, such as popular websites like [Unsplash](https://unsplash.com/) or [Facebook](https://www.facebook.com/). However, you can override these restrictions by enabling the **Bypass Domain Restrictions** option. 4. You can also **Force Allow Vertical** and **Horizontal Scrolling** if needed.
## Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. ### Load content from HTML Sometimes, you might choose to construct your own HTML with the desired styling and structure and then load that HTML into a WebView. For example, display a privacy policy page with a slight variation using modified HTML content (which might be different than the one hosted on your site). To do so, enable the **Load content from HTML** and then enter your **Webview HTML Content**.
# Bottom Sheet > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/bottom-sheet A Bottom Sheet is an alternative to a menu or a dialog. It opens from bottom to top and can be dismissed by swiping it from top to bottom. When it opens, it prevents the user from interacting with the rest of the app. A Bottom Sheet is an alternative to a menu or a dialog. It opens from bottom to top and can be dismissed by swiping it from top to bottom. When it opens, it prevents the user from interacting with the rest of the app. You can use the bottom sheet when you want to perform a small action without creating a separate screen.

## Types of Bottom Sheet action Below are the types of Bottom Sheet actions: 1. **Show**: This opens the bottom sheet. 2. **Dismiss**: This closes the bottom sheet. ## Opening Bottom Sheet Follow the steps below to add an action that opens the bottom sheet: 1. First, create a bottom sheet [component](https://docs.flutterflow.io/resources/ui/components). :::tip You can also create one from the 'BottomSheet' [**templates**](https://docs.flutterflow.io/resources/ui/components/creating-components#creating-component-from-template). :::

2. Select the **Widget** (e.g., Button) from where you want to open the bottom sheet. 3. Select **Actions** from the Properties panel (the right menu), and click **+ Add Action**. 4. Search and select the **Bottom Sheet** (under *Widget/UI Interactions*) action. 5. To open the bottom sheet, select **Show**. 6. **Select Component** as the component you created for the bottom sheet. 7. (Optional) set the **Height** value. You should set the height if you want the bottom sheet to appear only up to some portion of the screen. 8. You can set the **Background** and **Barrier Color** for the bottom sheet. ![Set Background and Barrier color](https://docs.flutterflow.io/assets/images/bottom-sheet-background-color-98450a3773ec892d19d8483d7c20002b.png) 9. You can also [pass parameters](https://docs.flutterflow.io/resources/ui/components/creating-components#creating-a-component-parameter) to a bottom sheet component. 10. By default, this type of action blocks the following action (if any) from triggering while this action is in progress. (i.e., meaning the bottom sheet is present on the screen). However, in some cases, you might want to allow the next action (after this) to execute, for example, making an API call immediately after showing the bottom sheet. To do so, enable **Non Blocking** option. 11. By default, **Non Dismissble** option closes the bottom sheet when you click outside of it. To disable this behavior, enable this option. 12. With **Enable Drag** option, you can open and close the bottom sheet using a swipe gesture. 13. Optional: If you are returning any value from the bottom sheet, provide the **Action Output Variable Name**. The result will be stored in this variable.

## Closing Bottom Sheet Follow the steps below to add an action that closes the bottom sheet: 1. Select the **Widget** (e.g., Button, ListTile, Container) on which you want to add the action. 2. Select **Actions** from the Properties panel (the right menu), and click **+ Add Action**. 3. Search and select the **Bottom Sheet** (under *Widget/UI Interactions*) action. 4. To close the bottom sheet, select **Dismiss**. 5. If you want to return a value from the current bottom sheet, enable the **Has Value** toggle and pass the value by setting its *Data Type* and *Value Source*. 1. If you enable the *Has Value* option, you must come back to the action that opens this bottom sheet and provide the **Action Output Variable Name**. This will be used to retrieve the value from the bottom sheet. 2. Now you can use the *Action Output Variable Name* to get the data. Here is an example of returning the selected user name back to the page.

# Share [Action] > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/share-action Learn how to use the Share Action in your FlutterFlow Studio app to share content. The **Share Action** enables users to send text or URLs from your app using the native sharing capabilities of their device. This functionality allows users to share information through various applications installed on their devices, such as email, messaging apps, or social media platforms. :::caution It's important to note that the Share Action is designed for mobile platforms and is not supported in FlutterFlow Studio's Run Mode or Preview Mode. To test this functionality, you need to [**run your app on an iOS or Android device or emulator**](https://docs.flutterflow.io/testing/local-run). ::: ![share-action](https://docs.flutterflow.io/assets/images/share-action-b45517e6222a39ef2d068a4d3c2744cc.avif) # Launch URL [Action] > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/navigation/launch-url Learn how to use the Launch URL Action in FlutterFlow Studio to open URLs with supporting apps. The Launch URL Action lets you specify a URL that will be opened using an app supporting it. If there is more than one app that can handle the specified URL, the user will be presented with a dialog from where one of the apps can be selected. ## Adding Launch URL Action Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on the **+ Add Action**. 4. On the right side, search and select the **Launch URL** (under widget/UI Interactions) action. 5. In the *URL Value Type* property, select either **Specify URL** (to add the URL as a String) or **From Variable** (to use the value stored in a String variable). 6. If using **Specify URL**, enter the URL that you want to use in the **URL** field. For example, you can enter "[https://flutter.dev](https://flutter.dev/)" to open the Flutter webpage. 7. If using **From Variable**, select the **Source** from which to fetch the URL value. You can also specify a **Default Value** that will be used when the variable value is not set (i.e. null). ![launch-url.avif](https://docs.flutterflow.io/assets/images/launch-url-d7c613a47c466132a877ded81754a642.avif) --- ## URL schemes A URL scheme is a way to define how different types of links, such as webpages, phone numbers, SMS messages, and emails, should be handled by an app or browser. The following are some common URL schemes that can be handled by an external app present on the user's device. ### Open a webpage This URL scheme for loading up a webpage can be defined in this format: #### Scheme `http:` `https:` #### Example `https://flutter.dev` ![webpage.gif](https://docs.flutterflow.io/assets/images/webpage-e77c8217ba0e3808009841e02573d1ea.gif) ### Use a phone number This URL scheme helps to handle phone numbers inside your app. Using this, you can easily initiate a phone call to the provided phone number from the user's device. #### Scheme `tel:` #### Example `tel:2125551212` ![phone.gif](https://docs.flutterflow.io/assets/images/phone-0d973c2de6a23a5c6f6797c80608194d.gif) ### Compose a text message This URL scheme lets you redirect users from your app to compose and send an SMS message to a specified phone number. #### Scheme `sms:` #### Example `sms:2125551212` ![text-message.gif](https://docs.flutterflow.io/assets/images/text-message-da7b8687d93f06c971fecff069d70cbd.gif) ### Create an email This URL scheme helps you to launch an email app on the user's device. It allows you to pass the *email to*, *subject*, and *body* to the app so that you have these fields prefilled with details as the email app is opened. #### Scheme `mailto:?subject=&body=` #### Example `mailto:name@example.org?subject=Welcome%20to%20FlutterFlow&body=Hey%20there` This will pass the following details to the email app: ***mailto:*** name@example.org, ***subject:*** Welcome to FlutterFlow Studio, ***body:*** Hey there ![ceate-email.gif](https://docs.flutterflow.io/assets/images/ceate-email-3b1a5a099752899687f96c37882c340d.gif) # File Handling > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/file-handling Learn how to handle media files in FlutterFlow Studio. FlutterFlow Studio makes it easy to manage, upload, download, and display files within your app. It supports a variety of file types, including images, videos, and documents, and integrates seamlessly with popular storage solutions. Using built-in widgets and actions, you can effectively manage your app's media. This guide covers the following key aspects of file handling in FlutterFlow Studio. - **Media Assets**: Upload any assets you want to use in your app from the Navigation Menu > Media Assets. This also shows the media assets of the Team. - [**Uploading Files**](https://docs.flutterflow.io/concepts/file-handling/uploading-files): Upload and save different file types, including images, audio, videos, and PDFs to cloud storage. - [**Displaying Media**](https://docs.flutterflow.io/concepts/file-handling/displaying-media): Fetch files from cloud storage or external URLs and display them in your app. - [**Download Files**](https://docs.flutterflow.io/concepts/file-handling/download-file): Allow users to download files directly to their devices. - [**Clear or Delete Media**](https://docs.flutterflow.io/concepts/file-handling/clear-delete-media): Allow users to delete uploaded files from their devices and cloud storage. :::note[Also see] - **Stream Media with Mux**: [**Integrate Mux's broadcasting**](https://docs.flutterflow.io/integrations/mux) services in FlutterFlow Studio by using the MuxBroadcast widget for live streaming. - **Request Permissions**: [**Request user permissions**](https://docs.flutterflow.io/resources/projects/settings/project-setup#request-permission-action) when implementing custom widgets or actions that access personal information, such as capturing photos or selecting images, especially if no built-in permission mechanism is available. ::: # Uploading Files > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/file-handling/uploading-files Learn how to upload media in FlutterFlow Studio. Uploading files is an essential feature for many apps, enabling users to share images, videos, documents, and more. FlutterFlow Studio offers flexible actions to handle file uploads, whether you’re using Firebase, Supabase, or your own backend server. You can customize the upload process to suit your app’s needs, such as resizing media, setting quality, or temporarily storing files locally before uploading. This guide covers the available upload methods, configuration options, and workflows, including how to save media locally and upload it via an API. ## Types of Media Uploads FlutterFlow Studio provides three methods for uploading media files, each catering to different needs: ### Firebase Media files can be uploaded directly to **Firebase Storage**, a reliable cloud-based solution. Once the upload is complete, you can use the **Widget State > Uploaded File URL** to preview the media or store the file URL for later use. ![upload-type-firebase.avif](https://docs.flutterflow.io/assets/images/upload-type-firebase-456f096ed9a757798c5a1213e90035b5.avif) ### Supabase You can upload media to a **Supabase bucket** at a specified location. After the upload, the file's URL is accessible via **Widget State > Uploaded File URL**, enabling you to preview the media or save the URL for later use in your app. ![upload-type-supabase.avif](https://docs.flutterflow.io/assets/images/upload-type-supabase-dd59212b4c2981e164125df7f5353a1e.avif) ### Local Upload (Widget State) This method initially stores your media on the device, making it accessible via **Widget State > Uploaded Local File**. You can preview, edit, or process the file before uploading it to a cloud storage. ![upload-type-local-and-api.avif](https://docs.flutterflow.io/assets/images/upload-type-local-and-api-141c3fa9b729007f50dfb7a245a6b140.avif) ## Upload or Save Media [Action] This action allows you to upload a photo or video to your app. You can choose to store the file on [Firebase](#firebase), [Supabase](#supabase) storage, or your own server using an API. Once uploaded, you can access the file through its generated URL. This URL can be used to display the content immediately or store it in a database for future retrieval. :::note[Prerequisites for Firebase] 1. **Firebase** should be connected to your project. Follow the instructions on [**this page**](https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started) for integrating Firebase with FlutterFlow Studio. 2. **Firebase Authentication** must be properly configured. Check out [**this page**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) for setting up authentication. 3. **Firebase Storage** must be set up and properly configured. It takes just a second! Follow the instructions on [**this page**](https://docs.flutterflow.io/integrations/firebase-storage/storage-rules). 4. At least one **Firebase Collection** should be configured for the project so that you can store the generated URL. ::: :::note[Prerequisites for Supabase] 1. Make sure to [**integrate Supabase**](https://docs.flutterflow.io/integrations/supabase/setup) into your app. 2. [**Create a storage bucket**](https://supabase.com/docs/guides/storage/quickstart#create-a-bucket) in Supabase. By default, the **Public bucket** option is disabled, meaning uploaded media is not accessible by anyone without authentication. If needed, you can enable the Public bucket option, but this is not recommended for sensitive content.

![supabase-storage-bucket.png](https://docs.flutterflow.io/assets/images/supabase-storage-bucket-7c69ea6354974d2fa3a080cf97b48106.png)

3. Apply additional [**security rules**](https://supabase.com/docs/guides/storage/quickstart#add-security-rules) which determine who can access the bucket. **Tip**: If you are uploading to a folder structure like this '*pics/uploads*,' here is how you can add a policy that allows only authenticated users to upload their profile picture.
::: To create an upload media workflow, add the **Upload/Save Media** action to the widget (e.g., a button or any interactive element) where you want users to initiate the file upload. Next, set the [**Upload Type**](#types-of-media-uploads). In the **Media Type/Source** section, specify the type of media to upload: photo, video, or both. Then, use the **Media Source** dropdown to choose the source of the media: - **Camera**: Directly capture media using the device's camera. - **Gallery**: Select existing media from the device's gallery. - **Either Camera or Gallery**: Allows users to choose the source via a bottom sheet, letting them select either the camera or the gallery as the media source. Once the media is uploaded, see how to display it on a widget in the [next section](https://docs.flutterflow.io/concepts/file-handling/displaying-media). :::note When you set **Upload Type** to: - **Firebase**: You must [**deploy the storage rules**](https://docs.flutterflow.io/integrations/firebase-storage/storage-rules). - **Supabase**: Provide the **Bucket Name** and set the **Uploaded Folder Path** (e.g., pics/uploaded). This is the path where the media will be uploaded. :::

The Upload Media action offers various settings to control how media files are uploaded, resized, and processed in your app. Below is a breakdown of all the available properties. ![Upload/Save Media action settings showing Resize, Image Quality, Include Media Dimensions, Include Blur Hash, Source Picker Style, Allow Multiple Images, and Show Snack bar.](https://docs.flutterflow.io/assets/images/configure-upload-media-action-light-a4ece0405654385307e7c385e51c2e90.png) - **Resize** (**Max Width** and **Max Height**): If you are uploading a photo, you can set a maximum width and height using these properties. This resizes the image while maintaining its original aspect ratio. - **Image Quality**: Control the image quality by adjusting the slider or entering a value between 0 and 100, where 100 retains the original quality. - **Include Media Dimensions**: Enable this option to retrieve the dimensions (width and height) of the uploaded media. Keep in mind that this operation is resource-intensive, so enable it only if necessary. - **Include Blur Hash**: Automatically generates a BlurHash for the uploaded image, allowing you to display a blurred placeholder while the full image loads. For more information, refer to the [BlurHash](https://docs.flutterflow.io/concepts/file-handling/displaying-media#blurhash) section. - **Source Picker Style**: Customize the appearance of the bottom sheet UI that appears when selecting a media source (e.g., Camera or Gallery). - **Allow Multiple Images**: Enable this option to allow users to select multiple images. Note that this requires the **Media Source** to be set to **Gallery**. Once multiple images are uploaded, you can access their URLs via **Set from Variable menu > Widget State > Uploaded File URLs (`List`)**. - **Show Snackbar**: Enable this option to notify users about the upload progress with a snackbar message. Check out our YouTube video for a detailed explanation of the **Upload or Save Media [Action]** in FlutterFlow Studio.

### Store Media for Upload You can also save the media file temporarily on the device before uploading it to cloud storage by setting the **Upload Type** to [**Local Upload**](#local-upload-widget-state). This saves the file in Bytes, allowing you to preview, edit, or process it before finalizing the upload. Once the file is uploaded to the device, you can do the following: - **Preview or Validate the Media**: Show the user an in-app preview before they decide whether to finalize or discard the upload. - **Editing Before Submission**: In social media apps, users upload photos for posts or stories. The app temporarily saves the image on the device while users edit or apply filters, and then uploads the final image to cloud storage. - **Perform Data Operations**: In document scanning apps, users capture images of documents, which are temporarily stored on the device. The app accesses the file bytes to apply OCR (Optical Character Recognition), enhance contrast, or convert the image to PDF before uploading the final processed file to cloud storage. - **Offline Functionality**: Store the media locally and defer uploading until the user regains internet access. - **Upload to Server**: When you want to store the file externally, you can then make an API call (e.g., multipart form data) to transfer the local file. Be sure to retrieve and save the resulting file URL in your database if you plan to display it later. Here are some examples of uploading a file to a device and using it in different scenarios: **Example 1: Upload to Your Backend Server via API** First, set the **Upload/Save Media** action with the **Local Upload (Widget State)** upload type. Then, add the next action as an **API call** and select the API that will upload the file to your server. After the API call is complete, ensure your server returns the uploaded file's URL. Use this URL to save in the database or [display the uploaded image](https://docs.flutterflow.io/concepts/file-handling/displaying-media). :::note The request body for the API must be in *Multipart* format. See how to [**configure an API for the multipart request body**](https://docs.flutterflow.io/resources/backend-logic/rest-api#multipart-format). :::

**Example 2: Compress Image Using Custom Action** First, configure the **Upload/Save Media** action with the **Local Upload (Widget State)** upload type. This temporarily saves the media file on the device. Next, create and add a [**Custom Action**](https://docs.flutterflow.io/concepts/custom-code/custom-actions) (e.g., `compressImage`) that takes the locally stored file as input and compresses it using its **bytes** data. Ensure the custom action processes the image and returns a compressed file. Once compressed, the file can then be uploaded to cloud storage using an **Upload/Save File** action. ![Custom action compressImage code editor with an imageToCompress argument of type UploadedFile.](https://docs.flutterflow.io/assets/images/compress-image-light-c773df7840e382cfe43187ac9ba0cb9f.png) **Example 3: Upload to Firebase or Supabase** First, configure the **Upload/Save Media** action with the **Local Upload (Widget State)** upload type. Once the file is modified or processed, add an **Upload/Save File** action to the widget that confirms the final upload, such as a **Save** button. A widget can't have more than one upload action, so use a different widget from the one that picks the file. Set the **Upload Type** to **Firebase** or **Supabase**, choose **File Type** as the **Uploaded File**, and select **File to Upload** from **Widget State > Uploaded Local File**. ![Upload/Save File action set to Firebase with File Type Uploaded File and File to Upload set to Uploaded Local File.](https://docs.flutterflow.io/assets/images/local-upload-to-firebase-supabase-light-8b51a25a3d7fb056d5c8df1264eed605.png) ## Upload or Save File [Action] You can upload any type of file to your app, such as PDFs, MP3s, and more. The process for uploading files is almost similar to the [Upload or Save Media Action](#upload-or-save-media-action). :::note[Web access for PDF files] If you plan to support the web version of your app or test the PDF upload feature in **Run Mode**, you’ll need to complete additional configuration steps required for certain file types (e.g., PDFs). Learn how to [**enable web access**](https://docs.flutterflow.io/concepts/file-handling/displaying-media#web-access-for-pdfs-and-other-files). ::: # Displaying Media > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/file-handling/displaying-media Learn how to display media in FlutterFlow Studio. Displaying media efficiently is crucial for enhancing user experience in your FlutterFlow Studio app. Whether you're working with images, audio, video, or PDFs, FlutterFlow Studio provides flexible options for integrating and managing media. This guide covers how to set media sources, customize playback settings, and implement best practices like lazy loading, caching, and BlurHash to optimize performance. ## Media Types To display media on widgets, navigate to the **Properties Panel** and specify the media source under the **[Media] Type** option (e.g., ImageType, AudioType, VideoType). Here are the available options: ### Network Enter the URL of the media directly into the **Path** input field. This is for media hosted online. ![Image widget properties with the Path field set to a network URL and the profile image shown on the canvas.](https://docs.flutterflow.io/assets/images/dm-network-path-light-9a83e8a498f5e675deae8536e86d2bac.png) If your media is uploaded to Firebase or Supabase, click **Set from Variable** on the **Path** input field, and select **Source** as **Widget State > Uploaded File URL**. ![Set from Variable menu for an Image Path with Widget State > Uploaded File URL selected.](https://docs.flutterflow.io/assets/images/dm-uploaded-file-light-5c63e8dc76dd7ca9d67024f2b4c785e7.png) For media uploaded via an API, select the API call's action output variable as the source. Set **API Response Options** to **JSON Body**, set **Available Options** to **JSON Path**, and enter the path to the file URL. Ensure that the API response contains the URL of the uploaded file. Learn how to extract the URL using [JSON path](https://docs.flutterflow.io/resources/backend-logic/rest-api#json-path). ![Set from Variable dialog binding an Image Path to the userResult action output with the JSON Path $.image.](https://docs.flutterflow.io/assets/images/dm-api-light-0f1a48dd07bd6a44ccb8ccd06ee37909.png) :::note To handle scenarios where media takes time to load or fails to load, you can set a placeholder. Click **Set from Variable** on the **Path** field and specify a placeholder URL under the **Default Value** property. ::: ### Asset You can also display media files uploaded to your **Assets**. Assets are resources such as images, videos, documents, fonts, and other files that you include locally in your project. To upload assets, click on **Media Assets** in the left-side navigation menu and add files directly from your device. Alternatively, you can directly upload and display files when configuring media widgets by clicking the upload icon. :::tip For more details on how assets are stored in your project, see the directory [**Assets**](https://docs.flutterflow.io/generated-code/project-structure#assets) in the generated code. ::: ![Asset Image picker listing uploaded project assets, with the upload icon outlined.](https://docs.flutterflow.io/assets/images/select-from-assets-light-a1d5b91f6e72d0d9cb07d53ff0e5a152.png) ### Uploaded File You can also access media files within your app that are stored temporarily in your application. For example, if you'd like to preview an image before sending it to cloud storage, you can do so by setting the source to **Widget State -> Uploaded Local File**. ![Set from Variable menu for an Image Path with Widget State > Uploaded Local File selected.](https://docs.flutterflow.io/assets/images/dm-local-upload-light-539c0a2005847226a3b4800f59117b55.png) ## AudioPlayer The **AudioPlayer** widget allows you to integrate audio playback into your apps. You can play audio from both uploaded assets and external URLs. Refer to the [**Displaying Media**](#media-types) section for more details on accessing media. :::tip[Generated Code] The AudioPlayer widget in FlutterFlow Studio uses the [**assets_audio_player**](https://pub.dev/packages/assets_audio_player) package for audio playback. ::: **Customization Options** - **Title:** Specify the audio title in the **Title** property. You can set this directly or bind it to a variable, such as an app state variable, API response, or Firestore document. - **Pause on Forward Navigation:** By default, the audio stops when navigating to another page. - **Play in Background:** Define how the audio behaves when the app moves to the background: - **Enabled:** The audio continues to play. - **Disabled, restore on foreground:** The audio pauses and resumes when the app becomes active again. - **Disabled, pause:** The audio stops immediately when the app goes into the background. - **Colors:** - **Background Color:** Customize the background using the **Fill Color** property. - **Playback Button Color:** Adjust the colors of the play and pause buttons. - **Active/Inactive Track Color:** Change the progress bar color that indicates the current playback position. - **Elevation:** Use the **Elevation** property to modify the shadow beneath the audio tile. A higher value increases the shadow size, while setting it to 0 removes the shadow. - **Text Styling:** - **Title Text:** Personalize the title’s font, size, and color in the **Title Text Style** section. - **Playback Duration Text:** Adjust the style of the playback duration text in the **Playback Duration Text Style** section. ## Audio Recording You can implement audio recording functionality using the **Start Audio Recording** and **Stop Audio Recording** actions. :::caution Currently, audio recording is not supported in **Run** or **Test** modes due to certain limitations. ::: ### Start Audio Recording [Action] This action starts the recording. It also provides a name to the recording, which you can use later to stop the recording using the [Stop Audio Recording](#stop-audio-recording-action) *action.* Before adding this action, ensure you [request microphone permission](https://docs.flutterflow.io/resources/projects/settings/project-setup#request-permission-action). Within the **TRUE** block of the permission condition check, add the **Start Audio Recording** action. By default, the **Name** field value is a randomly generated string. You can change it to a more descriptive name for easier identification. :::tip After starting recording, you might want to update the state variables to reflect changes on the UI. For instance, you can enable/disable buttons or start recording animations to provide a visual cue of the ongoing process. This step allows you to enhance the user experience and provide real-time feedback during the recording. ::: ![Action Flow Editor with Request Permissions, a Microphone conditional, and Start Audio Recording in the TRUE branch.](https://docs.flutterflow.io/assets/images/start-audio-recording-light-d089e33d9d8eddcd54cb69ed67aff93b.png) ### Stop Audio Recording [Action] If you have multiple audio recording actions, all the Recorder object names (either auto-generated by FlutterFlow Studio or manually set by the user) are listed under the Recorder Name dropdown. Choose the recorder object you want to stop, and it will stop the ongoing recording. To capture and play the recorded audio, make sure to specify the *Action Output Variable Name*, which can be used with the audio player. Here’s how you can setup this action: 1. When you add this action, choose the **Recorder Name** from the dropdown. This will be the name you provided in the Start Audio Recording action. 2. Specify the **Action Output Variable Name**. This will store the actual audio recording, which you can use with any audio player. It stores recording in an **Audio Path** data type. 3. If you want to upload the audio recording to Firebase or Supabase, you can use the [Upload file](https://docs.flutterflow.io/concepts/file-handling/uploading-files#upload-or-save-media-action) action. When you add this action: 1. Set the **Upload Type** to the preferred one. 2. Set **File Type** to **Uploaded File** because the *Stop Audio Recording* action internally stores recorded audio bytes (inside widget state). 3. Set the **File to Upload** to **Widget State > Recorded File**. 4. For uploading via API, *you don't need to add the Upload file action*. Just directly add the [**API call**](https://docs.flutterflow.io/resources/backend-logic/rest-api) and select the API that will upload the file to your server. **Note** that the request body for this API must be in *Multipart* format. You can pass the audio recording via **Widget State > Recorded File** in the API variable. See how to [configure an API for the multipart request body](https://docs.flutterflow.io/resources/backend-logic/rest-api#multipart-format). :::tip - After stopping the recording, you might want to update the state variables to reflect changes on the UI. For instance, you can enable/disable buttons or stop recording animations. - It's always a good idea to have a fail-safe mechanism to ensure recordings are properly stopped, even if the user forgets to do so manually. For example, you can use the [**On Dispose**](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#on-dispose-action-trigger) action trigger to stop recording when a user closes the app without manually stopping it. :::

### Playing audio recording After you have stopped the recording, you can simply provide the *Action Output Variable Name* to the [Audio Player](#audioplayer) widget to start playing the recorded audio. ## Play or Stop Sound The **Play Sound** and **Stop Sound** actions offer flexibility for enhancing the user experience with audio effects or background sounds. ### Play Sound [Action] The **Play Sound Action** allows you to play a sound that notifies users about the action they have taken—for example, playing a sound after refreshing a list or sending a message. :::tip It is advisable to use this action only for short audio. To play the more extended audio, consider adding the [**AudioPlayer**](#audioplayer) widget. ::: By default, this action is assigned a random **Name** to be stopped later using the [Stop Sound](#stop-sound-action) action. You can adjust the volume using the **Volume** slider (0.0 = mute, 1.0 = full volume). The action is non-blocking by default, allowing subsequent actions to trigger immediately. To wait until playback finishes before proceeding, enable the **Await Playback** option. :::note[Use cases] - **Feedback Sounds:** Play sounds for button clicks, form submissions, or error alerts to improve user interaction and feedback. - **Notifications:** Play sound alerts for reminders, messages, or task completion. - **Gamification:** Enhance gaming experiences with sound effects for achievements, levels, or interactions. ::: ### Stop Sound [Action] You can stop a sound that is currently playing, which was started by the [Play Sound](#play-sound-action) action. For example, If your app is playing any sound effects, you may need to stop them when the app is paused or stopped. :::note This action is enabled only when you have added a [**Play Sound**](#play-sound-action) action on a page. ::: ## VideoPlayer The **VideoPlayer** widget is used to show a video from uploaded assets or the URL link. The VideoPlayer widget can play various video formats such as MP4, MOV, WAV, MPEG, and JPEG motion photos. Refer to the [**Displaying Media**](#media-types) section for more details on accessing media. :::tip[Generated Code] The VideoPlayer uses the [**video_player**](https://pub.dev/packages/video_player) package for reliable video playback across different platforms. ::: **Customization Options** The **VideoPlayer** widget includes several options to align with your app's design and functionality: - **Aspect Ratio:** Set the desired aspect ratio (e.g., 1.7 for a 16:9 ratio) to ensure the video displays correctly. - **AutoPlay:** Enable this option to automatically start playing the video when the page loads. - **Loop Video:** Choose whether the video should replay automatically after it ends. - **Show Controls:** Display playback controls, including play/pause buttons and the seek bar. - **Allow Full Screen:** Enable users to expand the video to full-screen mode. - **Playback Speed Menu:** Let users adjust the video playback speed. - **Load on Page Load:** When enabled, the video will preload when the page loads, reducing buffering time when the user starts playback. - **Pause on Forward Navigation:** If enabled, the video will pause automatically when the user navigates away from the page. ## YoutubePlayer The **YouTubePlayer** widget in FlutterFlow Studio allows you to integrate and play YouTube videos within your app. It offers customizable playback options and an intuitive interface for enhancing the user experience. :::tip[Generated Code] The YoutubePlayer uses a custom version of the [**youtube_player_iframe**](https://pub.dev/packages/youtube_player_iframe) package, hosted on FlutterFlow Studio's GitHub repository. ::: **Customization Options** - **Loop Video:** When enabled, the video will automatically replay after it finishes. - **Mute Video:** Starts the video in a muted state. - **Show Controls:** Displays playback controls such as play/pause, volume, subtitles, and fullscreen options. - **Show Full Screen Control:** This specifically displays the fullscreen toggle button among the controls. - **Pause on Forward Navigation:** Automatically pauses the video when the user navigates away from the page. - **Strict Related Videos:** Ensures that related videos shown at the end of playback come from the same channel as the currently played video. ## PdfViewer In FlutterFlow Studio, the **PdfViewer** widget enables you to display PDF files within your app, supporting both network URLs and locally uploaded assets. Refer to the [**Displaying Media**](#media-types) section for more details. :::tip[Generated Code] The PdfViewer in FlutterFlow Studio uses the [**pdfx**](https://pub.dev/packages/pdfx) package for rendering PDFs. ::: **Customization Options** - **Horizontal Scroll:** By default, the PdfViewer allows vertical scrolling through pages. Enable this option to allow horizontal scrolling. - **Use Proxy:** By default, FlutterFlow Studio routes PDF fetching through a proxy in **Run Mode** and **Test Mode** to avoid CORS (Cross-Origin Resource Sharing) issues. **Switch this off** if you do not want the PDF request to be routed through the proxy. - **Use Custom Proxy URL:** If you need a specific proxy, enable this option and provide your own proxy URL instead of using FlutterFlow Studio’s default proxy. ## Web Access for PDFs and Other Files Some types of files require additional configuration to be accessed on the web. In particular, the PDF Viewer requires network-hosted files (such as uploaded PDFs) to allow Cross-Origin Resource Sharing (CORS). For a deeper understanding of Cross-Origin Resource Sharing (CORS), you can refer to this guide. The key takeaway is that to allow users to upload and view PDFs using Firebase Storage, follow the steps below. You'll need to run a few commands to enable CORS for your Firebase project. No programming experience is required, but if you're comfortable with Firebase, you can refer to the official guide here: [Firebase CORS Configuration](https://firebase.google.com/docs/storage/web/download-files#cors_configuration). **Step 1: Find Your Firebase Project ID** You can find the Firebase project ID from **App Settings > Firebase** (under **Project Setup**). Copy your **Firebase** **Project ID**. ![App Settings > Firebase page with the Firebase Project ID field outlined.](https://docs.flutterflow.io/assets/images/copy-firebase-project-id-light-9dcb754648da1849667600e03cd01f9f.png) **Step 2: Open Cloud Shell in Google Cloud Console** 1. Go to the following link, replacing **FIREBASE_PROJECT_ID** with your actual project ID: ```jsx https://console.cloud.google.com/home/dashboard?cloudshell=true&project=FIREBASE_PROJECT_ID ``` 1. If prompted, click **Continue**. 2. You should see a terminal at the bottom of the screen. If your project ID is not displayed in yellow, click the **down arrow** (🔽) next to the project name and select the correct Firebase project. ![cloud-shell](https://docs.flutterflow.io/assets/images/cloud-shell-2cfa3917b0d0c7a1d67f607c32776a87.avif) **Step 3: Run the CORS Configuration Command** 1. Click on the **Cloud Shell terminal** (the black screen). 2. Copy and paste the following command and replace `` with your actual storage bucket. To locate your Firebase Storage bucket name, navigate to Firebase Console > Storage > at top left side, you'll see your bucket's URL, which typically follows the format `your-project-id.appspot.com`. ```jsx touch cors.json && \ echo '[{"origin": ["*"], "method": ["GET"], "maxAgeSeconds": 3600}]' > cors.json && \ gsutil cors set cors.json gs:// ``` ![storage-bucket.avif](https://docs.flutterflow.io/assets/images/storage-bucket-2a38c52febd3dfc98c9b5ef68b90a86d.avif) 3. Press **Enter** (or **Return**) to execute the command. 4. If prompted, click **Authorize** to allow Cloud Shell to access your Firebase project. 5. Once the command executes successfully, you should see a confirmation message. ![cors-3](https://docs.flutterflow.io/assets/images/cors-3-59c800255b68c5e2f05da6b7ec2e748b.png) ## BlurHash In FlutterFlow Studio, **BlurHash** is a technique used to enhance the user experience by displaying visually appealing placeholders while images are loading. Instead of showing empty spaces or generic loading indicators, BlurHash generates a blurred preview that resembles the actual image, providing users with a smoother and more engaging experience. ![blurhash.avif](https://docs.flutterflow.io/assets/images/blurhash-0048ec5ea8985f9d4315c0af8f6003bb.avif) Here are the steps to generate and use the BlurHash: 1. When using the [**Upload/Save Media**](https://docs.flutterflow.io/concepts/file-handling/uploading-files#upload-or-save-media-action) action to upload images, you can enable the **Include Blur Hash** option. This setting automatically generates a BlurHash string for the uploaded image. ![Upload/Save Media action settings with Include Blur Hash turned on.](https://docs.flutterflow.io/assets/images/enable-blurhash-light-0870977926b581ef6a62f781a88b5d2f.png) 1. After generating the BlurHash, it's advisable to store it alongside the image URL in your database (e.g., Firestore). The generated BlurHash is accessible via the **Widget State > Uploaded Local File > Media Blur Hash**. This approach ensures that both the image URL and its corresponding BlurHash are readily accessible when needed. ![Update Page State action setting the blurHash page state from Uploaded Local File > Media Blur Hash.](https://docs.flutterflow.io/assets/images/save-blurhash-light-229eacbe0a4756e3e3f721065318317c.png) 1. To utilize the BlurHash as a placeholder, in the Image widget's properties, enable the **Use Blur Hash** option and then set the **Blur Hash String** value from a variable. ![Image widget properties with Use Blur Hash on and Blur Hash String bound to the blurHash page state.](https://docs.flutterflow.io/assets/images/use-blurhash-light-7e0071d5ec0b50affc0b9fff7143b5a3.png) ## Best Practices - Enable [infinite scrolling](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid#adding-infinite-scroll) (lazy loading) in list views to load additional content as users scroll, rather than loading all data at once. - Leverage FlutterFlow Studio's built-in cache manager, which automatically handles image caching. - Implement [local caching](https://docs.flutterflow.io/resources/backend-query#backend-query-caching) to store frequently accessed data on the device, reducing the need for repeated network requests. - Reduce the number of network calls by fetching only necessary data and utilizing caching strategies. - Ensure that database queries are efficient and retrieve only the data required for display. - Use [BlurHash](#blurhash) to display a blurred preview of images while they load, enhancing the user experience. - Display loading indicators to inform users that data is being fetched, improving perceived performance. # Download File > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/file-handling/download-file Learn how to add download file action into your FlutterFlow Studio app. The **Download File** action allows you to enable users to download or save files locally on their devices.

:::tip[File Download Location] - **Windows, macOS, Linux, and Web**: Files are saved in the **Downloads** folder by default. - **iOS**: Files are downloaded in the **Application Documents Directory**. - **Android**: Files are saved in the application's directory at `Android/data/your.package.name/files/your_file.extension`. ::: ## Download File [Action] To add a Download File action, select the **Widget** (e.g., button or any interactive widget) where you want users to initiate the file download and set the **Source** to one of the following. - **From URL**: Use this option for downloading files that are accessible through a direct link and specify the URL of the file that should be downloaded. - **From File (Bytes)**: Use this option when the file is uploaded to the device using the [Local Upload (Widget State)](https://docs.flutterflow.io/concepts/file-handling/uploading-files#local-upload-widget-state). You can access the file via ***Widget State > Uploaded Local File***. Optionally, you can specify a **Filename** to be used when the file is downloaded. ![Action Flow Editor showing a Download File action with Source From URL, a URL, and the filename invoice.](https://docs.flutterflow.io/assets/images/file-download-action-light-d306c80511ca2f3acc9b80cff1be3049.png) # Clear or Delete Media > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/file-handling/clear-delete-media Learn how to add clear and delete file actions into your FlutterFlow Studio app. The **Clear** and **Delete** **Media** actions provide essential functionalities for managing media files efficiently. ## Clear Uploaded Data [Action] When users upload media files, these files are first stored in a local state variable, i.e., *Uploaded File URL* for immediate access and display. This action is helpful when you want to offer users a straightforward method to remove any uploaded media, such as images or recordings. :::note For this action to work, the [**Upload or Save Media**](https://docs.flutterflow.io/concepts/file-handling/uploading-files#upload-or-save-media-action) action must already be added to the actions workflow. ::: ## Delete Data [Action] The **Delete Data** action permanently removes uploaded media—such as images, videos, and PDF files—from external storage platforms like [Firebase Storage](https://firebase.google.com/docs/storage) and [Supabase Storage](https://supabase.com/storage). Inside the **URL** section, provide a valid media URL. This must be either the direct **Uploaded File URL** or a variable that holds the URL. :::tip Always prompt users for confirmation before deleting media files to prevent accidental loss of data. ::: # Custom Code > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code Learn how to write and integrate custom code in your FlutterFlow Studio app to add custom functionalities. While FlutterFlow Studio provides a wide range of pre-built components and functionalities, there may be times when you need to extend your app with custom logic or UI components that are not available out of the box. This is where writing custom code comes into play. There are a few different ways to make custom code accessible in FlutterFlow Studio: * **[Custom Functions](https://docs.flutterflow.io/concepts/custom-code/custom-functions):** Custom Dart functions that can be used to set Widget or Action properties. * **[Custom Actions](https://docs.flutterflow.io/concepts/custom-code/custom-actions):** Custom Dart functions that can be triggered by [Action Triggers](https://docs.flutterflow.io/resources/functions/action-triggers/) or used as nodes in an [Action Flow](https://docs.flutterflow.io/resources/functions/action-flow-editor#action-flow-editor). These are usually `async` functions and are able to import [custom package dependencies](#adding-a-pubspec-dependency). * **[Code File](https://docs.flutterflow.io/concepts/custom-code/code-file):** You can define custom classes, enums, and logic to manage your app’s data and behavior. * **[Custom Widgets](https://docs.flutterflow.io/concepts/custom-code/custom-widgets):** Custom Flutter widgets that can also import [custom package dependencies](#adding-a-pubspec-dependency) and be used in the same way as [Components](https://docs.flutterflow.io/resources/ui/components) throughout your project. * **[Configuration Files](https://docs.flutterflow.io/concepts/custom-code/configuration-files):** You'll have the ability to edit native files for Android and iOS. :::tip[Why Write Custom Code?] - **Extend Functionality:** Add features that are not included in the standard FlutterFlow Studio components. - **Custom Integrations:** Integrate with third-party packages or APIs / databases that require specific handling. - **Unique UI Elements:** Create unique user interface elements that require custom rendering or interactions. ::: ## Writing Custom Code Custom Code lets you add app-specific logic, custom widget, and native configuration directly in FlutterFlow Studio. You can keep functions, actions, widgets, and code files organized with the pages and components they support, so each feature's files are easier to find and manage.

:::caution Instructions and visuals on this page show the new Custom Code layout. You can switch from from the classic Custom Code editor by clicking **Try New Layout** in the toolbar. Switching to the new Custom Code layout is one-way for that project. After you switch, you cannot go back to the classic Custom Code editor for the same project. To safely try the new custom code layout first, create another branch, switch to that branch, and then click Try New Layout there.

::: There are two main ways to write custom code in FlutterFlow Studio: 1. Using the [**In-App Code Editor**](#using-the-in-app-code-editor) 2. Using the [**Visual Studio Code Extension**](https://docs.flutterflow.io/concepts/custom-code/vscode-extension) ### Using the In-App Code Editor You can use the In-App Code Editor to view and edit custom code directly in the FlutterFlow Studio application. ![The In-App Code Editor with a custom action open.](https://docs.flutterflow.io/assets/images/custom-code-common-light-5e7b8ee4895c460c693b397f99914aa2.png) :::tip To leverage the capabilities that go beyond our in-app code editor, you can click on the **VS Code icon** to open and edit your custom code directly in VS Code using the FlutterFlow Studio [**VSCode extension**](https://docs.flutterflow.io/concepts/custom-code/vscode-extension). ![The Open in VS Code button in the custom code settings toolbar.](https://docs.flutterflow.io/assets/images/open-in-vscode-light-a39196b85feac832ec7ddbb026dadb29.png) ::: :::caution[Using the In-App Code Editor on Desktop] Note that the desktop version of the In-App Code Editor is limited. We recommend using the Web editor or the **[VSCode Extension](https://docs.flutterflow.io/concepts/custom-code/vscode-extension)**. ::: ### Sharing a Link to Custom Code When you use FlutterFlow Studio in a web browser, the browser's address bar updates to point at the item you have open in the Custom Code editor, the same way it does for a page or component. This works for custom functions, custom actions, custom widgets, code files, configuration files, and cloud functions. To share an item, copy the URL from the address bar and send it to a teammate who has access to the project. When they open the link, FlutterFlow Studio opens the project with that item selected in the editor. ![copy-link-to-custom-code](https://docs.flutterflow.io/assets/images/copy-link-to-custom-code-186cf1fb83574792e322ef1858391b31.avif) :::note The desktop app doesn't update an address bar. To share your current view from the desktop app, use **Copy Link to Current View**. ![share-page-link-in-desktop](https://docs.flutterflow.io/assets/images/share-page-link-in-desktop-dfd0d00ecbad844272598a49b235ef33.avif) ::: ### Code Copilot Code Copilot is an AI-assisted feature that helps you generate code snippets, functions, or entire blocks of code based on natural language descriptions of what you want to achieve. It simplifies the app-building process by allowing you to describe the functionality you need, such as 'calculate the total price of items in a cart', and then the Copilot generates the necessary code. This can significantly speed up the building process and reduce the need for in-depth programming knowledge, making it especially useful for custom functions and actions. :::note[Limitation] Your prompt must be at least 3 words and no more than 500 characters. :::
### Compile Code When you are done adding your code snippets, you can compile it to ensure there are no compilation errors and that your code can be transformed into something that can execute when your app is running. To do so, click the **Compile Code** button.
The compile button shows a check mark when custom widgets and actions compile without errors.
How to recognize compile time errors
To run your app, you must make sure **Custom Functions** are compiled. Custom Widgets and Actions don't need to be compiled to export code or test your app. However, you won't be able to preview Custom Widgets in the builder until they are compiled. You'll see a project warning if you don't compile Custom Widgets or Actions. Compiling Custom Functions should be pretty fast, but sometimes, compiling Custom Actions and Widgets takes a while. ### Code Analyzer The code analyzer is available in all your custom code snippets and ensures the quality and correctness of your custom code. It automatically checks your Dart code for errors and warnings, providing real-time feedback as you write. The code analyzer status in the code editor toolbar. When there is a compilation error, the code analyzer will stop running and display the errors caught by the compiler. Once fixed, save the code and restart the code analyzer to resume real-time analysis and receive feedback on updated code. ### Automatic FlutterFlow Studio Imports When creating a new custom code snippet (Actions, Widgets, or Functions) in FlutterFlow Studio, some fundamental imports will be automatically added for you. These imports cannot be modified by the developer. Custom Functions do not allow adding any custom imports, but you can add custom imports in Custom Actions and Widgets after the line **"Do not remove or modify the code above"**. ![automatic-imports.png](https://docs.flutterflow.io/assets/images/automatic-imports-138890e7d87bf374a4899f48d1e474b3.png) ### Custom Code Settings When you edit a custom code snippet in FlutterFlow Studio, the Settings menu opens on the right. This menu may vary slightly depending on the type of custom code (Actions, Functions, or Widgets), but here, we’ll cover the common settings. #### Generate Boilerplate Code This setting allows you to generate boilerplate code, providing a structured starting point with essential code imports and a basic widget or function structure. ![The boilerplate code dialog for a custom action, with the Copy to editor button.](https://docs.flutterflow.io/assets/images/copy-boilerplate-code-light-a09078f1fa2817fd4cac0b80ace785a2.png) After creating a new resource file, click the code icon on the Widget Settings menu to generate the boilerplate code. Then, click "Copy to Editor" to add the boilerplate to your resource file’s code editor, where you can further customize it. #### References The References helps you understand where your custom code is being used throughout the project. When enabled, FlutterFlow Studio scans your app and displays all locations where a custom function, custom action, or custom widget is referenced. :::caution Enabling References may increase the loading time of the Custom Code editor because FlutterFlow Studio needs to scan the project and map all usage locations. ::: ![The references toggle and the list of places that use the ProductCardWidget custom widget.](https://docs.flutterflow.io/assets/images/references-light-9d12aa6af2ae431ac1e0d03586d1462f.png) #### Exclude From Compilation If, for some reason, your action or widget fails to compile but you still want to compile the rest of your code, you can enable this toggle. Doing so will exclude the problematic code from the compile process. :::tip[Scope] This option is only available for Custom Widgets and Custom Actions. ::: ![The Exclude from compilation and Include BuildContext settings for a custom action.](https://docs.flutterflow.io/assets/images/action-settings-light-8ebd834d7ec0a79bf2253ccca3678709.png) #### Include BuildContext This setting determines whether to pass the BuildContext of the widget calling this custom action as an argument. This is useful for actions that need to interact with the widget tree or access context-specific data. :::tip[Scope] This option is only available for Custom Actions. ::: ## Input Arguments When writing custom code in FlutterFlow Studio, you can define input arguments to make your custom functions, widgets, or actions more dynamic and reusable. Input arguments allow you to pass data into your custom code, enabling it to perform different tasks based on the input provided. By using input arguments, you can create more flexible and powerful custom code that can adapt to various scenarios within your application. Here's an example of an action that takes 2 arguments: `cartItems` that is a `List of ItemsStruct` and `productId` that is a String. ![The cartItems argument defined as a list of the Items data type.](https://docs.flutterflow.io/assets/images/action-arguments-light-e62a18f5f92e2be8618b2c805ef3d736.png) :::tip[Generated Code for custom data types] When you define a custom data type in FlutterFlow Studio, the generated code will refer to the type as `Struct`. For example, if your custom data type is called `Items`, it will be referenced in the generated code as `ItemsStruct`. ::: ### Callback Action As Parameter A callback action is an action passed as a parameter to a custom action or widget and triggered at some point in the future when a specific event occurs. This is especially helpful when you want to trigger actions from within the custom action or custom widget logic and include them as part of the custom behavior. For example, if an error occurs inside the custom logic, you could trigger an action immediately to inform the user about the error, and then continue execution or end with a default value to return. :::tip[What are callbacks?] In programming, callbacks are functions passed to other functions to be called when a specific event occurs. ::: In the following example, we have a Custom Action that takes an `onError(searchKeyword)` callback action with an Action Parameter `searchKeyword`. This means that the custom action will provide this search keyword back to the callback action when it calls it. ![The executeSearch custom action with an onError callback argument that passes searchKeyword back.](https://docs.flutterflow.io/assets/images/explain-callback-action-light-914ebaf8934654bb0d84c2e33c0682bd.png) ### Add an Action to Callback Action To provide a callback action to your main custom action, check out this quick guide where we provide a "**Show Snackbar**" action to `onError`, displaying a combined text using the search keyword.
## Return Values In FlutterFlow Studio, custom code can not only take input arguments but also return values, back to the caller. Return values allow your custom functions, or actions to pass data back to the main application, enabling further processing or UI updates based on the results of the custom code. :::caution[Scope] Return Values are only enabled for Custom functions & Custom Actions. Custom Widgets **cannot** return a value at the moment. ::: Here's an example of an Action that returns a _nullable_ integer. ![The Return Value section of a custom action with the toggle on, Type set to Integer, and Nullable checked.](https://docs.flutterflow.io/assets/images/return-value-actions-light-57696d330886ce76e24305c4647b2ce8.png) ## Description You can add a [**Description**](https://docs.flutterflow.io/flutterflow-ui/resource-hierarchy#resource-description) note on Custom Functions and Custom Actions to briefly explain their purpose, usage, or important details. This helps clarify what the function or action is intended for, making your project more understandable and maintainable—especially in libraries and collaborative environments. ![The settings panel of the calculateTotalWithCoupon custom function, with a description added.](https://docs.flutterflow.io/assets/images/adding-description-light-75edff56b63d97cab2118e4d05ab1f97.png) You can view these descriptions as tooltips by hovering over the note icon when selecting a Custom Function or Custom Action. ![The Set from Variable menu with Custom Functions expanded and a tooltip showing the calculateTotalWithCoupon description.](https://docs.flutterflow.io/assets/images/description-note-light-10d43e970a8fb8913bd669636f899ad8.png) :::tip In the generated code, descriptions are added as comments before the function definition, and they also appear in the custom code editor. ![The function code editor with the description added as a /// comment above calculateTotalWithCoupon.](https://docs.flutterflow.io/assets/images/description-in-custom-code-light-3d94177d04854514351699e6ada51914.png) ::: ## Organize Custom Code Pages, components, and custom code can be grouped together in the same user folders. This makes it easier to organize a feature in one place instead of keeping its UI and custom code separate. For example, if you have a **Cart** folder that contains cart pages and components, you can drag a related custom function, such as `calculateCartTotals`, into the same folder. This keeps the page, component, and custom logic for that feature together in the widget tree.

## Adding a Pubspec Dependency [Pub.dev](https://pub.dev) is the official package repository for Dart and Flutter. It hosts a wide range of packages, libraries, and tools that developers can use to extend the functionality of their Dart and Flutter applications. :::note[Flutter Favorite Packages] Flutter Favorite packages are a curated set of packages on pub.dev that have been recognized by the Flutter team and the community for their quality, popularity, and usefulness in Flutter development. These packages are marked with a "Flutter Favorite" badge, indicating that they meet a high standard of quality, reliability, and best practices. You can explore the Flutter Favorite packages on **[pub.dev's Flutter Favorites page](https://pub.dev/packages?q=is%3Aflutter-favorite)**. ::: To add a pubspec dependency from pub.dev, go to **App Settings > Project Dependencies**, then open the **Custom Pub Dependencies** tab. Click **Add Pub Dependency**, enter the **package name** and **version**, and click **Add** to include it in your project.

### Choosing the correct package from pub.dev You will find varieties of dependencies for a specific requirement, and choosing the best one can be challenging. This section helps you identify the right dependency by examining its score. When you search for any dependency in *pub.dev*, you will get a list of dependencies. You can filter out the result based on which dependency is more inclined toward your needs. You can do so by opening and checking each dependency manually. Once you have a handful of dependencies, consider the following factors while choosing the final one. - **WEB**: It must support Web to run your app in our Run/Test Mode. - **Likes**: This shows how many developers have liked a dependency. - **Pub Points**: Tells the quality of the dependency (out of 130) based on code style, platform support, and maintainability. - **Popularity**: This metric indicates how many apps use the package. A high popularity score (out of 100%) can suggest that the package is stable and trusted by many developers. - **Documentation:** A well-documented package will save you time and reduce ambiguity. Check if the package has clear usage examples, a comprehensive README, and ideally API documentation. - **Maintenance & Updates**: Check the last update date. A regularly updated package is more likely compatible with the latest Dart/Flutter versions and has fewer bugs.

![Dependency-score.png](https://docs.flutterflow.io/assets/images/Dependency-score-605001293cfa6b24bf4ce7073feea1d8.png) When adding a pubspec dependency to your custom code in FlutterFlow Studio, you’ll need two pieces of [information](#setup-code): the Package name with its Version number and the Import statement. ### Using Unpublished or Private Packages FlutterFlow Studio supports the use of unpublished packages, which allows you to integrate packages that are not yet available on **pub.dev**. This capability is particularly useful when working with custom, forked, or private packages hosted on public or private repositories. By leveraging this, you can enhance your app’s functionality with customized or proprietary libraries tailored to your specific needs. :::note[Possible Use Cases] - **Using a Different Branch of a Package**: When you need to test or use features that are only available on a specific branch of a package. - **Forked Version for Customizing Features**: When you need to fork a package to customize its functionality or fix issues that the original maintainer hasn’t addressed. - **Private Packages for Internal Use**: Companies or enterprises may have internal Flutter libraries that they want to use in their FlutterFlow Studio app but cannot publish publicly due to confidentiality or proprietary restrictions. ::: #### Add Packages from Public Repositories For packages hosted on public repositories (e.g., GitHub), you can add them to your FlutterFlow Studio project by specifying the repository URL in the following format. ```js package_name: git: url: https://github.com/username/repository_name.git ``` You can also fine-tune the dependency by using additional parameters like `ref` and `path` in the given format. Here are some examples: - **To use a specific branch** (e.g., `development`): ```js package_name: git: url: https://github.com/username/repository_name.git ref: development ``` - **To use from a specific commit**: ```js dependencies: package_name: git: url: https://github.com/username/repository_name.git ref: a1b2c3d4 ``` - **To use package located in a subdirectory of the repository**: ```js package_name: git: url: https://github.com/username/repository_name.git path: packages/subpackage_name ``` Here’s exactly how you do it:

#### Add Packages from Private Repositories For packages hosted in private repositories, you’ll need to authenticate access. This can be done using HTTPS with a personal access token. For GitHub, you can go to your GitHub account’s settings and [generate a token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) with the necessary permissions and use it in the following format. You can also create and use a [fine-grained access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) that only has certain permissions. ```js package_name: git: url: https://:@github.com/username/private_repo.git ``` Replace `` with your GitHub username and `` with the generated token. ### Setup Code To configure your custom code with the package, copy and paste the following items from the package's pub.dev page: 1. **Copy Package Name & Version** To use the dependency in your Custom Action or Custom Widget resource file, go to the package's pub.dev page and click the **Copy to Clipboard** icon next to the package name and version. Then, in the FlutterFlow Studio code editor, click the cube icon to open **App Settings > Project Dependencies**, click **Add Pub Dependency**, and paste the package name and version. ![The Project Dependencies page, listing dotted_border with version ^2.1.0 under Custom Pub Dependencies.](https://docs.flutterflow.io/assets/images/package-dependency-version-copy-light-5d52c419cf1238d579792b9ff35a8029.png) See **[example](#add-pubspec-dependency-to-custom-code-example-guide)** for more information. :::caution The current dependency might depend on other dependencies to work. So make sure you also copy the name and version of all the additional dependencies to specify in the code You can check if the current dependency has any additional dependencies inside the '*Dependencies'* section at the bottom right side. ![img_1.png](https://docs.flutterflow.io/assets/images/img_1-9cf7d6b8156405f7205db311cbefb87d.png) ::: 2. **Copying Import Statement** An import statement specifies the location of the dependency's code. When creating a custom widget or action, add this statement at the end of the default import statements in the code editor. Open the dependency page and select the **Installing** tab; under the **Import It** section, you'll find the import statement. To copy, click the **Copy to Clipboard** icon. ![A custom widget's code editor with the dotted_border import statement added below the default imports.](https://docs.flutterflow.io/assets/images/copy-import-statement-light-0911c07733155cb787941dd4ac949c79.png) 3. **Copy Example Code** Example code is always available in the **Example** tab on the package’s pub.dev page. Copy any relevant snippets that demonstrate usage, and paste them into your custom widget or function file. You can then modify the code as needed to fit your project. ## Add Pubspec Dependency to Custom Code: Example Guide In this example, we are using the [**flutter_rating_bar**](https://pub.dev/packages/flutter_rating_bar) dependency to create a `ProductRatingBar` custom widget for our Product pages. See how we utilize the example code from pub.dev and add the customized widget in FlutterFlow Studio:

:::note This example demonstrates how to add a [**pub.dev**](https://pub.dev) package to a Custom Widget snippet, but you can follow the same process for adding a package to Custom Actions. For a deep dive, explore the detailed documentation on **[Custom Widgets](https://docs.flutterflow.io/concepts/custom-code/custom-widgets)** and [**Custom Actions**](https://docs.flutterflow.io/concepts/custom-code/custom-actions). ::: ## Manage Dependencies You can manage dependencies directly from the **Custom Pub Dependencies** tab in **App Settings > Project Dependencies**. If version conflicts occur, warnings will appear in both the **Custom Pub Dependencies** tab and the **Custom Code** editor. You can also bump package versions directly from the list, making it easier to resolve issues and keep dependencies consistent.

# Custom Functions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code/custom-functions Learn how to create and use custom functions in your FlutterFlow Studio app to add custom functionalities. Custom Functions in FlutterFlow Studio allow you to perform simple Dart calculations and logic. These functions are ideal for tasks that require immediate results, such as data transformations, mathematical calculations, or simple logic operations. **Custom Functions** enable you to encapsulate reusable logic, making your code more organized and maintainable. Let's see some common examples: **To calculate discount given price and discount rate:** ```js double calculateDiscount(double price, double discountRate) { return price - (price * discountRate / 100); } ``` **To capitalize a String input:** ```js String capitalize(String input) { return input.isNotEmpty ? '${input[0].toUpperCase()}${input.substring(1)}' : ''; } ``` **To convert Celsius to Fahrenheit** ```js double celsiusToFahrenheit(double celsius) { return (celsius * 9/5) + 32; } ``` ## Key Use Cases - **Data Transformation:** Convert or manipulate data before displaying it in the UI. - **Mathematical Calculations:** Perform complex calculations directly within your app. - **String Manipulation:** Format or parse strings based on specific requirements. - **Conditional Logic:** Implement logic that determines output based on given inputs. ## Test Functions Custom Functions are typically straightforward input-output expressions designed to perform specific tasks. It is highly recommended to test your Custom Functions before integrating them into your project. Testing the Custom Function code ensures that it works as expected with various inputs, helping you catch potential issues early. Overall, it boosts your confidence in shipping your app to production, knowing that your logic is reliable and robust.
:::tip[LOOKING for other CUSTOM Function properties?] To learn more about Custom Function properties such as [**Input Arguments**](https://docs.flutterflow.io/concepts/custom-code#input-arguments) and **[Return Values](https://docs.flutterflow.io/concepts/custom-code#return-values)**, please check out this [**comprehensive guide**](https://docs.flutterflow.io/concepts/custom-code). ::: ## FAQs
I can't add imports! You can't have imports in a custom function. To be able to add imports, consider using a Custom Action.
Getting error: The function 'FFAppState' isn't defined. You can't use the app state variable (i.e., `FFAppState().variablename`) directly in your custom function code. Instead, you can pass the app state variable as a parameter and then use it in your code.
## Utility Functions Library Instead of building everything from scratch, explore our **[Utility Functions Library](https://marketplace.flutterflow.io/item/ZVBmWMGpXe6vqnASRHDA)** — packed with 50+ helpful functions for everyday tasks like formatting text, manipulating dates, validating input, and more. Easily plug them into your custom logic to save time and reduce errors. # Custom Widgets > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code/custom-widgets Learn how to create and use custom widgets in your FlutterFlow Studio app to enhance its user interface. Custom Widgets allow you to create unique and reusable UI components that extend beyond the standard widget offerings in FlutterFlow Studio. By leveraging Custom Widgets, you can achieve a higher level of customization and control over your app's user interface. In most cases, you can create a reusable component with the basic widget set available in FlutterFlow Studio. However, when you want to include a UI package from [**pub.dev**](https://pub.dev), **Custom Widgets** are the better choice. ## Key Use Cases - **Unique UI Elements:** Create complex UI components that are not available in the default FlutterFlow Studio widget set. - **Third-Party Integrations:** Integrate external UI packages from pub.dev to enhance the functionality and appearance of your app. ## Creating a New Custom Widget To create a new custom widget, add a new Custom Code snippet and follow the quick guide below. In this example, we will create a `ProductRatingBar` widget that uses a pub.dev dependency to display the rating bar UI. It will also take a callback action to provide the rating value back to the caller.
:::note[Widget Builder as Parameter] You can also leverage [**Widget Builders**](https://docs.flutterflow.io/resources/ui/components/widget-builder) that allow you to pass in widgets to be used within the custom widget tree. This is especially useful when you want to dynamically substitute content for some part of a custom widget - like displaying an item in a custom widget popup. ::: ### Properties: Width & Height For custom widgets, it is mandatory to specify both width and height. These properties are required to size the custom widget appropriately. Without setting these dimensions, the custom widget will not render correctly within your application. ## Add Dependency to Custom Widgets In this example, we are using the [**flutter_rating_bar**](https://pub.dev/packages/flutter_rating_bar) dependency to create a `ProductRatingBar` widget for our Product pages. See how we utilize the example code from pub.dev and add the customized widget in FlutterFlow Studio:

:::tip[Choosing a Pubspec Dependency] For a comprehensive guide on navigating external packages using pub.dev, evaluating packages, and making the best choices for your app, [**follow the guide**](https://docs.flutterflow.io/concepts/custom-code#adding-a-pubspec-dependency). ::: ## Using a Custom Widget To add a custom widget to your page, you can drag and drop it from the Widget Palette's Components section or through the Widget Tree section. Here is a demo:
### Providing the Callback Actions Since we created the `onRating` callback action in our custom widget, we must provide an action when setting the widget in page. In this example, we set the `ratingValue` to the page state variable `userRating`.
## Preview Widget FlutterFlow Studio also allows you to view your custom widget once it is successfully compiled. ![The Preview widget tab of a StarRating custom widget, with Width 300 and Height 60 set as preview parameter values.](https://docs.flutterflow.io/assets/images/preview-custom-widget-light-d9f6794cc41a15e779e5e3a1c47e978a.png) :::tip[LOOKING for other CUSTOM action properties?] To learn more about Custom Widget settings, such as the [**Exclude From Compilation toggle**](https://docs.flutterflow.io/concepts/custom-code#exclude-from-compilation), and other properties like [**Callback Actions**](https://docs.flutterflow.io/concepts/custom-code#callback-action-as-parameter), [**Pub Dependencies**](https://docs.flutterflow.io/concepts/custom-code#adding-a-pubspec-dependency), please check out this [**comprehensive guide**](https://docs.flutterflow.io/concepts/custom-code). ::: # Custom Actions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code/custom-actions Learn how to create and use custom actions in your FlutterFlow Studio app to enhance functionality. Custom Actions in FlutterFlow Studio differ from custom functions in that they always return a `Future`. This makes them particularly useful for complex operations that may take time to complete, such as querying a database or calling a function that returns results after a delay. Additionally, Custom Actions are beneficial when you want to add a third-party dependency from `pub.dev`, allowing you to extend the capabilities of your application with external packages. :::tip[What is a Future?] Futures in **Flutter** represent an asynchronous operation that will return a value or an error at some point in the future. `Future` indicates that the future will eventually provide a value of type `T`. So if your return value is a `String`, then the Custom Action will return a `Future`, and the `String` return value will be output at some point in the future. ::: ## Key Use Cases - **Database Queries:** Perform complex queries to retrieve or update data in a database. - **API Calls:** Make asynchronous HTTP requests to external APIs and handle the responses. - **File Operations:** Manage file reading or writing operations that require time to complete. - **Third-Party Integrations:** Incorporate external packages and dependencies to enhance functionality, such as an external analytics package. ## Using a Custom Action Once your Action code is finalized, saved, and compiled, you can start using this action as a part of your Action flow. In the following example, we have a Custom Action called `executeSearch` that takes an argument `searchItem` that is the search string from the search **TextField** of an ecommerce app's `HomePage`.
## Using the Custom Action Result In our previous example, we enabled the **Return Value** of the Custom Action to return a `List` when the search keyword is valid. With this change the code will change from ```js Future executeSearch(String searchItem) async { // Add your function code here! } ``` to ```js Future> executeSearch(String searchItem) async { // Add your function code here! } ``` Let's modify our Action Flow now so we can use the custom action result values within our Action Flow.

:::tip[LOOKING for other CUSTOM action properties?] To learn more about Custom Action settings, such as the [**Exclude From Compilation toggle**](https://docs.flutterflow.io/concepts/custom-code#exclude-from-compilation), [**Include Build Context toggle**](https://docs.flutterflow.io/concepts/custom-code#include-buildcontext), and other properties like [**Callback Actions**](https://docs.flutterflow.io/concepts/custom-code#callback-action-as-parameter), [**Pubspec Dependencies**](https://docs.flutterflow.io/concepts/custom-code#adding-a-pubspec-dependency), please check out this [**comprehensive guide**](https://docs.flutterflow.io/concepts/custom-code). ::: # Code File > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code/code-file Learn how to create and use custom classes and enums in FlutterFlow Studio. FlutterFlow Studio allows you to add your own custom Dart files with [classes](https://dart.dev/language/classes) and [enums](https://dart.dev/language/enums). This means you can create reusable building blocks to manage your app’s data and logic more easily. Using custom classes, you can create custom data types, use their properties in the UI, call methods in action flows, and much more. ## Key Use Cases - **Custom Models**: Define your own data models, such as `UserProfile`, `Product`, or `Order`, and use them throughout your app. - **Business Logic**: Add reusable utility methods like tax calculations, formatting, or conditional evaluations. - **Reusable Enums**: Define enums and use them in UI conditions and dropdowns. :::caution[Limitations] - **No Generics:** Classes with generic types (e.g., `class ApiResponse {}`) are currently not supported. - **No Function-Typed Parameters:** Methods or fields that have function types as parameters or fields are ignored (e.g., void Function(int) onTap). - **No Extensions:** Dart Extensions (e.g., `extension StringX on String { … }`) are not supported yet. ::: ## Create Custom Class To add a custom class, go to the **Custom Code** from the left navigation menu, click **plus (+)** button, and select **Code File**. Set the name of the file, add your code, and hit the **Save** button. Now, you must **validate** your code in the editor to catch basic syntax errors. If there are no errors, click the **Parse** button. FlutterFlow Studio will scan your code and automatically detect supported classes and enums. Here’s an example of adding a `Review` custom class:

Here's the code snippet of the `Review` custom class: ```jsx class Review { String id; String productId; String userId; String userName; String comment; double rating; // out of 5 ReviewStatus reviewStatus; DateTime date; int helpfulCount = 0; Review( this.id, this.productId, this.userId, this.userName, this.comment, this.rating, this.reviewStatus, this.date, ); // Method: Get a short version of the comment String shortComment() { if (comment.length <= 50) return comment; return comment.substring(0, 47) + "..."; } // Method: Get formatted date as string (e.g., "2024-05-22") String formattedDate() { return "${date.year}-${_twoDigits(date.month)}-${_twoDigits(date.day)}"; } String _twoDigits(int n) { return n >= 10 ? "$n" : "0$n"; } // Method: Check if review is positive (4 stars or more) bool isPositive() { return rating >= 4.0; } // Method: Check if review is recent (within last 30 days) bool isRecent() { final now = DateTime.now(); return now.difference(date).inDays <= 30; } // Method: Mark this review as helpful void markHelpful() { helpfulCount += 1; } } ``` :::tip You can also include import statements and access generated classes within your custom class files. For more details, [**see the examples**](https://docs.flutterflow.io/concepts/custom-code/common-examples) on how to access generated classes. ::: ## Create Custom Class Instance You need to create an instance of a class so you can work with actual data and use the class’s properties and methods in your app. Here’s a simple explanation: - A **class** is like a blueprint or template. For example, the `Review` class describes what a review is, but doesn’t hold any real review information itself. - An **instance** (or “object”) is a real, usable item made from that blueprint. See the code snippet below: ```jsx Review review1 = Review( 'r001', 'p123', 'u456', 'Alex Morgan', 'Great quality T-shirt!', 4.5, DateTime(2025, 5, 22), 3, ReviewStatus.approved, ); ``` - In FlutterFlow Studio, you will store the instance of the custom class in the [state variables](https://docs.flutterflow.io/concepts/state-management#state-variables) of your app, page, or component. - You can create multiple instances of the same class, reusing the same structure multiple times, each with different review data. When you create an instance of a class, you can: - Store actual review details. - Access and update the fields (e.g., `review1.rating` or `review1.comment`). - Call methods that do something with that data (e.g., `review1.markHelpful()` or `review1.shortComment()`). To create an instance of a custom class, first you need to [create a state variable](https://docs.flutterflow.io/concepts/state-management#creating-state-variables) (of type Custom Class) that will hold the instance. Then, to create and add the instance to the state variable, open the **Set from Variable** dialog and select **Create Custom Class Instance**. Choose the class you want to use, then select the class name from the **Constructor** dropdown. After that, set values for each of the required fields.

## Using Custom Class Once the custom class is added successfully, you can access its fields and methods in the Variable Dialog, call its methods in the Action Flow Editor, assign instances to state variables, pass them to page or component parameters, and use enum values in dropdowns or conditionals. ### Custom Class as Data Type You can select your custom class as a Type for variables, state, or parameters, just like a [Custom Data Type](https://docs.flutterflow.io/resources/data-representation/custom-data-types). ![A page state variable named reviews with its type set to a list of the Review custom class.](https://docs.flutterflow.io/assets/images/custom-class-as-data-type-light-9c348e52872ebe5b5c8f76c48236f3b3.png) ### Access Fields and Methods You can use custom class fields to display values directly in the UI, and call its methods in variable dialogs to return a result. ![Selecting a method of the first Review in the reviews page state from the Set from Variable menu.](https://docs.flutterflow.io/assets/images/access-fields-methods-light-ce05967ccc713259b18c57f5c030c3e1.png) ### Set Field [Action] Use the **Set Field** action to update a specific property of a custom class instance. For example, you can set `review.comment = 'Great fit and quality!'` when a user updates the review, allowing the UI to reflect the new comment instantly.

### Call Method [Action] Use the **Call Method** action to invoke a method defined in your custom class. For instance, if your `Comment` class has a `markHelpful()` method, you can trigger it when a user taps a “Helpful” button to record the interaction.

## Using Static Members Sometimes, you may want to define fields and methods that are shared across your app. In such cases, `static` fields and methods are ideal. Because they're tied to the class rather than an instance, static members are accessible globally, for example, utilities for formatting, calculations, or global configuration. This approach is typically used for **stateless utility classes** where shared functionality is needed across the app. For example, look at the class below: ```jsx class Utils { static int square(int x) => x * x; } ``` The `Utils` class contains a static method `square` that returns the square of a number without needing to create an object of the class. Here are couple more examples to understand it better: - This `StringFormatter` class below provides reusable static methods to capitalize text, convert it to lowercase, or format it in snake_case. ```jsx class StringFormatter { static String lastFormatted = ''; static int formatCount = 0; static String capitalize(String input) => input[0].toUpperCase() + input.substring(1); static String toLowerCase(String input) => input.toLowerCase(); static String toSnakeCase(String input) => input.replaceAll(' ', '_').toLowerCase(); } ``` - The `MathHelper` class offers handy static methods to calculate tax, apply discounts, find percentages, and round off numbers. ```jsx class MathHelper { static double calculateTax(double amount) => amount * 0.18; static double applyDiscount(double amount, double discountPercent) => amount - (amount * discountPercent / 100); static double calculatePercentage(double part, double total) => (part / total) * 100; static int roundOff(double value) => value.round(); } ``` :::tip You can mix both **static** and **instance** members in a single class. Static members are shared across all instances, while instance members hold data specific to each object. For example, look at the class below: ```jsx class Review { static List flaggedWords = ['bad', 'spam', 'fake']; String id; String userId; String comment; int helpfulCount = 0; Review( this.id, this.userId, this.comment ); static bool isCommentAppropriate(String input) { return !flaggedWords.any((word) => input.toLowerCase().contains(word)); } void markHelpful() { helpfulCount += 1; } } ``` - `flaggedWords` is a static list used across all reviews. - `isCommentAppropriate()` is a static method that can be used without creating a `Review` instance, useful for validating comments before saving them. ::: :::caution Using static members are powerful, but they should be used carefully. Overusing static methods can lead to less flexible code and potential issues, especially when the logic requires access to state or needs to evolve over time. Stick to static methods only when the logic is truly independent and doesn’t rely on instance-specific data. ::: ### Access Static Fields and Methods You can access the static class data and methods directly via the ****Set from Variable**** menu. ![Calling the static square method of the Utils class from the Set from Variable menu, with x set to 10.](https://docs.flutterflow.io/assets/images/static-class-methods-light-0d7a7bcebc56e101eeb21a94e36597dc.png) ### Set Static Field [Action] Use the **Set Static Field** action to update a static field on a custom class. For example, if you have a class `MathHelper` with a static field `amount`, you can set it using an input value when a user enters a price. This allows you to store that value globally and use it across different calculations.

### Call Static Method [Action] Use the **Call Static Method** action to run a static method of your class. For instance, you can call `MathHelper.calculateTax(amount)` to compute tax on a given amount during a checkout action, without needing to create an instance of the class.

## Custom Enums Similar to how you add a custom class, you can also add Custom Enums in your app. [Enums](https://docs.flutterflow.io/resources/data-representation/enums) are a great way to define a fixed set of values, such as user roles, order statuses, or content types. Once parsed, these enums become available throughout your app and can be used in dropdowns, conditionals, and UI bindings. For example, you could define an enum called `ReviewStatus` with values like `pending`, `approved`, and `rejected`. Here's the code snippet for it: ```jsx enum ReviewStatus { pending, approved, rejected, } ``` ![The ReviewStatus enum in review.dart, listed as an enum in the code file settings.](https://docs.flutterflow.io/assets/images/custom-enums-light-ffd5c2669efb804f31787116e1fd47f6.png) You can access the custom enums from **Set from Variable** menu > **Custom Enum** section. You’ll see your Dart file listed by name. Select the enum you want to use, such as `ReviewStatus`, and then choose the specific value you want to assign.

## Tips & Best Practices - Keep your custom class files modular and focused; ideally one class per file for better organization and reusability. - Avoid advanced Dart features that are not supported by FlutterFlow Studio’s parser, such as generics or function-typed fields. - Re-parse your code after making changes to ensure FlutterFlow Studio updates the parsed structure correctly. - Document your code with comments to make your custom classes easier to understand and maintain over time. ## FAQs
Can I add Custom Classes (Code Files) in a Library Project?

Yes, you can. When a Library Project is imported, any custom code files you’ve defined will be parsed, and the resulting classes will be available for use in the consuming project.

# Configuration Files > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code/configuration-files Learn how to modify platform-specific files for Android and iOS to extend your app's capabilities. FlutterFlow Studio allows you to modify configuration files for your app, and platform-specific files, without leaving the FlutterFlow Studio interface. In some cases, you’ll need to tweak the configuration files that FlutterFlow Studio generates. This is usually required when integrating third-party packages such as analytics, ad networks, and payment solutions. Here are the key configuration files you can edit: - [**`AndroidManifest.xml`**](#androidmanifestxml-android) – Configures app permissions, metadata, and intent filters for Android. - [**`build.gradle`**](#buildgradle-android) – Defines Android specific build configurations such as compile SDK version, dependencies, build types, and signing configurations. - [**ProGuard files**](#proguard-file-android) – Used for code shrinking and obfuscation in Android builds. - [**`Info.plist`**](#infoplist-ios)– Manages iOS app settings, including permissions and configurations. - [**`Entitlements.plist`**](#entitlementsplist-ios) – Defines iOS app privileges such as push notifications and Apple Pay. - [**`AppDelegate.swift`**](#appdelegateswift-ios) – Manages iOS app launch behavior and runtime configuration. It registers Flutter plugins, initializes services like Firebase, and handles app lifecycle events and deep linking. - [**`main.dart`**](#maindart-flutter) – The entry point of your Flutter app, where you can modify app-level logic. :::caution While editing configuration files can unlock advanced functionality, it comes with risks. A small mistake (e.g., a missing XML tag or a wrong key) can cause your app to fail compilation or crash at runtime. Incorrect changes might lead to App Store/Play Store rejections. So, it’s important to note your changes and thoroughly test your app after each edit. In short, edit native code only when necessary, and do so carefully. ::: ## Editing Files FlutterFlow Studio provides two main ways to modify native files: [**Add Individual Snippets**](#option-1-add-individual-snippets) and [**Manual Edit Mode**](#option-2-manual-edit-mode). ### Option 1: Add Individual Snippets **Snippets** are small pieces of code that you can inject into the native files at predefined locations. Instead of opening the whole file to edit, you provide just the fragment you want to add, and FlutterFlow Studio merges it into the file in the correct place. This is safer and easier for small additions such as a permission line or a meta-data tag. #### Snippet Placement for Android Let’s see how to add a snippet for the `AndroidManifest.xml` file, where you can add the following tags: - **Activity Tags:** Inserts XML code inside the `MainActivity` block. This is typically used to add child XML elements within the MainActivity, such as `` or `` to control aspects such as deep linking, theme application, or launch mode. - **Application Tags**: Used to inject properties or attributes directly on the `` tag itself. For example, you can use this to set values such as `android:icon`, `android:label`, `android:allowBackup`. - **App Component Tags**: Inserts complete XML components inside the `...` block. Use this to add additional activities, services, broadcast receivers, or content providers that your app depends on. To add a snippet to your `AndroidManifest.xml`, navigate to **Custom Code** from the left navigation menu, select **Configuration Files**, then choose `AndroidManifest.xml`. Click the **plus (+)** button next to the tag where you want to insert the snippet. Provide a name (this will be included as a comment in the file) and paste your snippet code.

#### Snippet Placement for iOS For iOS, let’s see how to add a snippet for the `Info.plist` and `Entitlements.plist` files. There’s no nested application/activity structure like on Android. Instead, both files are dictionaries of key-value pairs. When you add a snippet, it’s placed directly under the root `` element of these plist files. To add a snippet to native iOS files, navigate to **Custom Code** (from the left-side menu) > **Configuration Files**, and select the desired file. Click the **plus** (+) button, provide a descriptive name (which will appear as a comment in the file), and paste your snippet code.

:::tip - Snippet insertion isn't available for `main.dart`. Instead, you can directly modify the file using [**Manual Edit Mode**](#option-2-manual-edit-mode). - You can also use your Development [**Environment Values**](https://docs.flutterflow.io/testing/dev-environments#environment-values) and [**Library Values**](https://docs.flutterflow.io/resources/projects/libraries#library-values) inside snippets. For more details, refer to the [**Include Variables in Native Code**](#include-variables-in-native-code) section. ::: ### Option 2: Manual Edit Mode For more complex changes, you can enable **Manual Edit Mode**, which unlocks the entire file for free-form editing. This is like opening the raw file in a text editor directly within FlutterFlow Studio. **Note that** the manual mode is powerful but should be used carefully. To manually edit native files, navigate to **Custom Code** (from the left-side menu) > **Configuration Files**, select the file you want to edit, and click the **lock** button to unlock it. You can now freely modify the file. :::caution Once unlocked, the file stays in manual editing mode until you lock it again. Re-locking it will reset the file to a version generated by FlutterFlow Studio, which will overwrite any manual changes you've made. :::

:::tip - Don’t remove FlutterFlow Studio’s existing entries unless you are sure. It’s safer to only add or modify necessary lines and leave the rest as is. - Use Manual Edit Mode for bulk or complex edits that the snippet can’t easily do, such as reordering tags, removing something, or pasting in a large chunk of config. Always verify that the app still builds and runs after such edits. - You can also use your Development [**Environment Values**](https://docs.flutterflow.io/testing/dev-environments#environment-values) and [**Library Values**](https://docs.flutterflow.io/resources/projects/libraries#library-values) inside snippets. For more details, refer to the [**Include Variables in Native Code**](#include-variables-in-native-code) section. ::: ## Include Variables in Native Code When editing native files in FlutterFlow Studio, you may need to include dynamic values, such as API keys, app configurations, or environment-specific settings. Instead of hardcoding these values directly in **`AndroidManifest.xml`**, **`Info.plist`**, or other native files, you can use FlutterFlow Studio [**Environment Values**](https://docs.flutterflow.io/testing/dev-environments#environment-values) and [**Library Values**](https://docs.flutterflow.io/resources/projects/libraries#library-values) to keep your app flexible and secure. To include a variable in a configuration file, start by creating a **file-level variable** and assigning it a value from either your **Environment Values** or **Library Values**. Then, reference this variable using a placeholder format (e.g., `{{apiToken}}`) within the configuration file. These placeholders in native files are automatically replaced with their actual values during the code generation process. Here’s exactly how you do it:

:::tip - You can also directly insert a variable placeholder (e.g., `{{variableName}}`) into the code using a snippet or manual edit mode and FlutterFlow Studio automatically creates the corresponding file-level variable. - You can use the file level variable across different snippets within the same file. ::: Here are some examples that utilize variables in native code: **Example 1: Using API Keys in `AndroidManifest.xml`** Let’s say you are integrating the Mapbox package in your FlutterFlow Studio app, and it requires an API Key in the form of a token inside the `AndroidManifest.xml` file. Instead of hardcoding the token, you can use a variable like this: ```xml ``` Here, `{{MAPBOX_ACCESS_TOKEN}}` is a file level variable that holds the Environment Value. **Example 2: Configuring `Info.plist` for iOS** For iOS apps, you might need to configure App Transport Security (ATS) to allow non-HTTPS connections. Instead of manually setting `NSAllowsArbitraryLoads` to `true`, you can use a variable: ```xml NSAllowsArbitraryLoads <{{ALLOW_HTTP_TRAFFIC}}/> ``` If `ALLOW_HTTP_TRAFFIC` is set to `true` in FlutterFlow Studio’s Environment Value, the app will allow HTTP connections. **Example 3: Using Library Values** If you are building a [FlutterFlow Studio Library](https://docs.flutterflow.io/resources/projects/libraries) and need to include public API keys in native code, you can use [Library Values](https://docs.flutterflow.io/resources/projects/libraries#library-values) as placeholders. This ensures that when someone installs your library, they can define their own values. For example, if your library integrates with a public weather API that requires an API key (such as Open-Meteo or WeatherAPI for general use), it’s best not to add the key directly in the manifest file. Instead, create a file-level variable and assign it a Library Value. ```jsx ``` The library user will define their own API key under Library Values when importing your library. At build time, FlutterFlow Studio replaces `{{WEATHER_API_KEY}}` with the user-defined key. ## Editable Files FlutterFlow Studio allows editing several key native files. Below, we cover each file’s role, why you might need to edit it, and examples of real-world use cases. ### `AndroidManifest.xml` (Android) `AndroidManifest.xml` is the master configuration file for your Android app. It is located in the root directory of the app's `android/app/src/main` folder and declares essential app information to the Android OS and Google Play. This includes your app’s package name, components (activities, services, receivers), and the permissions it needs. It defines hardware and software features the app depends on, such as Bluetooth, GPS, or sensors. The manifest manages intents and filters, determining how the app responds to system events and deep linking. It also includes metadata and configuration for SDKs and libraries, such as API keys or feature flags. In short, the manifest is like an app’s identity card and permission sheet for Android. Here are some scenarios where you may need to modify the `AndroidManifest.xml` file: **Example 1: Declaring App Components (Activities, Services, Receivers)** For including additional screens (activities), background processes (services), or listeners (broadcast receivers), you must declare them in `AndroidManifest.xml`. ```xml ``` This registers `NewScreenActivity` so the system knows it exists. **Example 2: Requesting Permissions** If your app requires access to restricted resources such as wake locks (to keep the device awake) or audio recording, you must declare the necessary permissions in `AndroidManifest.xml` by [manually editing](#option-2-manual-edit-mode) the file. **Tip:** You can also add custom permissions directly through the [**Permission Settings**](https://docs.flutterflow.io/resources/projects/settings/project-setup#adding-a-custom-permission) in FlutterFlow Studio. ```xml ``` Without these, the app cannot keep the device awake or record audio. **Example 3: Adding Metadata for SDKs and Libraries** Many third-party packages (Google Maps, Firebase, AdMob, etc.) require `` tag in `AndroidManifest.xml` to pass configuration values. For example, the [**Mapbox Flutter**](https://pub.dev/packages/mapbox_flutter) plugin requires adding your Mapbox access token as a metadata entry for initialization. A real example: to initialize Mapbox, you’d add: ```xml ``` **Example 4: Restricting the App to Specific Devices** You can specify device hardware requirements (e.g., GPS, camera, touchscreen) to ensure the app only installs on compatible devices. ```xml ``` This prevents installation on devices without a camera. **Example 5: Enabling Cleartext Traffic** If your app needs to communicate over HTTP (unencrypted) for testing or legacy reasons, you might need to add `android:usesCleartextTraffic="true"` in the `` tag. This is to relax network security for HTTP URLs. ```xml ``` :::tip You can modify the `AndroidManifest.xml` file by either [**adding a snippet**](#snippet-placement-for-android) or [**editing it manually**](#option-2-manual-edit-mode). ::: ### `build.gradle` (Android) The `build.gradle` file is the main Gradle build script for your Android app module. It resides in the `android/app/` directory and controls how your Android app is compiled, packaged, and built. This file defines critical configuration such as: - SDK versions (`compileSdkVersion`, `minSdkVersion`, `targetSdkVersion`) - Dependencies for third-party libraries - Build types (like debug vs. release) - Signing configurations for release builds - Kotlin and Flutter settings - MultiDex and ProGuard rules - Android packaging options In short, the `build.gradle` file acts as the blueprint for how your Android app is built and prepared for distribution. **Example 1: Changing SDK Versions** To set which Android SDK your app compiles with, update the following section in `build.gradle`: ```jsx android { compileSdkVersion 33 defaultConfig { applicationId "com.example.myapp" minSdkVersion 21 targetSdkVersion 33 versionCode 1 versionName "1.0" } } ``` Use this when you want to upgrade to a newer Android API level or need compatibility with certain libraries. **Example 2: Adding Third-Party Libraries** To use Android-specific libraries (such as Play Services or Jetpack), add them in the `dependencies` section: ```jsx dependencies { implementation 'com.google.android.gms:play-services-maps:18.1.0' implementation 'androidx.work:work-runtime:2.7.1' } ``` Use this when integrating services like Google Maps, Firebase Messaging, or WorkManager. **Example 3: Adding ProGuard Rules for Release Build** If your app uses ProGuard (code shrinking/obfuscation), you can define custom rules or reference a rules file: ```jsx android { buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } ``` Use this to reduce APK size and protect code in production. **Example 4: Enabling MultiDex for Large Apps** If your app exceeds the 64K method limit (common when using many dependencies), enable MultiDex support: ```jsx defaultConfig { ... multiDexEnabled true } ``` Use this when your build fails with `Too many methods` errors or when integrating large libraries like Firebase. :::tip You can modify the `build.gradle` file by either [**adding a snippet**](#snippet-placement-for-ios) or [**editing it manually**](#option-2-manual-edit-mode). ::: ### ProGuard File (Android) The **ProGuard file (`proguard-rules.pro`)** is a configuration file used in Android projects to optimize, shrink, and obfuscate the app’s code. It helps reduce APK or AAB size, improves performance, and protects the app’s code from reverse engineering by making it difficult to decompile. The ProGuard files allow you to specify rules to keep certain classes or methods (prevent them from being removed or renamed), or to tweak the obfuscation behavior. Located in the **`android/app/proguard-rules.pro`** directory of an Android project, the ProGuard rules are applied when code shrinking is enabled in a release build. Here are some scenarios where you may need to modify the ProGuard file: **Example 1: Preventing Issues with Third-Party Libraries** ProGuard can obfuscate critical libraries, breaking their functionality. To prevent this, you need to keep specific classes used by the library. ```jsx # Firebase -keep class com.google.firebase.** { *; } # Gson (JSON Serialization) -keep class com.google.gson.** { *; } -keepattributes *Annotation* ``` This ensures that Firebase and Gson classes are not obfuscated, preventing serialization errors. **Example 2: Debugging ProGuard Issues** If your app crashes in release mode but works in debug mode, ProGuard might be removing important classes. To troubleshoot, you can add logging and keep rules. ```jsx -assumenosideeffects class android.util.Log { public static *** d(...); public static *** v(...); public static *** i(...); } ``` This removes debug logs in release builds but retains them for troubleshooting. **Example 3: Improving Security by Removing Debug Information** Attackers can decompile APKs and view sensitive debug logs. To remove these debug logs, add: ```jsx -dontwarn android.util.Log ``` **Example 4: Keeping Native Libraries (JNI) Safe** If your app uses native C/C++ libraries (JNI), ProGuard may mistakenly remove required components. To prevent this: ```jsx -keep class com.example.native.** { *; } -keepclassmembers class * { native ; } ``` This keeps all native methods intact. **Example 5: Preventing Issues with Reflection-Based Code** Some libraries rely on reflection to dynamically call methods, which ProGuard may remove. ```jsx -keep class * implements android.os.Parcelable { *; } -keepclassmembers class ** { @android.webkit.JavascriptInterface ; } ``` This ensures reflection-based code continues working. ### `Info.plist` (iOS) `Info.plist` (Information Property List) is the configuration file for iOS apps. It’s a structured XML file that provides iOS with essential information about your app’s configuration and requirements. The `Info.plist`defines things such as your app’s bundle identifier, display name, version, and most importantly, usage descriptions for permissions and other settings iOS needs at runtime. The file is required for every iOS app and is located in the project’s `/ios/Runner/` directory of your FlutterFlow Studio apps. Essentially, it’s the blueprint for iOS to understand your app’s capabilities and needs. Here are some scenarios where you may need to modify the `Info.plist` file: **Example 1: Requesting Permissions** If your app requires location access both while in use and in the background, you must declare the appropriate permissions in `Info.plist`. **Tip:** You can also add custom permissions directly through the [**Permission Settings**](https://docs.flutterflow.io/resources/projects/settings/project-setup#adding-a-custom-permission) in FlutterFlow Studio. ```xml NSLocationWhenInUseUsageDescription This app requires location access while in use to provide location-based services. NSLocationAlwaysAndWhenInUseUsageDescription This app requires background location access to enable continuous location tracking. ``` This ensures the app can access location services even when the user is not actively using it. **Example 2: Enabling App Transport Security (ATS) for HTTP Requests** By default, iOS enforces HTTPS connections for security reasons. If your app needs to communicate with **HTTP-only** servers, you must modify `Info.plist`. ```xml NSAppTransportSecurity NSAllowsArbitraryLoads ``` This allows all HTTP requests but should be used with caution **Example 3: Configuring Background Modes** If your app requires background functionality (e.g., playing music, location tracking), you must enable background modes in `Info.plist`. ```xml UIBackgroundModes audio location ``` This allows the app to play audio or track location when running in the background. **Example 4: Adding Keys** Many third-party packages require to add keys in the in `Info.plist` file. For example, If you’re using the Mapbox SDK, you need to provide an access token in `Info.plist` to enable map functionality. ```xml io.flutter.embedded_views_preview MGLMapboxAccessToken YOUR_MAPBOX_ACCESS_TOKEN ``` The **`MGLMapboxAccessToken`** key is required for initializing Mapbox maps in your app. Additionally, the **`io.flutter.embedded_views_preview`** key must be set to `true` to support embedding native views inside Flutter widgets. :::tip You can modify the `Info.plist` file by either [**adding a snippet**](#snippet-placement-for-ios) or [**editing it manually**](#option-2-manual-edit-mode). ::: ### `Entitlements.plist` (iOS) The `Entitlements.plist` file is a property list in iOS applications that defines the app’s security-related capabilities and permissions. It grants specific privileges to an app, allowing it to access Apple services such as iCloud, Push Notifications, App Groups, Background Modes, and Keychain access. It is located in the **`/ios/Runner/`** directory of your FlutterFlow Studio app and is named **`Runner.entitlements`**. This file ensures that only authorized apps can use these features, maintaining security and preventing unauthorized access to sensitive system functions. Here are some scenarios where you may need to modify the `Entitlements.plist` file: **Example 1: Enabling iCloud Storage** If your app integrates **iCloud services**, such as syncing user data or storing documents, you must add iCloud entitlements. ```xml com.apple.developer.icloud-container-identifiers iCloud.com.yourcompany.appname com.apple.developer.icloud-services CloudDocuments ``` This grants your app access to iCloud storage under the specified container. **Example 2: Enabling Keychain Access** If your app needs to store secure credentials, enabling Keychain Sharing is required. ```xml keychain-access-groups com.yourcompany.appname ``` This allows secure storage of login credentials, API tokens, or encryption keys in the iOS Keychain. **Example 3: Enabling App Groups for Shared Data** If your app shares data between multiple apps or an app extension (e.g., a widget or a Siri shortcut), you must enable App Groups. ```xml com.apple.security.application-groups group.com.yourcompany.shared ``` This allows different apps or extensions to access shared storage and user defaults. **Example 4: Enabling Wallet (Apple Pay & Passes)** If your app integrates with Apple Wallet, you need to add Wallet entitlements. ```xml com.apple.developer.pass-type-identifiers pass.com.yourcompany.appname ``` This enables your app to create, manage, and present passes in Apple Wallet. :::tip You can modify the `Entitlements.plist` file by either [**adding a snippet**](#snippet-placement-for-ios) or [**editing it manually**](#option-2-manual-edit-mode). ::: ### `AppDelegate.swift` (iOS) The `AppDelegate.swift` file is the entry point for your iOS application. It plays a crucial role in setting up your app’s runtime environment and handling app lifecycle events such as launching, backgrounding, and termination. This file is also where you register Flutter plugins and initialize SDKs like Firebase or Branch. It’s located at: `ios/Runner/AppDelegate.swift` **Example: Registering Custom iOS Plugins** For custom native iOS plugins that aren’t auto-registered, you can manually register them inside `AppDelegate.swift`. ```jsx override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { let controller: FlutterViewController = window?.rootViewController as! FlutterViewController let myPlugin = CustomPlugin() myPlugin.register(with: controller) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } ``` Use this for custom iOS integrations that require manual setup. :::tip You can modify the `AppDelegate.swift` file by either [**adding a snippet**](#snippet-placement-for-ios) or [**editing it manually**](#option-2-manual-edit-mode). ::: ### `main.dart` (Flutter) The `main.dart` file is the entry point of every FlutterFlow Studio app. It is the first file that runs when the app starts and is responsible for initializing the application, configuring dependencies, and defining the root widget. Located in the **`lib/`** directory, `main.dart` contains the `main()` function, which is required for every FlutterFlow Studio app. If you need to execute any custom Dart code at startup — such as initializing third-party SDKs, setting global configurations, service locators, printing a debug log, or running certain functions once — `main.dart` is the place to do it. :::note [**Adding Snippets**](#option-1-add-individual-snippets) isn't available for `main.dart`. Instead, you can directly modify the file using [**Manual Edit Mode**](#option-2-manual-edit-mode). ::: Here are some scenarios where you may need to modify the `main.dart` file: **Example 1: Initializing Third-Party Packages** Many packages have initialization calls. For example, if you added a custom package for analytics or error tracking (say Sentry or a logging service), you might need to call `SentryFlutter.init()` or set up an error handler at app startup. By placing that call in `main.dart` (before or right after `runApp`), you ensure it’s executed early. ```jsx import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; Future main() async { runZonedGuarded(() async { await SentryFlutter.init( (options) { options.dsn = 'https://example@sentry.io/add-your-dsn-here'; }, ); runApp(MyApp()); }, (exception, stackTrace) async { await Sentry.captureException(exception, stackTrace: stackTrace); }); } ``` This ensures Sentry is ready before the app starts, just like Firebase initialization. **Example 2: Customizing the Status Bar Appearance** If you want to change the status bar color and adjust icon brightness for Android and iOS, you need to modify `main.dart` before calling `runApp()`. ```jsx import 'package:flutter/services.dart'; void main() { SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle( statusBarColor: Colors.redAccent, // Custom status bar color statusBarIconBrightness: Brightness.dark, // Dark icons for Android statusBarBrightness: Brightness.light, // Light icons for iOS ), ); runApp(MyApp()); } ``` **Example 3: Locking the Screen Orientation** Some apps require landscape-only or portrait-only modes. You can enforce screen orientation in `main.dart` before launching the app. ```jsx import 'package:flutter/services.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); await SystemChrome.setPreferredOrientations([ DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight, ]); runApp(MyApp()); } ``` This ensures the app only runs in landscape mode. **Example 4: Observing App Lifecycle Changes** If your app needs to respond to lifecycle events, such as tracking when the app goes into the background or returns to the foreground, you can attach an observer. ```jsx import 'package:flutter/widgets.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); WidgetsBinding.instance.addObserver(AppLifecycleObserver()); runApp(MyApp()); } class AppLifecycleObserver with WidgetsBindingObserver { @override void didChangeAppLifecycleState(AppLifecycleState state) { if (state == AppLifecycleState.resumed) { print('App is in foreground'); } else if (state == AppLifecycleState.paused) { print('App is in background'); } } } ``` ## Best Practices - **Backup:** Before making native file changes, ensure you have a backup of at least the text of the original file. You could also commit your changes so you can revert if needed. This way, if things go wrong, you can manually restore. - **One Change at a Time:** Add or modify one item at a time and then test your app. If you add multiple things and something breaks, it’s harder to pinpoint which change did it. - **Consult Package Documentation:** When you’re making changes for third-party packages, follow their instructions exactly. Usually, package docs show a snippet – use that in FlutterFlow Studio’s [snippet](#option-1-add-individual-snippets). Double-check official docs for Android or iOS if you’re unsure about the correct keys or tags. For example, if enabling background fetch, Apple’s docs will list the exact string to use in `Info.plist` (`fetch` in `UIBackgroundModes` array). - **Keep it Minimal:** Only add what you truly need. Don’t add a bunch of entitlements or permissions “just in case” as that can bloat and complicate your app, and even trigger store reviews for uses that your app doesn’t actually have. - **Use Comments:** As you modify files, annotate them. If six months later you or a team member look at the manifest, a comment like `` is very helpful. - **Testing on Devices:** Especially for anything related to `Info.plist` or entitlements, always test on a real iOS device if possible. Some issues (like missing entitlements or background mode usage) won’t show up in the simulator. Similarly, test Android changes on a device or emulator with a release build – because ProGuard rules effects, for example, only show in release mode. - **Monitoring Logs and Errors:** After making changes, monitor the Xcode console or Android logcat when running the app. If there are misconfigurations, you often get warnings. - **Stay Updated:** FlutterFlow Studio may improve native editing features over time. Keep an eye on FlutterFlow Studio’s docs or community announcements. If they introduce a new easier way, prefer that to manual editing when possible, as it will be more foolproof. - **Security Consideration:** Remember that anything in these files (especially `Info.plist`, `AndroidManifest.xml`) is essentially public in the distributed app. Don’t assume an API key in `Info.plist` is hidden – it’s not. For keys you must include (maps, etc.), consider using [private environment values](https://docs.flutterflow.io/testing/dev-environments#private-environment-values) and monitoring their usage. ## FAQs
My app won’t install on an iOS device. What should I check?

Confirm that the entitlements in `Entitlements.plist` match your provisioning profile. If you see a “Missing entitlement” error, it means you added an entitlement not allowed by your profile. Remove it or update the profile in the Apple Developer Portal.

How do I fix “Manifest merger failed” on Android?

This error indicates a conflict in your `AndroidManifest.xml`. Common issues include **duplicate permissions** or attributes (e.g., two `` entries). The error message usually identifies the conflicting line. Remove the duplicate or ensure each property is set only once to resolve the conflict.

Why my app isn't running in Test Mode after editing the `main.dart` file with Supabase enabled?

There's a known limitation where editing the `main.dart` file with Supabase enabled prevents Test Mode from running. As a workaround, please use [**Local Run**](https://docs.flutterflow.io/testing/local-run) to test your app instead.

Can I modify the Configuration Files in a Library project?

Yes, you can. When a Library Project is imported, any configuration file snippets, such as those for `AndroidManifest.xml`, `Info.plist`, or `Entitlements.plist` are automatically merged into the importing project's configuration files. Additionally, your Library Project can pass values (like API keys) into those snippets using [**Library Values**](https://docs.flutterflow.io/resources/projects/libraries#library-values), making it easy to customize. ![config-values-in-library](https://docs.flutterflow.io/assets/images/config-values-in-library-daa58dd3085d67ffaec7a37c099da6fc.avif) This makes Libraries incredibly powerful and enables easy integration of tools like **PostHog** (analytics), **Sentry** (crash reporting), **CleverTap**, **flutter_local_notifications**, **flutter_nfc_kit**, and many more directly from the Marketplace.

# Common Code Examples > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code/common-examples Learn about the common custom code examples and use it directly in your project. The custom code feature in FlutterFlow Studio allows you to extend functionality by accessing generated classes and modifying global variables like App States and FlutterFlow Studio themes. This guide covers common scenarios where you can leverage custom code to enhance your project by working directly with data models and other resources within your code. :::caution[Disclaimer] Custom Functions cannot import new files or packages outside of the default dedicated imports. Therefore, most of the suggestions below that involve adding a new import will not work in Custom Functions due to this restriction. However, they will work for Custom Widgets and Custom Actions. For example, a new [**Custom Function**](https://docs.flutterflow.io/concepts/custom-code/custom-functions) typically includes the following packages and files. Your custom function code changes should use only these packages & files: ```js import 'dart:convert'; import 'dart:math' as math; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:intl/intl.dart'; import 'package:timeago/timeago.dart' as timeago; import 'lat_lng.dart'; import 'place.dart'; import 'uploaded_file.dart'; import '/backend/backend.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import '/backend/schema/structs/index.dart'; import '/backend/schema/enums/enums.dart'; import '/auth/firebase_auth/auth_util.dart'; ``` ::: ### Access FlutterFlow Studio Generated Classes FlutterFlow Studio generates a complete Flutter codebase for you as you build apps in its platform. Part of this code includes custom classes that are designed to streamline common tasks and encapsulate reusable properties or logic. For example: - **Button Widgets:** FlutterFlow Studio provides custom button classes like `FFButton` that come with built-in styling and behaviors. - **Google Places:** The `FFPlace` class encapsulates properties of a Google Place, such as name, address, and coordinates. - **File Uploads:** The `FFUploadedFile` class represents files uploaded to your app, encapsulating properties like the file name, bytes, and URL. :::tip[What is a Class?] In programming, a class is a blueprint for creating objects. It defines properties (data) and methods (functions) that belong to objects of that type. For example, - A `Car` class might have properties like `color` and `speed` and methods like `drive()` and `stop()`. - In FlutterFlow Studio, a class like `FFPlace` might have properties like `address` and `latLng`, and methods to manipulate or retrieve these values. ::: These custom FlutterFlow Studio classes in the generated code are mostly prefixed with `FF` or `FlutterFlow`. If you need to access these classes in your custom code, simply type "FF" or "FlutterFlow Studio" in the code editor to locate them quick. ![Code suggestions for FlutterFlow Studio classes after typing FF in the code editor.](https://docs.flutterflow.io/assets/images/suggestions-dropdown-light-c71ff4fdb2e9189157c884775d9aab36.png) ### Leveraging Components in Custom Widget :::caution[Static Components vs Dynamic] Use this approach only when the component is a fixed element that does not change across different use cases. If the child component needs to change based on user choices, pass it directly [**as a parameter**](https://docs.flutterflow.io/concepts/custom-code/custom-widgets#creating-a-new-custom-widget). ::: In a **[Custom Widget](https://docs.flutterflow.io/concepts/custom-code/custom-widgets)**, you can integrate a previously built **[FlutterFlow Studio Component](https://docs.flutterflow.io/resources/ui/components)** directly, saving you from recreating child content in code. For example, if you’re building a Custom Widget to display custom dialog boxes or bottom sheets using a package from [pub.dev](https://pub.dev/), you can simply return an existing Component created on the canvas, rather than coding a new one from scratch. :::tip[Imports] When referencing a Component class in your code, FlutterFlow Studio will automatically add the necessary import statement. ::: ![A custom widget whose build method returns the ProductListCard component.](https://docs.flutterflow.io/assets/images/return-widget-custom-code-light-9e4ac495691550061d516480f0f341b4.png) ### Get FlutterFlow Studio Theme in Custom Widget When building custom widgets, you often need to style parts of the widget, such as setting colors. Instead of using hardcoded color values, you can directly access the **FlutterFlow Studio Theme**. This theme provides consistent styling across your app and reflects colors set by you or your project developer. To access theme colors in your custom widget, use the `FlutterFlowTheme.of(context)` method. This allows you to retrieve any theme property, such as the default `primary`, `primaryBackground`, or other custom-created colors, as well as text styles like `bodyLarge` or `bodyMedium`, ensuring that your custom widget aligns with the app’s overall theme. Here’s an example of how to use the primary color from FlutterFlow Studio Theme in a custom widget: :::tip[Imports] Ensure you import `import '../flutter_flow/flutter_flow_theme.dart';` when accessing `FlutterFlowTheme` in your custom widgets. ::: ```js class CustomButton extends StatefulWidget { final String label; CustomButton({required this.label}); @override _CustomButtonState createState() => _CustomButtonState(); } class _CustomButtonState extends State { bool isPressed = false; void toggleButton() { setState(() { isPressed = !isPressed; }); } @override Widget build(BuildContext context) { return ElevatedButton( style: ElevatedButton.styleFrom( backgroundColor: isPressed ? FlutterFlowTheme.of(context).primary // Primary color when pressed : FlutterFlowTheme.of(context).secondaryBackground, // Default color foregroundColor: FlutterFlowTheme.of(context).secondaryText, // Text color ), onPressed: toggleButton, child: Text( widget.label, style: FlutterFlowTheme.of(context).bodyText1, // Themed text style ), ); } } ``` ### Modifying AppState from Custom Code In FlutterFlow Studio, you can access or update AppState directly from the Action Flow Editor. However, certain scenarios may require you to access or modify AppState within custom code for more control over the operation flow. The `FFAppState` class also provides additional helper functions to modify AppState values. Let’s look at some examples: :::tip[Imports] Ensure you import `import '../../flutter_flow/flutter_flow_util.dart';` when accessing `FFAppState` in custom code resources. ::: - **Get AppState value in Custom Code** ```js Future getCartItems() async { // Retrieve the current cart items from AppState final currentCartItems = FFAppState().cartItems; print('Current Cart Items: $currentCartItems'); } ``` - **Updating AppState Values in Custom Code** ```js Future enableDarkMode() async { // Enable dark mode in AppState FFAppState().update(() { FFAppState().enableDarkMode = true; }); print('Dark mode enabled'); } ``` - **Modifying a List in AppState Using Helper Functions** The `FFAppState` class offers a variety of helper functions to easily manage list variables in AppState. For a detailed overview of this generated class, check out **[this guide](https://docs.flutterflow.io/generated-code/ff-app-state#managing-appstatelist)**. Here are some examples of how to use these helper functions to modify an AppState list variable: ```js Future addLocation(LatLng value) async { // Add a new location to the LatLng list FFAppState().addToLatLngList(value); } Future removeLocation(LatLng value) async { // Remove a specific location from the LatLng list FFAppState().removeFromLatLngList(value); } Future removeLocationAtIndex(int index) async { // Remove a location at a specific index from the LatLng list FFAppState().removeAtIndexFromLatLngList(index); } Future updateLocationAtIndex(int index, LatLng Function(LatLng) updateFn) async { // Update a location at a specific index in the LatLng list FFAppState().updateLatLngListAtIndex(index, updateFn); } Future insertLocationAtIndex(int index, LatLng value) async { // Insert a new location at a specific index in the LatLng list FFAppState().insertAtIndexInLatLngList(index, value); } ``` ### Leverage Custom Data Types When you create a custom data type in FlutterFlow Studio, it **[generates a corresponding `Struct` class](https://docs.flutterflow.io/generated-code/custom-data-types)**. In FlutterFlow Studio's custom code, you can create new instances of such data types, pass instances back into an action, or manipulate and retrieve information from existing objects. Here are some examples to help illustrate working with an example `ProductStruct` class. #### Example 1: Creating a new Instance of `ProductStruct` To create a new `ProductStruct` instance, initialize it with the required properties: ```js // Create a new instance of ProductStruct final newProduct = ProductStruct( productId: '123', name: 'Example Product', description: 'A sample product description.', category: 'Electronics', subCategory: 'Mobile Phones', price: PriceStruct(amount: 299.99, currency: 'USD'), sizes: ['Small', 'Medium', 'Large'], colors: [ColorsStruct(colorName: 'Red', colorHex: '#FF0000')], images: [ImagesStruct(thumbnail: 'https://example.com/image.jpg')], stockStatus: StockStatusStruct(xs: 0, small: 2), reviews: [ReviewsStruct(rating: 4, comment: 'Great product!')], ); ``` #### Example 2: Get Properties of an Existing `ProductStruct` object If you have an existing `ProductStruct` object (e.g., retrieved from a list of products), you can access its properties or return specific values back to the calling Action. Let's assume you have an Action that calls a Custom Action to retrieve a field value from the provided `ProductStruct` object. - **Returning a Single Field from ProductStruct** This function retrieves and returns the product's name. The return type is `String?` to account for the possibility of a null value. ```js // Function to return the product name from a ProductStruct instance String? getProductName(ProductStruct product) { // Get and return the product name return product.name; } ``` - **Checking if a Field Exists in a `ProductStruct` Object** This function determines whether the `ProductStruct` object contains a non-null value for a specific field, such as `description`. It returns `true` if the field exists and is not null, and `false` otherwise. ```js // Function to check if the description field exists in a ProductStruct instance bool hasDescription(ProductStruct product) { // Return true if the description is not null, false otherwise return product.description != null; } ``` - **Returning a List of Review Comments from ProductStruct** This function retrieves a list of review comments from the reviews field in the `ProductStruct`. The return type is `List` as it returns a list of comments (or an empty list if there are no reviews). ```js // Function to return a list of review comments from a ProductStruct instance List getProductReviewComments(ProductStruct product) { // Check if reviews are present and return a list of review comments return product.reviews?.map((review) => review.comment ?? '').toList() ?? []; } ``` #### Example 3: Modifying Properties of an Existing `ProductStruct` Object You can also modify the properties of an existing `ProductStruct` object. This can be helpful if you want to update a field before saving the data back to Firebase or passing it into an action. - **Simple Property Modification** In this example, we’ll modify a single property, like `productName`, of an existing `ProductStruct` object. This example is straightforward and demonstrates how to update a basic field in the object. ```js // Function to update the product name of a ProductStruct instance Future updateProductName(ProductStruct product, String newProductName) { // Update the product name with the new value product.productName = newProductName; } ``` - **Complex Property Modification - Nested Object Update** In this more complex example, we’ll modify a nested property within the `ProductStruct`, such as updating the price (which itself is a `PriceStruct` object). This shows how to update a property that itself contains multiple fields. ```js // Function to update the price of a ProductStruct instance Future updateProductPrice(ProductStruct product, double newAmount, String currency) { // Check if price is not null if (product.price != null) { // Update only the amount field product.price!.amount = newAmount; } else { // If price is null, optionally initialize it if needed product.price = PriceStruct( amount: newAmount, currency: currency, ); } } ``` - **Complex Property Modification - Updating a List Property** In this example, we’ll add new items to a list property, like adding new review comments to the `reviews` list in `ProductStruct`. This example shows how to work with a list of nested objects. ```js Future addNewReviews(ProductStruct product) { product.reviews ??= []; // Initialize the reviews list if it's null product.reviews!.addAll([ ReviewStruct(rating: 5, comment: 'Excellent product!'), ReviewStruct(rating: 4, comment: 'Good quality, but a bit expensive.'), ReviewStruct(rating: 3, comment: 'Satisfactory, meets expectations.'), ]); } ``` or if the new list of reviews is being provided to the Custom Action, then: ```js Future addDynamicReviews(ProductStruct product, List newReviews) { product.reviews ??= []; // Initialize the reviews list if it's null product.reviews!.addAll(newReviews); // Add the new reviews } ``` ### Using Firebase Auth Variables in Custom Code When using Firebase Authentication for your app, FlutterFlow Studio provides access to key authentication data, such as `currentUserDisplayName`, `currentUserUid`, and more. These variables can be used in your Custom Actions to build additional features that require such common data from authenticated users. For example, you can check if a user’s email is verified before proceeding with certain actions: ```js if (currentUserEmailVerified) { // Perform action for verified users } ``` Or, if you need to create a directory path that includes the user’s unique ID: ```js String directoryPath = '/users/' + currentUserUid + '/files'; ``` Here’s a list of other Firebase Auth variables that can be referenced in Custom Code: - `currentUserEmail` – The email address of the current user. - `currentUserUid` – The unique ID of the current user. - `currentUserDisplayName` – The display name set by the user. - `currentUserPhoto` – The profile photo URL of the current user. - `currentPhoneNumber` – The user’s phone number, if available. - `currentJwtToken` – The current user’s JWT token for secure requests. - `currentUserEmailVerified` – Boolean indicating if the user’s email is verified. - These variables make it easy to integrate Firebase Auth data into custom functionality, enhancing the user experience. ### Get Dev Environment Values in Custom Code Similar to `FFAppState`, FlutterFlow Studio generates a singleton `FFDevEnvironmentValues` class in your FlutterFlow Studio generated codebase, if you are using **[Dev Environments](https://docs.flutterflow.io/testing/dev-environments)**. This class can also be accessed from custom code if needed. It is generated based on the environment selected by the user at the time of code generation. To access any Dev Environment values in custom code, simply use: ```js Future getWebhookId() async { // Add your function code here! return FFDevEnvironmentValues().webhookId; } ``` ### Access Library Components in Custom Code When using a library dependency in your project, you can also access its components, such as Library App State, Library Values, and Library Widgets, in the user project's custom code. Here are a few examples: #### Get Library Values Similar to `FFAppState` or `FFDevEnvironmentValues` class, FlutterFlow Studio generates a singleton `FFLibraryValues` class for library projects, which provides direct access to **[Library Values](https://docs.flutterflow.io/resources/projects/libraries#library-values)**. To access Library Values directly in custom code: ```js Future getSchema(StateStruct? syncStatus) async { print(FFLibraryValues().schema); } ``` #### Get Library Custom Code When you add a library dependency to your FlutterFlow Studio project, FlutterFlow Studio automatically includes necessary imports, allowing you to utilize custom code resources from the library project in your user project's custom code files. For example, if you have a library with project ID `library_hybw3o`, FlutterFlow Studio will add the following import to your project: ```js import 'package:library_hybw3o/flutter_flow/custom_functions.dart' as library_hybw3o_functions; ``` Now, let's use the library’s custom functions in the user project's custom function: ```js int getRandomIndex(List indexList) { final item = library_hybw3o_functions.getRandomItem(); // Library's custom function // get Random Index final randomNumber = math.Random(); return ... } ``` #### Manually Add Library Imports If the library import doesn’t appear in your project automatically, you can manually add it and assign a custom alias. For example, to import a library’s custom actions into your project’s Custom Widget resource, add the import yourself as shown below: For example, let's import the library's custom actions into the user project's Custom Widget resource. If the import is not already available, you can add it manually as follows: ```js // Custom import import 'package:library_hybw3o/custom_code/actions/index.dart' as library_hybw3o_actions; // Assigning a custom alias to the import // Example Widget code class CustomDialog extends StatefulWidget { const CustomDialog({ super.key, this.width, this.height, }); final double? width; final double? height; @override State createState() => _CustomDialogState(); } class _CustomDialogState extends State { @override void initState() { library_hybw3o_actions.getSchema(StateStruct()); // calling library custom action super.initState(); } @override Widget build(BuildContext context) { return Container(height: 50, width: 50); } } ``` # Cloud Functions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code/cloud-functions Learn how to use Cloud Functions in your FlutterFlow Studio app for serverless backend functionality. Cloud Functions let you run backend code in response to events and API requests without managing your own servers. They are commonly used for tasks such as processing data, calling external APIs, sending notifications, running AI workflows, or securely handling secrets and business logic. FlutterFlow Studio supports both Firebase Cloud Functions and Supabase Edge Functions, allowing you to build scalable backend workflows. ## Firebase Cloud Functions [**Firebase Cloud Functions**](https://firebase.google.com/docs/functions) allow you to run server-side Node.js code triggered by Firebase services and HTTPS requests. For example, you can automatically send emails, process uploads, generate AI content, or react to database changes. FlutterFlow Studio includes built-in support for creating, editing, deploying, and triggering Firebase Cloud Functions directly from the platform. :::note Read up on some interesting use cases of [**Cloud Functions**](https://firebase.google.com/docs/functions/use-cases). ::: ### Adding Cloud Functions Let's see how to add a *Cloud Function* by building an example that generates logos based on user prompts. Here's how it looks:

The Cloud Function takes input from a TextField widget and initiates an API call to an [image generation API](https://platform.openai.com/docs/api-reference/images/create). Once the image URL is retrieved, it's displayed within an Image widget. Here are the step-by-step instructions to build such an example: :::note[Before you Begin] * Make sure the project is on Blaze plan on Firebase. * Completed all steps in the [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). ::: **1. Add page state variables** For this example, you'll need to set up two [Page State variables](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#creating-a-page-state): 1. **generatingImage (*****Type: Boolean*****)**: This is used to control the visibility of a loading indicator during the logo creation process. Its value is set to *True* before initiating the API call and switched to *False* once the logo generation is complete. 2. **logoImage (*****Type: ImagePath*****)**: This is used to hold the generated logo image. After a successful API call, the retrieved image URL is stored here, allowing the logo to be displayed in the Image widget.

![The generatingImage and logoImage page state variables on the LogoMaker page.](https://docs.flutterflow.io/assets/images/img_6-light-f41188e02d3e40f978de0fbacf1280ac.png) **2. Build a page** Let's add a page that allows users to enter the prompt. To speed up, you can add a page from the template or use [AI Page Gen](https://docs.flutterflow.io/resources/ui/pages#generate-with-designer). Here is the page added using AI Page Gen, and after some modification, it looks the below: Also, see how to [build a page layout](https://docs.flutterflow.io/concepts/layouts) if you want to build a page from scratch. ![The LogoMaker page in the widget tree, with a ConditionalBuilder that shows the Create Logo button or a ProgressBar.](https://docs.flutterflow.io/assets/images/img_7-light-9848d9b0c236b1e5df359803a61849ca.png) Few things to note here: * We use the [**ConditionalBuilder**](https://docs.flutterflow.io/concepts/layouts/conditional-builder) widget to show/hide the loading indicator based on the *generatingImage* variable. **Tip**: The Else branch of this widget is nothing but a ProgressBar inside the Container with a [rotating loop animation](https://docs.flutterflow.io/concepts/animations/widget-animations). * The Image widget uses the *logoImage* variable to display the logo. **3. Create and deploy Cloud Function** To create and deploy a *Cloud Function* : 1. Click on the **Cloud Functions** from the [**Navigation Menu**](https://docs.flutterflow.io/flutterflow-ui/builder#navigation-menu) (left side of your screen). 2. Click **+**, and then select **Firebase Cloud Function**. This adds the default `newCloudFunction`. 3. Set the **Cloud Function Name**. #### Boilerplate Settings On the right side, you can configure the following Boilerplate Settings: 1. **Memory Allocation**: You can specify the amount of memory your function should have when it's executed based on its complexity and needs. This setting is crucial as it influences the function's performance and the cost of running it. More memory can enhance performance for intensive tasks but also increase costs. 2. **Timeout (s)**: This refers to the maximum amount of time, in seconds, that a function is allowed to run before it is automatically terminated. If your function takes longer to execute, increasing the timeout setting may be necessary. However, be aware that longer timeouts can incur higher costs since billing is based on execution time. 3. **Require Authentication**: Turn on this setting if you want users to be authenticated to execute this cloud function. 4. **Cloud Function Region**: This determines the geographical location of the servers where your functions are hosted and executed. Ideally, you should keep this same as your *Default GCP resource location* and the Cloud Function Region specified in the Firebase Advanced Settings. ![The Cloud Functions Region setting under Advanced Settings in the Firebase app settings.](https://docs.flutterflow.io/assets/images/cf-region-light-334693e1e9d6effb59544ca13d5e6372.png) #### Configuring Input & Output Your cloud function might need some data to process and return the result. You can do so by configuring the input and output. 1. To receive output from a Cloud Function, enable the **Return Value** and choose an appropriate Type for the output, like 'String' for text. For this example, set it to *ImagePath* to get the URL of the generated logo. 2. To input data: Click **+ Add parameters**. **Name** the parameter, select its **Type**, choose single or multiple items (**Is List** option), and uncheck **Nullable** if the value can be null. For this example, add a parameter 'prompt' with *Type* set to *String*. 3. When using [Custom Data Types](https://docs.flutterflow.io/resources/data-representation/custom-data-types), Cloud Function expects JSON, matching each field in the Data Type to a key-value pair in the JSON. If the Data Type is a list, the function expects a list of JSONs. For example, for a custom data type named 'Person' with fields 'Name' and 'Age,' the function should return: ``` //JSON: { "Name": "John", "Age": 30 } //Example Cloud Function Code: return { "name": person.name, "age": person.age }; ``` For a list, the function should return: ``` //JSON [ { "Name": "John", "Age": 30 }, { "Name": "Jane", "Age": 25 } ] //Example Cloud Function Code: return filteredpersons.map(filteredpersons => { return { "name": filteredpersons.name, "age": filteredpersons.age }; }); ``` #### To deploy 1. Click the `[]` icon to view the boilerplate code; a popup will open with the updated code, and then click **` Copy to Editor`**. **Tip**: To see if you are able to deploy the cloud function (before adding your own code), proceed directly with steps 8 and 9. 2. Inside the code editor, add the cloud function code. **Tip**: You can copy the boilerplate code to [ChatGPT](https://chat.openai.com/) and ask it to write the desired code based on that. 3. Click **Save Cloud Function**. 4. Click **Deploy**. Here's the code used for this example: ``` const functions = require('firebase-functions'); const admin = require('firebase-admin'); const https = require('https'); exports.logoMaker = functions.region('us-central1') .runWith({ timeoutSeconds: 10, memory: '512MB' }).https.onCall((data, context) => { return new Promise((resolve, reject) => { const prompt = data.prompt; if (!prompt) { reject(new functions.https.HttpsError('invalid-argument', 'No prompt provided')); return; } const postData = JSON.stringify({ model: "dall-e-3", prompt: prompt, n: 1, size: "1024x1024" }); const options = { hostname: 'api.openai.com', port: 443, path: '/v1/images/generations', method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer YOUR-APIKEY`, 'Content-Length': postData.length } }; const req = https.request(options, (res) => { let responseBody = ''; res.on('data', (chunk) => { responseBody += chunk; }); res.on('end', () => { try { const responseJSON = JSON.parse(responseBody); if (responseJSON.data && responseJSON.data.length > 0) { // Retrieve the URL of the first image const firstImageUrl = responseJSON.data[0].url; resolve(firstImageUrl); } else { reject(new functions.https.HttpsError('not-found', 'No images found')); } } catch (error) { reject(new functions.https.HttpsError('internal', 'Error processing response', error)); } }); }); req.on('error', (error) => { reject(new functions.https.HttpsError('internal', 'Error generating image', error)); }); req.write(postData); req.end(); }); }); ``` :::tip[Important] Always regenerate and use the updated boilerplate code or adjust your own code accordingly whenever there are changes in the code, boilerplate settings, or input/output parameters. :::

:::tip[Optional: Add package] Your cloud function may require third-party packages to work. You can include any npm package (dependency) by listing it in the `package.json` file. This file not only manages the npm package dependencies for your functions but also holds project metadata, sets up scripts for tasks such as deployment and outlines the compatible Node.js versions. To add a dependency, open the `package.json` file and specify your package in the `dependencies` section. ![The package.json file in the Cloud Functions panel, with two added dependencies outlined.](https://docs.flutterflow.io/assets/images/img_9-light-97ef2b0eb06a500ed791dbb2e22a618d.png) ::: **4. Trigger Cloud Function** The newly created *Cloud Function* will be available as an action when you are adding one. For this example, on click of a button, we'll first set the *generatingImage*to *True* and then trigger the **Cloud Function Action**.


**5. Optional: Use Cloud Function result** To use the *Could Function* result, ensure you provide the *Action Output Variable Name* while adding the action, and then you can access it via the **Set from Variable menu > Action Outputs > [Action Output Variable Name]**. For this example, we'll use the result (i.e., generated logo image URL) and set it to *logoImage* variable. Here's how you do it:
### Testing Cloud Functions The Google Cloud console has built-in functionality to allow you to trigger a Cloud Function for testing. This means that after deploying Cloud Functions, you can test them without writing to Firestore (either from FlutterFlow Studio or otherwise). Here's how to test FlutterFlow Studio's `sendUserPushNotificationsTrigger` function in the Google Cloud console: 1. Open your browser and navigate to the following URL: `https://console.cloud.google.com/functions/details/us-central1/sendUserPushNotificationsTrigger?env=gen1&project=&tab=testing` \ In here: - Replace `` with your GCP or Firebase project. - If you want to test a different Cloud Function, update `sendUserPushNotificationsTrigger` with the relevant cloud function name. 2. Paste the following JSON into the Configure Triggering Event text area. - If you want to test a different Cloud Function, update `sendUserPushNotificationsTrigger` with the relevant cloud function name. ```json { "value": { "name": "projects//databases/(default)/documents/sendUserPushNotificationsTrigger/", "fields": { "scheduled_time": { "stringValue": "" }, "initial_page_name": { "stringValue": "" }, "notification_title": { "stringValue": "Your friends are missing you!" }, "notification_text": { "stringValue": "Please come back to Nanochat" }, "user_refs": { "stringValue": "users/VXu6EvFMl5M8KMXriYRvFEWTFHA2" } } } } ``` 3. In the `name` property: - Replace `` with your GCP or Firebase project. - Replace `` with the ID of the document. This document must already exist in Firestore. - If you're testing another function than `sendUserPushNotificationsTrigger`, update `ff_user_push_notifications` with the collection where the document is written. 4. Update the values under the `fields` property for the message you want to send. \ The `fields` in the example above are for FlutterFlow Studio's built-in `sendUserPushNotificationsTrigger` function. If you're testing a different Cloud Function, you will need to update the `fields` for the code in *that* function. 5. Click the TEST THE FUNCTION button. The Cloud Function will now run and gather the relevant entries from Google Cloud Logging. ### FAQs
Why do cloud function deployments fail on newly created projects? This issue occurs because the newly created Google Cloud Platform (GCP) project hasn't been fully configured with the necessary APIs and permissions. Follow the steps below to enable the required APIs and set proper permissions. 1. Open your browser and navigate to the following URL: `https://console.cloud.google.com/functions/list?referrer=search&hl=en&project=` Replace `` with your GCP or Firebase project ID. 2. Click on the **Create Function** button. GCP will prompt you to enable the necessary APIs: **Cloud Build** and **Cloud Functions**. 3. After clicking **Next**, you will be prompted to enable the **Cloud Run Admin API**. ![cloud-run-admin-api](https://docs.flutterflow.io/assets/images/cloud-run-admin-api-6289d1d79337a0f909d0e29e555335f6.png) 4. Now, you need to grant the default compute service account the appropriate permissions. In the next page, you will see the option to deploy an example cloud function like `helloHttp`. Deploy this function. You will be prompted to grant permissions to the default compute service account. The message will look like: `You need to grant the following roles to the build service account to deploy a function: roles/cloudbuild.builds.builder to -compute@developer.gserviceaccount.com.` 5. Click **Grant** to provide the required permissions and deploy the example cloud function. Once deployed, you can delete this function if you wish. With the required permissions granted, you should now be able to deploy cloud functions from FlutterFlow Studio without any further issues.
I am getting Cloud Function Deployment Errors ![The Deploy Cloud Function dialog, which shows the deployment status of this function and all functions.](https://docs.flutterflow.io/assets/images/img_10-light-eed4785b0792daa81df8c63c875dcfd1.png)

If you encounter deployment errors, it may be helpful to check out [this community post](https://community.flutterflow.io/discussions/post/how-to-fix-cloud-function-deployment-errors-all-solutions-discussion-wgfMLgpLrBlmnUI) for possible solutions and insights.
Why am I getting a CORS error when executing my Cloud Function?

The CORS error occurs because the **Access-Control-Allow-Origin** header is missing from the response, preventing your request from being completed. This issue can arise with new Cloud Functions, whether deployed through FlutterFlow Studio or not. Follow the steps below to fix the issue: 1. Open your Google Cloud Project's [**Cloud Functions List**](https://console.cloud.google.com/functions/list) 2. Select the function causing the issue. 3. Navigate to the **Permissions** tab. 4. Open the **VIEW BY ROLES** tab. 5. Ensure there's a row with `Cloud Functions Invoker` with principal set to `allUsers`. If it’s missing, click on the **Grant Access**, add `allUsers` with the `Cloud Functions Invoker` role. ![add-cf-invoker-role](https://docs.flutterflow.io/assets/images/add-cf-invoker-role-f06288f87aa8e929db35770df5aa1eb9.avif)

## Supabase Edge Functions [**Supabase Edge Functions**](https://supabase.com/docs/guides/functions) let you run secure backend logic using Deno and TypeScript directly on Supabase infrastructure. They are ideal for AI integrations, secure API wrappers, webhooks, payments, and server-side processing. Unlike Firebase Cloud Functions, Supabase Edge Functions are tightly integrated with your Supabase project and run closer to users for lower latency. :::note[Prerequisite] Before using Supabase Edge Functions, make sure your FlutterFlow Studio project is connected to Supabase. See the [**Supabase Setup**](https://docs.flutterflow.io/integrations/supabase/setup#connect-with-supabase-oauth) guide. ::: ### Adding Edge Functions Let's see how to add an Edge Function by building an example that generates an AI summary of product reviews. The Edge Function takes a list of reviews as input, sends them to an AI model, and returns a JSON response containing a summary and overall sentiment. This example demonstrates a key benefit of Edge Functions: securely storing API key on the Supabase backend instead of exposing it inside the app. Here's how it looks:

**1. Create and Deploy Edge Functions** 1. Open the **Cloud Functions** section from the Navigation Menu. 2. Click the **+** button and select **Supabase Edge Function**. 3. Give the Edge Function a name. In this example, we use `getAIReviewsSummary`. 4. Configure the function settings. In this example, the function accepts a list of reviews as input and returns a JSON response containing the AI-generated summary and sentiment. You can also configure additional settings: - **Verify JWT**: Verifies the JWT token from the request header. Disable this if you want to allow unauthenticated access. - **Enable CORS**: Automatically adds CORS headers and preflight request handling. Required when calling the Edge Function from web apps. - **Return Value**: Defines the response type returned by the function. - **Define Parameters**: Configure the request body parameters accepted by the function. 5. Click the code-generation button to generate and copy the boilerplate code into the editor. Copy the boilerplate code and use any AI assistant to generate the implementation for your specific use case. For example, you can ask the AI assistant to complete the function for generating AI-powered review summaries using the Anthropic API. Review the generated implementation and verify it matches your expected logic and response format. 6. Paste the generated code back into the Edge Function editor. 7. Click **Save Edge Function**. 8. Once saved, click **Deploy**. 9. FlutterFlow Studio will show a deployment dialog listing the available Supabase Edge Functions for deployment. 10. Click **Deploy** for the selected Edge Function to deploy it to your connected Supabase project.

:::tip[Optional - Add Package] You can also add external Deno, npm, or JSR packages using the `Dependencies (deno.json)` tab if your Edge Function requires additional libraries or SDKs. For example, to add the `lodash` npm package: ```json { "imports": { "lodash": "npm:lodash@4.17.21" } } ``` You can then use it inside your Edge Function: ```jsx ``` ![The Dependencies (deno.json) tab of an Edge Function with the lodash package added.](https://docs.flutterflow.io/assets/images/add-packge-edge-function-light-151525bba1aff52d862472ea5b64da45.png) ::: **2. Handling Secrets** When your Edge Function needs credentials, API keys, or tokens, do not hardcode them in the function code. Store them as Supabase Edge Function secrets so they remain encrypted and are not exposed in your app or repository. To add a secret, open your Supabase project, go to **Edge Functions > Secrets**, enter the secret name and value, then click **Save**. For example, you can add an any API key as: ``` ANTHROPIC_KEY=your-api-key ``` Then reference it inside your Edge Function using `Deno.env.get()`: ```tsx const apiKey = Deno.env.get("ANTHROPIC_KEY") if (!apiKey) { return new Response("Missing ANTHROPIC_KEY", { status: 500, headers: { ...corsHeaders, "Content-Type": "text/plain" }, }) } ``` ![The getAIReviewsSummary Edge Function reading the ANTHROPIC_KEY secret with Deno.env.get.](https://docs.flutterflow.io/assets/images/edge-functions-handle-secrets-light-3706f80e103490004aaf7447fa8c7f1f.png) This keeps sensitive values on the Supabase backend while allowing your function to securely use them at runtime. **3. Trigger Edge Functions and Use Result** Once the Edge Function is deployed, you can trigger it from an action in your app. For example, on a button tap or page load, add the **Edge Function** action and select the function you created. Pass the required input parameters, such as the list of reviews. ![The Action Flow Editor with an Edge Function action that calls getAIReviewsSummary and stores its result as edgeFunctionOutput.](https://docs.flutterflow.io/assets/images/trigger-edge-function-light-d2e5a84b2076ba9cfc0b1d9901b667bf.png) If the function returns a value, provide an **Action Output Variable Name** while configuring the action. You can then use the returned data from: **Set from Variable > Action Outputs > [Action Output Variable Name]** For this example, you can use the returned JSON values, such as `summary` and `sentiment`, to update page state variables or display the AI-generated review summary directly in your UI. ![A Show Snack Bar action whose message is set from the edgeFunctionOutput action output.](https://docs.flutterflow.io/assets/images/use-edge-function-result-light-d96bce2f480e5e0aa3f117ab9d169203.png) # FlutterFlow Studio Visual Studio Extension > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/custom-code/vscode-extension Learn how to leverage the Visual Studio Code Extension to write custom code. The **Visual Studio Code (VSCode) extension** allows you to work with your FlutterFlow Studio project’s custom code directly in [Visual Studio Code](https://code.visualstudio.com/) (a local code editor). This extension facilitates easy editing, pushing, and pulling of custom code changes between FlutterFlow Studio and your local development environment. While you can edit custom code inside FlutterFlow Studio's in-app code editor, editing the code in Visual Studio Code may be preferable for a few reasons: 1. **Access to the Entire Codebase**: When writing custom code in Visual Studio Code, you'll have full access to your app's entire codebase, making it easier to reference component widget classes, custom data types, enums, and more. 2. **Real-time Autocomplete and Error Detection**: Working on a local machine typically provides more reliable access to real-time error detection and autocomplete features within the code editor, which can make your development process more efficient. 3. **Leverage Flutter & Dart Tooling**: Using Visual Studio Code allows you to take advantage of existing Flutter and Dart tools, making it easier to develop and refactor your custom code. 4. **Leverage the AI Ecosystem**: Additionally, you can easily utilize AI tools available in the Visual Studio ecosystem, such as Copilot. :::note The VS Code extension is only available on the Growth plan and higher. Check out our [**pricing**](https://www.flutterflow.io/pricing) section. ::: ## Installation To fully leverage the Flutter, Dart, and AI tools in Visual Studio Code while editing your FlutterFlow Studio custom code files, you can install the **FlutterFlow Studio: Custom Code Editor** extension. Here are a few easy methods to set it up. ### Install from Marketplace You can install the FlutterFlow Studio extension from the [Visual Studio Code marketplace](https://marketplace.visualstudio.com/items?itemName=FlutterFlow.flutterflow-custom-code-editor&ssr=false#overview) site. To install the extension directly from Visual Studio Code, open the editor, click on the **Extensions** icon (or press `Ctrl + Shift + X` / `Cmd + Shift + X`), search for "**FlutterFlow Studio: Custom Code Editor**," and click **Install** to add the extension to your workspace.

### Add API Keys To use the extension, you must set your **API key** in the editor's **Extension Settings**. You can generate an API key from the [FlutterFlow Studio account page](https://app.flutterflow.io/account) and then add it to the extension settings page in Visual Studio Code. Here’s exactly how you do it:

:::tip You can configure optional settings such as specifying the **Project ID** and **Branch** to pull and update code from. Additionally, you can set a **Download Location** to determine the initial directory where the code will be downloaded. ::: ### Downloading Code The first step in editing custom code for your FlutterFlow Studio project is to download its code. To download the code for your project, use the Visual Studio Code command palette (`cmd` + `shift` + `p` or `ctrl` + `shift` + `p`). In the command palette, you can use the `FlutterFlow: Download Code` command. This command will prompt you for three pieces of information: - **Project ID**: This is the Project ID, or unique identifier, for your FlutterFlow Studio project. You can find the Project ID by hovering over the Project Name in the top left corner inside the FlutterFlow Studio builder. - **Branch Name:** The name of the FlutterFlow Studio project branch you want to work on. You can leave this blank to work on the main branch. - **Download Location:** A file picker will be presented for you to choose where to download your project code, the code will be downloaded to `thisdirectory`/`projectID`.

### Initializing a Code Editing Session After the code has been downloaded, you will need to initiate a **Code Editing** session using the extension. When a Code Editing session has been initiated, you’ll be able to pull and push code from Visual Studio Code to FlutterFlow Studio. ![extension-overview.png](https://docs.flutterflow.io/assets/images/extension-overview-4b40b34eeb52ddca5cde6f841672c3b1.png) To start a Code Editing session, run the command `FlutterFlow: Start Code Editing Session` from the Visual Studio Code Command Palette. This command will also automatically run `flutter pub get`. ![start-code-edit-session](https://docs.flutterflow.io/assets/images/start-code-edit-session-d3935aed9630b1f8d37de438187e6885.png) :::tip[Editing Flutter & Dart Files] It’s recommended that you install the [**Flutter & Dart Extensions**](https://docs.flutter.dev/tools/vs-code) which will make it easier to edit Flutter and Dart code. ::: ## Editing Custom Code After successfully [installing](#installation) the Visual Studio Code extension and [downloading the code](#downloading-code), you can [initialize your session](#initializing-a-code-editing-session) to start adding or editing custom code. Currently, the following resources are available for customization: - **Custom Actions** - **Custom Widgets** - **Custom Functions** - **Package Dependencies** in `pubspec.yaml` ### Testing Changes Locally When working with custom code, it's important to test your implementations. We recommend integrating your Custom Function, Action, or Widget directly within your FlutterFlow Studio project—for example, by adding the Custom Widget to a FlutterFlow Studio Page. You can then choose to test your app from FlutterFlow Studio, using a [Test Mode session](https://docs.flutterflow.io/testing/run-your-app/#test-mode) or [Local Run](https://docs.flutterflow.io/testing/local-run), or run your app locally from Visual Studio Code. Before testing from FlutterFlow Studio, ensure you’ve [pushed your changes](#push-changes-to-flutterflow-studio). To run your project from Visual Studio Code, make sure the Flutter extension is installed. Once set up, you can simply click the Run (play) button. For further details, refer to [Flutter’s official documentation](https://docs.flutter.dev/tools/vs-code#running-and-debugging). ### Push Changes to FlutterFlow Studio To make your custom code available in FlutterFlow Studio, you need to push your changes. When you push changes, all the files you've edited in Visual Studio Code will be updated in FlutterFlow Studio. You can see which files have been changed in the **FF: Modified Files section** of the Explorer. This section updates whenever you save a file, showing what has been added, removed, or changed. ![see-modified-files.png](https://docs.flutterflow.io/assets/images/see-modified-files-e757b1b1addfaa784e09bb0bfe13b165.png) To push changes click the `Push to FlutterFlow` status bar icon, or run the `FlutterFlow: Push to FlutterFlow` command in the command palette. ![push.png](https://docs.flutterflow.io/assets/images/push-9d5f3bd9f958610077043871896911dc.png) :::caution This action can’t be undone. Make sure you don’t overwrite any changes in FlutterFlow Studio that you want to keep. To avoid this, pull the latest changes from FlutterFlow Studio before editing in Visual Studio Code, and push your updates once you're done. ::: ### Pull Latest Changes from FlutterFlow Studio Before editing any custom files, it's important to pull the latest changes from FlutterFlow Studio into your local repository. This ensures you have the most up-to-date components, app state variables, and custom data types/enums that you might need to reference in your custom code. To pull the latest changes, click the `Pull Latest` icon in the lower status bar, or run the `FlutterFlow: Pull Latest Changes` command. ![pull.png](https://docs.flutterflow.io/assets/images/pull-e10f259ab4ecab254938ff5b84bfee72.png) :::caution Pulling changes will also overwrite any local modifications made in the code editor. ::: ## Updating Files The VSCode Extension allows you to update **custom code resources**, including entire files or specific Dart/Flutter functions. For Custom Actions and Custom Widgets, there’s a one-to-one relationship between each action/widget and its corresponding file. If you create a new file in the `lib/custom_code/actions` or `lib/custom_code/widgets` directory, it will automatically add a new action or widget to your FlutterFlow Studio project. For Custom Functions, all functions are contained within a single file: `lib/flutter_flow/custom_functions.dart`. You can add, edit, or delete custom functions directly within this file. For Package Dependencies, you can [add new dependencies](#adding-new-dependencies) in the `pubspec.yaml` file, but you cannot modify the existing ones. When you add a new dependency, it will appear in **Settings and Integrations > Project Dependencies > Custom Code Dependencies** section. ![custom-code-dependencies](https://docs.flutterflow.io/assets/images/custom-code-dependencies-fbaf0813d74afe6e76c14ecfc1093e83.png) ### Renaming Files To rename Custom Actions or Custom Widget, use the Visual Studio Code rename symbol functionality. Simply, right-click the name of a Custom Action or Widget and select **Rename Symbol**, then type the new name. If you change the name without doing this, you’ll need to update the name in the file where the Widget or Action is defined, as well as the index file that exports the Widget (`lib/custom_code/widgets/index.dart`) or Action (`lib/custom_code/actions/index.dart`). ### Creating New Resource To add a new Custom Action or Widget, create a new Dart file in the `lib/custom_code/widgets` or `lib/custom_code/actions` directory and the boilerplate should appear within the new file. To add a new Custom Function, simply create a new Dart function in the `lib/flutter_flow/custom_functions.dart` file. We do not have automatic support for Custom Function boilerplate code in Visual Studio Code at this time. ### Deleting Files To delete a Custom Action or Widget, delete the associated file. ### Adding New Dependencies You can add custom [pub.dev](https://pub.dev/) package dependencies with the `Dart: Add Dependency` command from the Visual Studio Code command palette. This will update the `pubspec.yaml` file. ## Using Flutter Version Management (FVM) If you want to manage Flutter versions with [**Flutter Version Management (FVM)**](https://fvm.app/), you need to install it and add it to your system’s PATH. Follow these steps to get started: ### Install FVM To install **FVM**, run the following command in your terminal. This installs FVM globally using Dart’s package manager. ``` dart pub global activate fvm ``` ### Add FVM to Your System’s PATH After installation, you need to add the directory containing FVM’s executables to your **PATH variable** so that it can be accessed globally. #### For macOS & Linux 1. Open the Terminal and run the following command. It adds the `~/.pub-cache/bin` directory to your system's `PATH` permanently by updating your `~/.zshrc` file. This ensures that the FVM installed in `~/.pub-cache/bin` is accessible from anywhere in the terminal. ```bash echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> ~/.zshrc # For Zsh echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> ~/.bashrc # For Bash ``` 2. Restart your terminal or run `source ~/.zshrc` (or `source ~/.bashrc`) to apply the changes. #### For Windows 1. Locate the **FVM executable path**, typically: ``` C:\Users\YourUsername\AppData\Local\Pub\Cache\bin ``` 2. Add this path to your **System’s PATH variable**: 1. Open **System Properties** → **Advanced system settings**. 2. Click **Environment Variables**. 3. Under **System variables**, select **Path** → **Edit**. 4. Click **New** and add the above path. 5. Click **OK** and restart your terminal. ### Verify the Installation To check if FVM is correctly installed and accessible, run: ```bash fvm --version ``` If this command prints the installed version of FVM, it means FVM is successfully installed and added to PATH. ### Configure FVM in Your Flutter Project Once FVM is installed, navigate to your Flutter project folder and set up FVM: ```bash cd your-flutterflow-project fvm init fvm install fvm use ``` *(Replace `` with the required Flutter version.)* ## FAQs
How do I download code from the Beta or Enterprise version of FlutterFlow Studio?

If you're using a different version of FlutterFlow Studio, such as *Beta* or *Enterprise*, you can override the URL by modifying the **Extension Settings > settings.json** file. For example: - For the **Beta** version, set the `flutterflow.urlOverride` value to `https://api-beta.flutterflow.io/v1`. - For the **Enterprise** version, set the `flutterflow.urlOverride` value to `https://api-enterprise-[region].flutterflow.io/v1` (replace [region] with your specific region).

# Animations > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/animations Learn the basics of animations in FlutterFlow Studio. Enhancing your app with animations significantly improves the user experience, making it more engaging and intuitive. In FlutterFlow Studio, you have several options to add animations to your app: - [**Widget Animations**](https://docs.flutterflow.io/concepts/animations/widget-animations): Add animation effects to an entire widget. - [**Implicit Animations**](https://docs.flutterflow.io/concepts/animations/implicit): Animate changes in specific widget properties, such as the height of a Container. - [**Hero Animations**](https://docs.flutterflow.io/concepts/animations/hero-animations): Animate a widget that transitions smoothly between screens, also known as shared element transitions. - [**Page Transition Animations**](https://docs.flutterflow.io/concepts/animations/page-transition): Specify transitions between pages within your app. - **Import Animations**: Import animations you've created using other tools such [lottiefiles](https://docs.flutterflow.io/concepts/animations/lottie-animation) and [Rive](https://docs.flutterflow.io/concepts/animations/rive-animation). - [**Shaders**](https://docs.flutterflow.io/concepts/animations/shaders): Add GPU-powered visual effects like animated backgrounds, distortions, and interactive touch-based visuals to enhance your UI. To learn more about animations in FlutterFlow Studio, check out this video:
# Widget Animations > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/animations/widget-animations Learn how to add widget animations in FlutterFlow Studio. Widget animations allow you to add animation effects at the widget level. To add an animation to a widget, you'll need to go to the property panel for the widget and select the animations tab.
![The Animations tab of a Text widget's properties panel, with an On Page Load Fade animation and its curve, duration, delay, and opacity settings.](https://docs.flutterflow.io/assets/images/animations_overview-2-light-a75b222232952563ab3d2772f03960ba.png)
Animation Overview
## Animation effects & properties FlutterFlow Studio supports a variety of animation effects and properties for widget animations. Most animations have core properties you can edit, like the `Duration`, which specifies how long the animation should run for, and the `Delay`, which specifies what delay the animation should have before it starts to run. In addition, there are animation-specific properties that usually have both a start and end value, which are mentioned in the table below. | Effect | Description |
Example
| Effect-Specific properties | ----- | ----- | ----- | ----- | | **Fade** | Makes the widget gradually appear or disappear. It's widely used for smooth introductions of elements on the screen and to focus user attention by fading in or out content or UI elements.| Alt text for your GIF| `Opacity`: the starting or ending visibility of the widget, where 0 is fully transparent and 1 is fully visible| | **Slide** | Changes the widget's position on the screen. Typically used to introduce widget in a dynamic, visually engaging way, like sliding in menus, pages, or notifications. FlutterFlow Studio supports both vertical and horizontal slide. | Alt text for your GIF | `Position`: where 0 specifies the widget's current position, -100 specifies 100px to the left (horizontal) or down (vertical), and 100 specifies 100px to the right (horizontal) or up (vertical).



*To make the widget come and go off the screen, make the start and/or final position greater than the width of the device.* | | **Scale** | Changes the size of the widget. Often used to draw attention to UI components, like magnifying buttons on hover or animating dialog boxes to appear from a central point. |Alt text for your GIF|`Scale`: the starting or ending multiple to scale the widget horizontally (X) or vertically (Y), where 1 represents the current size of the widget. | | **Rotate** | Turns the widget clockwise or anticlockwise. It's often used for simple effects like spinning a loading icon.| Alt text for your GIF | `Turns`: specifies the number of 360 degree rotations. | | **Shake** | Creates the shake effect on a widget. Often used to draw attention to an element or indicate an error, like when a user enters incorrect information in a form field.| Alt text for your GIF|`Frequency`: Number of shakes per second



`Offset`: Shake distance, a higher value intensifies and a negative value shakes the opposite direction



`Rotation Angle`: Angle of the shake| | **Blur** | Creates a focus or un-focus effect on a widget | Alt text for your GIF | `Radius (X or Y)`: Size of the blur.



*To create an unfocus effect, `Final Radius` should be greater than `Initial Radius`. To create a focus effect, `Initial Radius` should be greater than `Final Radius`*. | | **Saturate** | Used to enhance visual appeal by making colors more vibrant for focused content or creating a muted effect for background elements. |Alt text for your GIF | `Strength`: 0 indicates fully desaturated, 100 represents normal saturation and >100 represents the percent saturation | | **Tilt** | Creates a transforming effect (3D perspective) on your widget. Typically used to add a subtle interactive element to UI components, like buttons or cards, indicating user interaction or focus. | Alt text for your GIF | `Tilt`: The angle at which the widget is viewed. | | **Flip** | Flip animation rotates an element around its horizontal or vertical axis, creating a mirror effect. It's often used for flipping cards in a UI to reveal hidden information. | Alt text for your GIF | `Flip`: The angle at which the widget is viewed. | | **Shimmer** | Creates a "shiny" effect moving across the screen, often used to signify that data or content is in the process of loading or being fetched.



**Note** that this animation doesn't run on the Test mode. | Alt text for your GIF | `Color`: The color of the "shiny" line or gradient that sweeps of the widget. A common practice is to use a slightly lighter shade than the content.



`Angle`: Determines the direction of the shimmer effect across the content. 0 degrees for horizontal and 90 for vertical. | | **Tint** | Adds a color overlay effect to your content. |Alt text for your GIF | `Color`: Color of the overlay.



`Strength`: Intensity of the tint. | ## Animation curves When applying an animation, you'll also be able to specify the curve. An animation curve is essentially a mathematical formula used to interpolate values over time. Changing the animation curve allows you to control the speed and style of the animation. Alt text for your GIF



FlutterFlow Studio supports a variety of animation curves: | Curve | Description | ----- | ----- | | **Ease In** | Starts the animation slowly and then accelerates towards the end. It's useful for creating an effect where the motion begins gently and speeds up.| | **Ease In Out** | Starts the animation slowly, accelerates in the middle, and then decelerates towards the end. It's ideal for creating smooth, natural-looking animations that don't have abrupt starts or stops.| | **Ease Out** | Begins the animation quickly and then slows down towards the end. It gives the effect of a rapid start that gently comes to a stop.| | **Bounce** | Adds a bouncing effect at the end of the animation. The animated object overshoots its final position and then bounces back, mimicking the physical behavior of a bouncing ball.| | **Elastic** | Creates an elastic effect where the animation overshoots its target value and oscillates before settling. It's useful for animations that need a springy, elastic feel.| | **Linear** | Progresses at a constant speed throughout the animation. It provides a uniform transition from start to end, with no acceleration or deceleration.| ## Animation on Page Load There are many cases when you might want to trigger an animation when a page or (in the case of a delayed load) widget is loaded onto the screen. Consider an eCommerce use case, where a backend query is used to retrieve a list of trending products. There may be some delay between when the page is first loaded and when the actual results are displayed. To improve the user experience we can add some animations to let users know when content is loading. A widget that first shows a container with a shimmer effect, then fades in a widget displaying the product details To create an experience like this, you need to add a shimmer animation to a widget, and display that widget conditionally (i.e. when the query is loading). Here's how you do it:

## Animation on Action Trigger Beyond triggering widget animations on load, you can trigger an animation to occur as part of an action. For example, say you want a like button to be animated when a user clicks it. Here's how you do it:

:::note You can give a name to the widget that you want to animate using the action, this will make it easier to find in the action menu. ::: ## Applying multiple animations You can apply multiple animations to a single widget. By default, when you add multiple animations, they are executed in a series (one after another) creating staggered animation. However, you can define to run all animations at the same time. ### Run multiple animations simultaneously If you want to run multiple animations together for the same amount of time (e.g., slide and scale widget at the same time), enable the **Apply same duration & delay** while adding animation. ### Create staggered animation A staggered animation is multiple animations executed subsequently. Adding staggered animations can help you create a stunning visual effect. To create staggered animation, ensure you **disable** the **Apply same duration & delay** option and keep adding animations. The delay property will be auto adjusted based on the duration of all previously added animations. :::tip For manually controlling the staggered animation, set the delay for your new animation based on the total duration of all previously added animations. For instance, if the first two animations each last 1000ms (1 second), the delay for the third animation should be 2000ms (2 seconds). This ensures the third animation begins only after the completion of the first two, each lasting 1 second. ::: Here's an example of creating a staggered animation:

## Setting animation values from variables You can set animation values dynamically using the variables of your app. This flexibility allows you to create more sophisticated animations. Let's see an example of creating a beautiful animation where a list of items is sliding in from left to right. Here's how it looks: ![Setting animation values from variables](https://docs.flutterflow.io/assets/images/set-animations-from-variable-b784248823cbf3da590d2ca5a5bb8922.gif) If you notice carefully, the items appear in a staggered fashion. This can be achieved by setting the delay value of each item based on its position (index) in the list. Here's how exactly you do it: Select the item in the list and add the Slide animation. In the Delay property, open the variable menu and add a [inline function](https://docs.flutterflow.io/resources/functions/utility#inline-function-code-expressions) to calculate the delay value based on the item's index. For this example, we use the formula `[index] * 100`, where `index` represents the position of the item, and `100` is the delay in milliseconds. This means the first item will slide in after 100 ms, the second after 200 ms, and so on, creating a staggered animation effect.

# Implicit Animations > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/animations/implicit Learn how to add implicit animations in FlutterFlow Studio. In Implicit Animation, the widget automatically animates to a new property's value when they are updated. For example, the container widget animates whenever you change its size and colors. :::note Implicit Animation is recommended only when you want to run the animation once (after the properties are changed). ::: Here are some examples of how it looks when you update the widget properties with and without Implicit Animation. | | Without Implicit Animation | With Implicit Animation | | --- | --- | --- | | **Container** | ![Without Implicit Animation](https://docs.flutterflow.io/assets/images/without-implicit-animation-e6592770149d9db9e86d1e9b0b0d4d93.gif) | ![With Implicit Animation](https://docs.flutterflow.io/assets/images/with-implicit-animation-124cc1e1c70135504c7be7675ad78ef9.gif) | | **Text** | ![Without Implicit Animation](https://docs.flutterflow.io/assets/images/without-implicit-animation-text-b58f28715f01ad899d063ee8d1cbb9c9.gif) | ![Wit Implicit Animation](https://docs.flutterflow.io/assets/images/with-implicit-animation-text-6b252df96edd2f6806e62c49904fea2d.gif) | Here's an example of how you add the Implicit Animation on Container widget:

# Hero Animation > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/animations/hero-animations Learn how to add Hero Animations in your FlutterFlow Studio app. "Hero" is a widget that gracefully transitions from one screen to another. For instance, on a product listing page, clicking on a product's image triggers a smooth animation where the image flies to a new screen, revealing detailed information about the product. ## Creating Hero Animation Let's how to create hero animation with an example that looks like the one below: ![hero-animation-image-widget.gif](https://docs.flutterflow.io/assets/images/hero-animation-image-widget-5338d8ec61a3451fc894306e233fe913.gif) :::note Building Hero Animation requires you to have at least two pages that share the same image. ::: The steps to build such an example are as follows: 1. On the first page, select the image, head over to the properties panel, enable **Use Hero Animation**, and **Add Hero Tag**.

2. On the second page, select the image, head over to the properties panel, enable **Use Hero Animation**, and select the **Hero Tag** that you created on the first page component.

3. Add [navigation action](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action) from page 1 to page 2. ## Hero Animation on Component You can also add hero animation on a custom component. Let's see how to build an example that looks like the one below:

Before you begin, - Make sure you have a component added to both the first and second pages. - For a smoother and more appealing hero animation effect, ensure that the components on both pages have a somewhat similar appearance. This enhances the overall visual impact of the animation. The steps to add hero animation on a component are as follows: 1. On the first page, select a component, head over to the properties panel, enable **Use Hero Animation**, and **Add Hero Tag**.

2. On the second page, select a component, head over to the properties panel, enable **Use Hero Animation**, and select the **Hero Tag** that you created on the first page component.

3. Add [navigation action](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action) from page 1 to page 2. ## FAQs
Why is the Hero animation not working when navigating forward? Works only backward

This is because the image on the second page does not exist on the very first frame. Hero animation will only work when the image is loaded from an asset or from the network (*if the path is pre-specified*). If you're pulling the image from a Firestore document, it might not be ready in time for the animation to take place. To fix this issue, you can avoid loading an image directly from Firestore. Instead, you can pass the image URL (which would have already been retrieved from the Firestore) from the previous page to the second page. And then use that URL to load the image. See how to [pass data](https://docs.flutterflow.io/concepts/navigation/passing-data) from one page to another.

# Page Transition Animations > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/animations/page-transition Learn how to add page transition animations in your FlutterFlow Studio app. The animation that plays while transitioning from one page of the app to another is known as a page transition. In FlutterFlow Studio, you can customize this animation to enhance the user experience. You can choose from any of the following transition animations: :::note Here, the transitions are recorded with the duration set to 1000ms to make the animation clearly visible. But inside the app, it's recommended to keep the duration between 200-400ms. ::: | Transition Type | Description | Example | |-----------------|------------------------------------------------|---------------------------| | Instant | Transition with no animation, switching pages immediately. | ![Instant](https://docs.flutterflow.io/assets/images/instant-page-transitions-d5095a438999fcd33a1b56cac8ade15f.gif) | | Fade In | Gradually fades the new page into view. | ![Fade In](https://docs.flutterflow.io/assets/images/fade-page-transitions-5be1eead82c6344067a70a9f457eb6fb.gif) | | Slide Up | Slides the new page up from the bottom. | ![Slide Up](https://docs.flutterflow.io/assets/images/slide-up-page-transition-786f1cc3a74cbcc6d84f262442985430.gif) | | Slide Down | Slides the new page down from the top. | ![Slide Down](https://docs.flutterflow.io/assets/images/slide-down-page-transition-3d3e86f4d15106129d0484cb9c7f8214.gif) | | Slide Left | Slides the new page in from the right. | ![Slide Left](https://docs.flutterflow.io/assets/images/slide-left-page-transition-94ae7fb43d636201d54b16a38d6638cf.gif) | | Slide Right | Slides the new page in from the left. | ![Slide Right](https://docs.flutterflow.io/assets/images/slide-right-page-transition-aee5a5a584ef005c7c434cefd4a4cd21.gif) | | Scale | Scales the new page in from a smaller size to full screen. | ![Scale](https://docs.flutterflow.io/assets/images/scale-page-transitions-e146d5c73ecde74e57c87c2cf7ecabb7.gif) | ## Animate single navigate transition To set a transition animation for a single navigate action, first, ensure that you have added a [**Navigate To**](https://docs.flutterflow.io/concepts/navigation/page-navigation#navigate-to-action) action and then select an animation from the **Transition Type** dropdown. By default, the animations use 300 milliseconds as the duration for which it plays but you can change it by specifying a value inside the **Duration** (ms) field. ![A Navigate To action with Transition Type set to Scale and Duration set to 300 ms.](https://docs.flutterflow.io/assets/images/single-navigate-transition-animation-light-601588a25737c8daf89d55a3a4be6308.png) ## Change global navigate transition To change the default transition animation of your entire app, follow the steps below:

# Lottie Animation > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/animations/lottie-animation Learn how to add Lottie animation in your FlutterFlow Studio app. The LottieAnimation widget allows you to display [Lottie files](https://lottiefiles.com/featured) from uploaded assets or the URL link. Lottie files are high quality (they do not pixelate), smaller than GIF, and easy to add to any platform. For example, you could use the LottieAnimation widget to show a nicely animated loading indicator to provide a great user experience to the users.

## Adding LottieAnimation Showing Lottie files in a LottieAnimation widget comprises the following steps: 1. [Getting Lottie files](#1-getting-lottie-files) 2. [Adding LottieAnimation widget](#2-adding-lottieanimation-widget) 3. [Changing animation source](#3-changing-animation-source) ### 1. Getting Lottie files The LottieAnimation requires the Lottie file to be added to display the animation on the screen. You can get the Lottie files from its [official collection](https://lottiefiles.com/featured) in two ways. #### 1.1 Downloading the Lottie JSON file The Lottie JSON file is required when you want to play the animation from the file uploaded to your project. To download the Lottie JSON file: 1. Open https://lottiefiles.com/ and search for the required animation. 2. Select the animation you would like to add. This will open a new popup. 3. Click on the **Download** button and select **Lottie JSON**.

#### 1.2 Copying Lottie animation URL The Lottie animation URL is required when you want to play the animation from the file hosted at https://lottiefiles.com/. To copy the animation URL: 1. Open https://lottiefiles.com/ and search for the required animation. 2. Select the animation you would like to add. This will open a new popup. 3. Find the **Lottie Animation URL** (bottom right of the playing animation) and copy it. :::note The Lottie animation URL is only visible when you are logged in. :::

### 2. Adding LottieAnimation widget To add LottieAnimation widget to your project: 1. Drag the **LottieAnimation** widget from the **Base Elements** tab (in the Widget Panel) or add it directly from the widget tree. 2. Move to the properties panel (on the right side of your screen) and scroll down to the **Lottie Animation** section. 3. Find the **Path** property and enter the **URL** (see how to get it [1.2](#12-copying-lottie-animation-url)) for the new Lottie file. 4. By default, the animation will play as soon as the page loads. To disable this and play animation on a button click or any other event, uncheck the **Auto Animate** checkbox.

### 3. Changing animation source By default, the widget's animation source is set to network. However, you can change this to use a Lottie file uploaded directly to your app. Here's how you can change the animation source: 1. Select the **LottieAnimation** widget from the widget tree or the canvas area. 2. Move to the property panel (on the right side of your screen) and scroll down to the **Lottie Animation** section. 3. Find the **Animation Source** dropdown and select . 4. Now, find the **Asset Animation** property, click the **Upload LottieAnimation** button, select the Lottie file and upload it.

## Customizing You can customize the appearance and behavior of this widget using the various properties available under the properties panel. ### Changing animation type You can control how the animation is played, whether it should play only once, in a loop, or in a boomerang fashion (play back and forth). To control the animation type: 1. Select the **LottieAnimation** widget from the widget tree or the canvas area. 2. Move to the property panel (on the right side of your screen) and scroll down to the **Lottie Animation** section. 3. Find the **Animation Type** dropdown and select among the **Once**, **Loop**, and **Boomerang**. **Open**

**Loop**

**Bomerang**

### Change frame rate By default, animations are played at the frame rate specified when they are exported from After Effects, usually at 10 or 30 FPS. Modern phones, however, can support higher refresh rates, such as 60 or 120 FPS. If you're not satisfied with how the animation looks at these default settings, you can adjust its frame rate to a smoother 60 FPS for better quality. To do so, move to the **properties panel** > **Lottie Animation** > enter the value in the **Frame Rate** field. ### Changing the box fit Changing the Box Fit value allows you to control how the Lottie file animation should display inside the LottieAnimation widget. Various options under the Box Fit property help you scale (grow or shrink in size) the Lottie file animation inside the LottieAnimation widget. To change the Box Fit value: 1. Select the **LottieAnimation** widget from the widget tree or the canvas area. 2. Move to the property panel (on the right side of your screen) and scroll down to the **Lottie Animation** section. 3. Find the **Box Fit** dropdown, try changing the value among the **Fill**, **Contain**, **Cover**, **Fit Width**, **Fit Height**, **None**, and **Scale Down**.

## Start/pause animation on button press You probably want to start or pause the animation when something happens in your app. For example, after saving the form, while data is loading, searching, etc. You can do this by triggering the Lottie Animation action. ### Adding Lottie Animation [Action] Go to your project page on FlutterFlow Studio and follow the steps below to define the Action to any widget. Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on the **+ Add Action**. 4. On the right side, search and select **Lottie Animation**. 5. **Choose Lottie Animation** from the dropdown. 6. Enable **Allow Play/Pause** if you want to start and pause the animation while the animation is running. **Note**: You can only access this setting if the **Auto Animate** property of the LottieAnimation widget is unchecked. **Note** that this option is only available if you have set the [animation type](#changing-animation-type) to either Loop or Boomerang.

# Rive Animation > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/animations/rive-animation Learn how to add Rive animation in your FlutterFlow Studio app. [Rive](https://rive.app/) is a real-time interactive design and animation tool. Using the **RiveAnimation** widget you can easily import your Rive assets to FlutterFlow Studio and use them inside your app.

## Designing Animation You can create an animation from scratch by using [Rive Editor](https://editor.rive.app/). 1. Click **+ New File**. 2. Specify the **Artboard dimensions** (Width and Height). 3. Click **Create**. Use the Rive [design tools](https://help.rive.app/editor/fundamentals/shapes-and-paths) or import image files to start designing your animation. Once your design is ready you can use the [Timeline](https://help.rive.app/editor/animate-mode/timeline) and use keying to easily animate your design. :::note You should have at least one [**Artboard**](https://help.rive.app/editor/fundamentals/artboards) inside your Rive file but you can add an infinite amount of Artboards. ::: After you have completed designing your animation, you can either download it as an asset (having `.riv` extension) or you can share it with others by publishing it to the Rive community. To download the Rive file, click the **Export icon** (top-left corner of the Rive toolbar), and select **Download -> For newest runtime**. To publish the file to the community, click the **Export icon** (top-left corner of the Rive toolbar), and select **Publish to Community**. Give a **title** and **description** to your animation and click **Publish to Community**. :::caution For using a Rive animation file inside FlutterFlow Studio, you should either download or publish the file to the community. ::: Instead of creating an animation from scratch, you can also use any Rive asset shared in the [Community](https://rive.app/community/). ## Adding RiveAnimation widget Follow the steps below to use a Rive animation: 1. Drag and drop the **RiveAnimation** widget onto the canvas. 2. Select the **Animation Source** as either ***Network*** or ***Asset***. 3. If you have selected ***Network***, enter the **Path** (download URL) ****of the animation. Get the path by navigating to the Rive animation published in the community, right-click on the **Download** button and copy the link address. 4. If you have selected ***Asset***, 5. Choose an **Artboard** from the dropdown list. 6. Select the **Animations** that you want to use (these are imported from the Rive asset). After selecting one or more animation(s), you can use the **Preview Animations** button to play it. 7. The **Animation Type** is selected as ***Once*** by default. If the selected animations contain a loop or boomerang, you will have an option to select ***Continuous***. On choosing this option, if the animation contains a loop it will play continuously. 8. By default, the **Auto Animate** checkbox remains checked, which means that the animation will play as soon as the page loads. But if you want to use an Action to trigger the animation, uncheck this. 9. Specify the **Width** and **Height** of the RiveAnimation widget, and select a **Box Fit** type. 10. (Optional) If you plan to use an Action to trigger the animation, you can give an appropriate **Name** to this *RiveAnimation* widget for it to be easily identifiable.

## Control animation using action To trigger a RiveAnimation to start playing using an Action, you can use the **Rive** **Animation Action**. ### Adding Rive Animation [Action] Follow the steps below to define an action to start the animation: 1. Select the **widget** (eg., `Button`) on which you want to define the action. 2. Select **Actions** from the Properties Panel. 3. Click **+ Add Action** button. 4. Choose a gesture from the dropdown among **On Tap, On Double Tap,** or **On Long Press**. 5. Select the **Action Type** as ***Animation**.* 6. Set **Choose Animation Type** to ***Rive Animation***. 7. Under **Choose Rive Animation**, select the `RiveAnimation` widget (If you have given your `RiveAnimation` widget a name, that will be displayed here). :::note You should have the **Auto Animate** unchecked inside the properties of `RiveAnimation` widget to take advantage of this action. :::

# Shaders > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/animations/shaders Learn how to add visual effects using Shaders in your FlutterFlow Studio app. Shaders let you add rich visual effects to your app, such as animated gradients, ripple distortions, dissolve transitions, and interactive touch effects. Instead of using static images or simple color backgrounds, shaders generate visuals in real time using the device’s graphics processor (GPU). This makes it possible to create smooth animations and procedural textures that feel dynamic and alive.

## Shader Widgets FlutterFlow Studio provides two shader widgets, each designed for a different purpose. Choose the one that best matches how you want to apply the visual effect in your UI. ### ShaderFill The **ShaderFill** widget creates a standalone shader effect that fills a rectangular area. It does not contain any child widgets and works as its own visual element in the UI. This makes it ideal for decorative effects such as animated gradients, procedural textures, or dynamic backgrounds. You can control its size directly using the width and height properties. For example, you can use the **ShaderFill** widget to create a visually engaging animated gradient background for an onboarding or welcome screen.

### ShaderWrapper The **ShaderWrapper** widget applies a shader effect on top of an existing widget. Instead of rendering a standalone visual, it wraps a child widget and modifies how it appears on screen. This is useful when you want to add effects like ripples, burn transitions, or dissolve animations to elements such as images, containers, or other UI components. :::note The **ShaderWrapper** widget automatically takes the size of the child widget it contains. ::: For example, instead of abruptly removing a UI element, wrap it with a **Shader Wrapper** to apply a visual effect that gradually fades or distorts it, helping users understand that it’s being removed.

:::note Internally, it uses the [**material_palette**](https://github.com/FlutterFlow/material_palette) package, developed by the FlutterFlow team, to power the shader-based visual effects. ::: ## Shader Mode Every shader widget includes a **Shader Mode** setting that lets you choose how the shader is defined and applied. You can either use ready-made effects or bring your own custom shader. - **Preset:** Select from a library of built-in shader effects. Each preset includes adjustable parameters such as colors, speed, intensity, and more, allowing you to easily customize the look and behavior directly from the properties panel. - **Custom:** Upload your own `.frag` (fragment shader) file to create fully custom effects. You can define and control inputs using uniform values, which are exposed as sliders in FlutterFlow Studio. Custom shaders appear as a checkerboard placeholder in the builder, but render with full visuals in Test or Run mode. ## Preset Presets are ready-to-use shader effects that you can quickly apply and customize without writing any code. :::tip You can explore and try out all available [**presets here**](https://flutterflow.github.io/material_palette/). ::: ### ShaderFill Preset The following presets are available on the ShaderFill Widget: #### Gradient Presets Gradient presets combine color transitions with procedural noise to create rich, animated visuals. Each gradient type is available in both **linear** and **radial** variants, and all share a common set of customizable property groups for fine-tuning the look and motion via the properties panel. | Gradient Type | Description | Example | | --- | --- | --- | | **Gritty Gradient** | A rough, grainy gradient with a textured, stippled feel | ![gritty-gradient](https://docs.flutterflow.io/assets/images/gritty-gradient-14c58eb938728597cc1b26d3723c8b02.png) | | **Perlin Gradient** | Smooth, natural-looking noise blended into a gradient | ![sf1](https://docs.flutterflow.io/assets/images/sf1-9fb7639b827d7a94f77a25d0ccf220c9.gif) | | **Simplex Gradient** | Similar to Perlin, but sharper and more structured | ![sf2](https://docs.flutterflow.io/assets/images/sf2-966a7fc4582c95e032b5070be468e9f3.gif) | | **FBM Gradient** | Layered noise that creates soft, cloud-like detail | ![sf3](https://docs.flutterflow.io/assets/images/sf3-bef67b165968a47d13a52289e95a04f8.gif) | | **Turbulence Gradient** | A more chaotic, high-energy version of FBM | ![sf4](https://docs.flutterflow.io/assets/images/sf4-d441c1c9bcf9d12e5f9a80da37383eff.gif) | | **Voronoi Gradient** | Distinct cell-like patterns based on geometric regions | ![sf5](https://docs.flutterflow.io/assets/images/sf5-043116bd83cf98c7a7391b138b92c429.gif) | | **Voronoise Gradient** | A hybrid of cell structures and smooth noise | ![sf6-6](https://docs.flutterflow.io/assets/images/sf6-6-8f9a2f584995cc69b038e31f2a336e76.png) | #### Marble Smear Preset A procedural marble texture that reacts to user input. When **Interactive** is enabled, users can drag or touch the surface to smear and distort the marble pattern in real time, creating a fluid, organic visual effect. This is ideal for playful backgrounds, creative demos, or experiences where you want users to directly interact with the visuals.
![marble-smear](https://docs.flutterflow.io/assets/images/marble-smear-58e759fbd05ec8a25a0f62a145c1e2ed.png)
### ShaderWrapper Preset The following presets are available on the ShaderWrapper Widget: #### Ripple / Clickable Ripple Creates a wave-like distortion on the child widget, similar to water ripples. The standard ripple animates continuously, while the clickable version triggers ripples from the user’s tap location, adding responsive visual feedback to interactions.
![sw1](https://docs.flutterflow.io/assets/images/sw1-86591ece0c3e2d5d8c3c12574f4b6f88.gif)
#### Burn / Radial Burn / Tappable Burn A dramatic dissolve effect that makes the widget appear to burn away. It can progress in a direction, radiate from a center point, or originate from user taps, with glowing edges that resemble fire.
![sw11](https://docs.flutterflow.io/assets/images/sw11-4e9f73a298631ce32f6add6b5ebcc6bf.gif)
#### Smoke / Radial Smoke / Tappable Smoke A softer version of the burn effect, where the widget fades away like drifting smoke. It supports directional, radial, and tap-based variations for smooth and subtle transitions.
![sw3](https://docs.flutterflow.io/assets/images/sw3-a45497d51d0969943029318403127c32.gif)
#### Pixel Dissolve / Radial Pixel Dissolve / Tappable Pixel Dissolve Breaks the widget into pixel blocks that scatter and disappear. This effect works for directional, radial, or tap-based dissolves, making it ideal for stylized removal or transition animations.
![sw4](https://docs.flutterflow.io/assets/images/sw4-04badc7eec01957b703015c3d13b5ff8.gif)
#### Tappable Slurp A playful distortion effect that pulls the widget toward tap points, like a whirlpool. Each interaction creates a dynamic suction effect, adding a fun and interactive feel to the UI. ## Implicit Animated When [**Implicit Animated**](https://docs.flutterflow.io/concepts/animations/implicit) is enabled, changes to shader parameters (such as colors or slider values) animate smoothly instead of updating instantly. This is especially helpful when parameters are driven by app state, allowing for seamless transitions like gradually shifting gradient colors or intensities. ## Time Animation Behavior Time Animation Behavior controls how a shader animates over time. It defines whether the animation runs automatically, is controlled manually, or follows a custom timeline. ### Continuous (default) The shader animates automatically in a smooth, endless loop with no setup required. This is ideal for ambient effects like animated backgrounds, gradients, or subtle motion that should always be running. :::tip You can have the **Time Animation Behavior** set to **Continuous** while the widget is [**Implicit Animated**](#implicit-animated). This allows the animation to run continuously while still enabling you to control specific parameters when needed.

::: ### Implicit You control the shader’s animation manually using a **Time** slider [0–10]. This is useful when you want to connect the animation to app state or user interaction, such as syncing it with scroll position, triggering it through actions, or freezing the effect at a specific point in time.

### Explicit Provides full control over the animation timeline. You can define how the animation plays by configuring properties like duration, delay, easing curve, looping, and direction. This mode is useful for choreographed animations that need to start, stop, or respond to events using a **Shader Animation** action. ## Interactive Mode Some shader presets support touch and tap interactions, allowing users to directly influence the visual effect. When **Interactive** is enabled, users can tap or drag on the shader to trigger dynamic responses such as ripples, burn marks, distortions, or smearing effects, making the UI feel more engaging and responsive. ![st](https://docs.flutterflow.io/assets/images/st-b09341f4cb0600c7d72c019af3908752.gif) **The following presets are Interactive:** - **Fill:** Marble Smear (drag to smear) - **Wrap:** Clickable Ripple, Tappable Burn, Tappable Smoke, Tappable Pixel Dissolve, Tappable Slurp ### Persist Taps Available for tappable wrap presets. When enabled, the effects created by taps remain visible even after the user lifts their finger. When disabled, the effects gradually fade away, creating a more temporary interaction. ### Tap Animation For interactive wrap presets, you can control how each tap effect animates. This is separate from the main time animation and lets you define properties like curve, duration, delay, and playback behavior for each interaction, giving you finer control over how tap responses feel. ## Cache The **Cache** option improves performance by storing the shader’s rendered output. When enabled, the shader is rendered once and reused until its parameters change. This is enabled by default for ShaderFill. :::tip Disable caching if your shader needs to update continuously, such as in animations or real-time interactive effects that change every frame. ::: ## Custom Shaders Custom Shaders allow you to create fully custom visual effects by uploading your own `.frag` (fragment shader) file. This gives you complete control over how pixels are rendered. Here’s how to add a custom shader: 1. Create a Flutter-compatible `.frag` (fragment shader) file. You can generate it using ChatGPT or Claude by describing the effect you want. You can also start from an [existing shader](https://github.com/FlutterFlow/material_palette/blob/main/lib/shaders/perlin_gradient.frag) and modify it. Example Prompt: ``` Create a Flutter-compatible GLSL .frag shader for a soft animated onboarding background using Flutter runtime effect format. {describe your effect here} Return complete shader code and a downloadable .frag file. ``` 1. Upload the `.frag` file using the **Shader Asset** picker in FlutterFlow Studio. 2. After uploading, use **Add Uniform** to define input values for your shader. Each uniform is a slider value from 0 to 10. In the builder, custom shaders appear as a checkerboard placeholder. To view the actual rendered effect, run or test your app.

### Adding Uniforms Uniforms are simply input parameters that you pass to a custom shader. In FlutterFlow Studio, they appear as sliders in the UI, similar to how you adjust settings (like speed, colors, or intensity) in preset shaders. #### Order is everything Uniforms are not matched by name. They are passed strictly in the order they are declared in the shader. This means the first uniform you declare receives the first value from the UI, the second uniform receives the next values, and so on. Example: ``` uniform float speed; // 1st uniform vec3 color; // 2nd ``` In the UI, you must provide values in this exact sequence: - Uniform 1 → `speed` - Uniforms 2 to 4 → `color` (a `vec3` takes three float values) ![ShaderFill properties with a custom shader asset and Uniform 1 to Uniform 4 sliders, with the three color uniforms outlined.](https://docs.flutterflow.io/assets/images/uniform-light-7dc71fc26bd601ea5c673f26fb06900a.png) :::caution If the order does not match, the shader will receive incorrect values, which can result in broken visuals or unexpected behavior. ::: #### Everything becomes floats When you have the following uniform in shader file: ``` uniform vec4 color; ``` FlutterFlow Studio treats it as: ``` float r float g float b float a ``` #### Default uniforms Even if you don’t write them, FlutterFlow Studio **always passes these first**: ``` uniform vec2 uSize; uniform float uTime; ``` So your shader MUST assume these exist at the top. Meaning your file should start like: ``` uniform vec2 uSize; uniform float uTime; uniform float speed; uniform vec4 color; ``` ## Use Shadertoy Shaders [Shadertoy](https://www.shadertoy.com/) hosts thousands of community-made GLSL fragment shaders such as animated backgrounds, glowing effects, liquid simulations, and more. Flutter supports custom fragment shaders through its `FragmentProgram` API, but Shadertoy shaders can't be dropped in directly: they use a different entry point, different uniform names, and several built-ins that Flutter doesn't recognize. The [Shadertoy to Flutter skill](https://github.com/FlutterFlow/shadertoy_to_flutter_skill) helps convert Shadertoy GLSL into Flutter-compatible `.frag` shaders. It rewrites the shader structure, maps Shadertoy uniforms to Flutter uniforms, handles texture/audio channels where possible, and produces a `.frag` file that can be uploaded into your FlutterFlow Studio project. **Step 1: Download Skill** The skill teaches AI Agents how to convert Shadertoy shaders accurately and safely for Flutter. The skill used for this workflow is: **`shadertoy-to-flutter`**. Download it from the [GitHub repo](https://github.com/FlutterFlow/shadertoy_to_flutter_skill). The skill contains the following files: - `SKILL.md`: Main instruction file containing the shader conversion workflow and rules. - `references/flutter_glsl_constraints.md`: Flutter GLSL limitations, unsupported features, uniform rules, and texture handling. - `references/uniform_mapping.md`: Maps Shadertoy uniforms to Flutter equivalents (e.g. `iTime → uTime`). - `references/templates.md`: Example fill/wrap shader templates and sample conversions. - `references/noise_library.md`: Noise/hash helper functions for replacing Shadertoy noise textures. - `scripts/package-skill.sh`: Packages the skill into a distributable zip file. **Step 2: Install Skill** You can use this skill with AI agents such as Claude, Codex, or another AI assistant that can read `SKILL.md` and follow its instructions. **Install in Claude** 1. Open the **Claude Desktop app**. 2. Go to **Customize**. Select **Skills** from the left sidebar. 3. Click the **+** button at the top of the Skills panel. Choose **Upload a skill**. 4. Upload the Shadertoy skill as a .zip file or skill folder. The uploaded skill must include:`SKILL.md`. It can also include supporting folders such as: `references/` and `scripts/`

**Install in Codex** 1. Open the **Codex Desktop app**. 2. In the message box, type: `/sk` 3. Select **Skill Installer** from the skill suggestions list. 4. Ask Codex to install the Shadertoy skill directly from GitHub: ``` Install this skill https://github.com/FlutterFlow/shadertoy_to_flutter_skill ``` Codex will run the Skill Installer and install the skill into your local Codex folder. After installation finishes, restart Codex.

**Step 3: Using Skill** You can use the skill with either a Shadertoy URL or a local .glsl file. **Option A: Convert a Shadertoy URL** In the prompt, provide the Shadertoy URL and ask to convert into `.frag` file, for example: ``` [invoke shadertoy-to-flutter skill] convert this Shadertoy shader into a Flutter .frag file: [shadertoy-url] ``` ![convert-via-url.avif](https://docs.flutterflow.io/assets/images/convert-via-url-5e57bb85748151d9d67f8664a100b608.avif) **Option B: Convert a Local .glsl File** Open the Shadertoy shader you want to use, copy the shader code, and save it as a `.glsl` file. Then attach the file and use a prompt such as: ``` [invoke shadertoy-to-flutter skill] convert this file into a Flutter .frag file ```

:::tip You can also paste the shader code directly into the prompt, for example: ``` Use the /shadertoy-to-flutter skill and convert this shader to a Flutter .frag file: [paste shader code] ``` ::: **Step 4: Upload .frag File to FlutterFlow Studio Project** Upload the `.frag` file generated in the previous step to the **Shader Asset** picker in FlutterFlow Studio and run your app. If required, also [add Uniform](#adding-uniforms) to define input values for your shader. ### Best Practices - Keep the generated .frag file unchanged unless you know GLSL well. - Always check the uniform order before wiring values in FlutterFlow Studio or Dart. - Prefer fill shaders when possible because they are easier to use. - Use wrap shaders only when the shader needs an image, scene, or app UI texture. - Avoid adding extra uniforms unless you really need user control. # Accessibility > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/accessibility Learn how to make your app accessible to everyone. Accessibility is about making your app usable for everyone, including individuals with visual, auditory, cognitive, or motor impairments. Ensuring your app is accessible not only benefits users with disabilities but also improves the overall user experience and usability of the app for everyone. Here are some examples of how accessibility can help users with disabilities: - **Screen Readers for Visually Impaired Users**: Screen readers like **TalkBack** (Android) and **VoiceOver** (iOS) help visually impaired users navigate and understand the app by reading aloud on-screen content. - **Large Touch Targets for Motor Impairments**: Large touch targets make it easier for users with motor impairments to interact with buttons and other UI elements. - **Color Contrast for Visual Impairments**: High-contrast color schemes ensure text and interactive elements are easily readable for users with visual impairments. - **Keyboard Navigation for Physical Impairments**: Users unable to use touchscreens can navigate the app effectively with keyboard controls. - **Haptic Feedback**: Tactile responses help users with visual or motor impairments understand when interactions are successful. In FlutterFlow Studio, you can enhance the accessibility of your app by incorporating various accessibility features, such as semantic labels, keyboard navigation, haptic feedback, responsive fonts, and proper color contrast. Here are some key accessibility features you can use: ## Semantic Label **Semantic Labels** enhance your app’s accessibility and SEO by providing meaningful context about widgets for screen readers and search engines. These descriptions are especially helpful for users relying on assistive technologies. For example, in an e-commerce app, you can add a semantic label to an '*Add to Bag*' button with a message like '*Add the selected item to cart*', which helps users better understand the button's action. To add a semantic label for any widget, select the widget, open the **Documentation & Accessibility** tab of the properties panel, and enter the message in **Semantic Label**.

:::tip You can also dynamically set semantic labels using variables or expressions. This allows the label to change based on the app context, so screen readers announce exactly what’s on the screen instead of generic terms like "image" or "button." For example, a product image can read out the product name (e.g., "Red Running Shoes" pulled from Firestore) instead of just saying "image." ::: ### Advanced Semantic Settings These settings help make your app more accessible by giving you better control over how screen readers interpret and describe your UI. :::note These settings need a paid plan and aren't available on the Free plan. ::: Here’s what each option does: - **Role**: Sets the role of the widget for screen readers, such as a page landmark. See [Set a Role](#set-a-role). - **Is Container**: Indicates the widget acts as a grouping for other semantic widgets. - **Is Image**: Tells screen readers the widget represents an image. - **Is Button**: Declares that the widget behaves like a button. - **Is Header**: Identifies a widget as a heading for better navigation. - **Explicit Child Nodes**: Forces semantics to include all child nodes, even if normally ignored. - **Exclude Semantics**: Prevents screen readers from announcing this widget. - **Merge Semantics**: Combines the widget and its children into one element that screen readers announce together, such as a label and the button it describes. Child labels are joined, so text inside the widget is read too. Avoid it on layouts with several tappable children. - **Is Live Region**: Tells assistive tech that the widget’s content may change dynamically and should be re-announced. - **Hint Text**: Provides an additional hint for users (e.g., "Double tap to open"). - **Tooltip Text**: Provides descriptive text about the widget to screen readers, giving extra context beyond the primary label. - **Ordinal Sort Key**: Controls the order in which widgets are accessed by screen readers. On every plan, including Free, **Merge Semantics** is on by default for **Icon Button** and **Toggle Icon** widgets that have a semantic label, so screen readers announce each one as a single named button. It stays off by default if you turn on **Exclude Semantics** or add a semantics action, such as **On Semantics Tap** or **On Semantics Focus**. To change the default for a widget, set **Merge Semantics** to on or off, which needs a paid plan. :::caution When you turn on **Merge Semantics** for a widget that has a semantics action, the semantics action replaces the widget's own tap for assistive technologies. ::: #### Set a Role Use **Role** to tell screen readers what a widget is. Landmark roles mark the regions of a page, so screen reader users can jump between them instead of moving through every widget. To set a role, select the widget, open the **Documentation & Accessibility** tab of the properties panel, expand **Advanced Semantic Properties** under **Semantic Label**, and choose a value from the **Role** dropdown. The default is **None**. The Role dropdown open under Advanced Semantic Properties, with None selected. - Landmark roles: **Main**, **Navigation**, **Region**, **Complementary**, **Content Info**, and **Form**. - Other roles: **Dialog**, **Alert Dialog**, **Alert**, **Status**, **List**, **Tab Panel**, and **Loading Spinner**. When you choose a landmark role, **Is Container** and **Explicit Child Nodes** default to on, because a landmark only reaches the screen reader from its own semantics node. If you set either property yourself, your value is used. FlutterFlow reports these problems as errors in the **Issues** panel: - A **Region** without a **Semantic Label**. - A **Main**, **Complementary**, or **Content Info** role inside a **Main**, **Navigation**, **Region**, **Complementary**, or **Content Info** landmark. - A **Main**, **Navigation**, **Complementary**, or **Content Info** role used more than once without a **Semantic Label** on each one. - An **Alert** or **Status** role on a widget that is also a live region. If you use one of those landmark roles more than once and give them identical labels, you get an accessibility warning instead. Give each landmark a distinct label so screen reader users can tell them apart. These checks apply within a single page or component, and include the components placed on it. :::tip You can add a semantic label for every widget in your app that has an action trigger `OnTap` or `onLongPress`, by enabling the **Add Warning for Semantic Widgets**. By doing so, you'll get a warning if any widget has an action but doesn't have a semantic label added yet. You can click on the warning item to directly navigate to that widget. ::: ![add-warning-for-semantic-widgets.avif](https://docs.flutterflow.io/assets/images/add-warning-for-semantic-widgets-5d0dc639482abc4bace4a41d4cd01da2.avif) After you add semantic labels, enable **TalkBack** on Android or **VoiceOver** on iOS to test how screen readers interact with your app. These screen readers will help you verify that all UI elements are read clearly, descriptions are meaningful, and users can navigate logically without getting lost. Learn more about [enabling screen reader on your device](https://docs.flutter.dev/ui/accessibility-and-internationalization/accessibility#screen-readers). ## Semantic Announce [Action] The **Semantic Announce** action lets you notify screen reader users about important UI changes or provide contextual updates. It sends a request to the device’s accessibility service (TalkBack/VoiceOver) to speak the text out loud. It significantly improves accessibility by allowing screen reader users to receive timely and meaningful feedback. This is especially helpful when visual feedback might be missed or unavailable. :::tip[possible use cases] - **Form Submission**: After a user submits a form, you can trigger a screen reader announcement like "Your form has been submitted successfully," giving immediate feedback without requiring visual cues. - **Dynamic Content Updates**: When new content is added or changed on the screen—like loading new chat messages or refreshing a feed—you can announce messages like "3 new messages loaded" to ensure screen reader users are aware of the update. - **Error or Validation Messages**: If a user enters invalid input, you can announce helpful validation feedback like "Please enter a valid email address". ::: The Semantic Announce action allows you to trigger screen reader announcements with the following settings: - **Announcement Text**: The message you want the screen reader to speak aloud (e.g., "Item added to favorites"). - **Is Text Right to Left**: Set this to True for right-to-left languages like Arabic or Hebrew. It defaults to False, which is appropriate for left-to-right languages like English. ![semantic-announcement.avif](https://docs.flutterflow.io/assets/images/semantic-announcement-12a2c9ab81b23b565dca5b1d97b520e3.avif) :::note[Best Practices] - Long announcements can overwhelm the user. Aim for a concise phrase like "Search complete — 3 results." - Too many announcements can confuse or irritate the user. Only announce critical or timely changes that aren’t otherwise discoverable. - Use the correct language direction of the message. If your app supports multiple locales, dynamic direction binding can help. - Screen reader behavior can vary across Android (TalkBack) and iOS (VoiceOver). Test thoroughly on real hardware to confirm the experience. ::: ## Focus Configuration **Focus Configuration** helps improve keyboard and remote-control navigation in your app—especially important for web, desktop, TV, and kiosk apps. It controls how users move through widgets using the Tab key or other navigation inputs (like arrow keys or D-pad on TV or remote). You can control the Focus Configuration using the following properties: - **Wrap in Focus Traversal Group**: It places a widget (and all its children) in a dedicated group so focus cycles within that region before moving on. For example, if you have a login form with two fields: Email and Password, enabling this option ensures that pressing Tab will cycle only between them (and not jump to unrelated parts of the screen). - **Focus Traversal Order**: This sets the exact sequence in which widgets receive focus using numeric values (e.g., 1, 2, etc.). For example, In a sign‑up form, set `Name = 1`, `Email = 2`, and `Password = 3` so pressing Tab moves logically down the form rather than following the raw widget tree. - **Show Border on Focus**: Enabling this toggle highlights the widget with a visible border when it receives focus, making navigation clearer. Once enabled, you can customize the border’s appearance using **Border Width**, **Border Color**, and **Border Radius** to match your design. :::caution While you can assign a value for the **Focus Traversal Order** of any widget, it won’t take effect unless you enable **Wrap in Focus Traversal Group** on the current widget or one of its parent widgets. The **Focus Traversal Group** defines a context or scope for focus traversal, and **Focus Traversal Order** only applies within that group. Without it, there's no defined order for the traversal logic to follow. ::: ## Update Text Scaling Factor [Action] The **Update Text Scaling Factor** action in FlutterFlow Studio allows you to dynamically adjust the text size across your app during runtime. This is particularly useful for improving accessibility by letting users control the size of the text without having to manually change system settings. Imagine you have a "+" and "-" button on a page to help users adjust text size. When the user taps the "+" button, the text scaling factor increases by 1, making the text larger. Tapping the "-" button decreases the text scaling factor by 1, making the text smaller. Additionally, a Reset button can be provided to return the text scaling back to its default value. :::note This action works in conjunction with the [**Display Settings**](https://docs.flutterflow.io/resources/projects/settings/general-settings#display-settings) configured at the project level, such as **Min Text Scaling Factor** and **Max Text Scaling Factor**. ::: When configuring the Update Text Scaling Factor action, you can choose from three update types: - **Set Value**: Directly assigns the text scaling factor to a specific value. - **Increment/Decrement**: Adjusts the current scaling factor by a specified amount. A positive value increases scaling, and a negative value decreases it. - **Reset**: Restores the text scaling factor to the project's default setting. ![text-scaling-action](https://docs.flutterflow.io/assets/images/text-scaling-action-8c7c4afe7cb0c3575599aecae82eb60e.avif) ## Keyboard Navigation You can use the [On Shortcut Press](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#on-shortcut-press-action-trigger) action trigger to bind keyboard shortcuts to specific actions. This makes it easier for users with disabilities to navigate your app, especially in web and desktop environments. It enhances accessibility by allowing users to interact without relying solely on a mouse or touchscreen, making the experience more inclusive and efficient. ## Haptic Feedback Using [Haptic Feedback](https://docs.flutterflow.io/concepts/alerts/haptic-feedback), you can vibrate the user's device, which is particularly helpful for users with visual or cognitive impairments. It provides a tactile response to indicate that an action has been completed. For example, vibrating the user's device when successfully submitting a form. ## Responsive Fonts When developing an app, it's important to consider the different platforms on which it will run. Text may appear smaller on devices with higher screen resolution, such as tablets, web, or desktops, which can negatively impact accessibility for users with visual impairments. [Adding responsive text](https://docs.flutterflow.io/concepts/design-system#adding-responsive-text-styles) that adjusts font size based on the platform helps make content more readable, improving accessibility for users who need larger or more legible text. ## Color Contrast Use sufficient color contrast to make text and interactive elements readable for users with visual impairments or color blindness. This helps ensure that content is easily distinguishable, even for users with limited vision. Learn more about using various ways to [add colors](https://docs.flutterflow.io/concepts/design-system#colors) in your FlutterFlow Studio app. :::tip You can use tools like [**WCAG Contrast Checker**](https://webaim.org/resources/contrastchecker/) to validate the color contrast ratio. ::: ## Best Practices - Accessibility should be considered from the start of the design and development process, not added as an afterthought. - While adding [semantic labels](#semantic-label): - Avoid ambiguous labels like "Click here" or "Press this"; instead, use descriptive phrases such as "Submit form" or "Navigate to settings." - Instead of just showing an icon, add semantic labels like "Back button" or "Search button" to provide context for screen readers. - Ensure that interactive widgets have a minimum touch target size of 48x48 logical pixels. This helps users with motor impairments easily interact with buttons, switches, and other components. - Always test your app with screen readers enabled to verify that it behaves as expected. - Don't use color as the only means to convey important information. Include text, icons, or patterns to supplement color, making the content accessible to colorblind users. - Verify your app's UI under high contrast or larger text sizes to ensure it remains readable and usable. - Use simple gestures like taps and double-taps instead of multi-finger swipes or long presses. Provide alternate ways to perform actions, such as using a button in addition to a swipe gesture. - Perform usability tests with individuals with disabilities. Real user feedback is invaluable for identifying issues that might not be caught during standard testing. # Localization > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/localization Learn how to make your app work for different languages. **Localization** (often abbreviated as **l10n**) is the process of making your app work for different languages, regions, and cultures. It involves translating the app's text, adapting date and number formats, and adjusting other elements to meet the cultural expectations of a particular locale. :::note[Difference Between Internationalization and Localization] - [**Internationalization (i18n)**](https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization): This is the process of setting up your app in such a way that it can easily adapt to various languages and regions without requiring engineering changes. **Note that FlutterFlow Studio handles most of the internationalization for you, so the only thing you need to take care of is localization.** - **Localization (l10n)**: This is the process of translating the content of your app and adapting it for a specific locale or culture. It involves providing translations for user-visible strings, formatting dates, times, and numbers, and adapting content to meet cultural norms. In a nutshell, internationalization is about making your app to support multiple languages, while localization is the actual process of translating the content and adapting it to specific locales. ::: ## Add Multi Language Support FlutterFlow Studio enables you to translate all text in your app at once using Google Translate or to manually adjust translations as needed. Additionally, you can localize predefined messages, such as permission prompts, authentication snackbars, and other in-app notifications. Adding multi-language support is essential for making your app accessible to a wider audience. For instance, if your app provides exercise instructions only in English, non-English speakers may find it hard to understand and might choose a different app, even if it’s less effective, simply because it’s available in their language. Implementing a multi-language feature helps your app succeed globally by offering a user-friendly experience for diverse audiences. To add multi-language support in FlutterFlow Studio, navigate to **Settings and Integrations** > **Languages**, add the languages to support, and set a primary language. Then, use **Translate All** for automatic translations and adjust them if needed. To preview translated content without running your app, open **Canvas Settings** next to the light and dark mode control and choose a **Display Language**. This selector is available after you add multiple languages to your project. :::caution Changing the primary language after translating all of your text will clear the existing translations for other languages. :::

## LanguageSelector Widget The **LanguageSelector** widget in FlutterFlow Studio allows users to switch to their preferred language in real-time without needing to restart the app. It displays the currently selected language and, when interacted with, presents a list of all available languages for easy selection. It's particularly useful on onboarding screens or within settings menus to allow users to customize their language preferences. ### LanguageSelector Properties You can customize the appearance using the various properties available under the Properties Panel. ![language-selector-properties.avif](https://docs.flutterflow.io/assets/images/language-selector-properties-6e3a8952b1f093573c65fe53125ed6cb.avif) :::tip By default, the **LanguageSelector** widget does not persist the user's language choice across app sessions. To retain the selected language, enable the **Persist Selection** option under Language Settings. ::: ## Set App Language Manually [Action] Sometimes, you might prefer not to use the default [LanguageSelector widget](#languageselector-widget) and instead implement a custom widget for language switching. For example, you could create a custom language selection screen that appears when the app first launches. You can use the **Set App Language** action to let users choose their preferred language from the available options. :::note Note that this action affects only the app's language and does not modify the device's system language. ::: ![set-app-lang-action.png](https://docs.flutterflow.io/assets/images/set-app-lang-action-d2cd5297fb8801e5739b7a87862b0614.png) ## Managing Translation There are two ways you can manage the app text translation: **Inside Language Settings** The Language Settings page lists all of your app's text, grouped by page, making it easy to manage translations in bulk. To manually add or update a translation, make changes directly in the language column and mark the text as **Fixed**. Marking it as **Fixed** will prevent auto translate from overriding your custom translations during the bulk translation process. To use Google Translate for new or existing text, click **Translate Page.** ![manage-translation-in-language-settings.avif](https://docs.flutterflow.io/assets/images/manage-translation-in-language-settings-c4fbd83ee771d8c104776bf8f537edf4.avif) **Inside Properties Panel** You can also add or update translations for individual text directly inside the properties panel. To do so, select the widget (e.g., Text, TextField, etc.), go to the properties panel, and click on the Globe icon. This will open a new panel. - To manually add or update a translation, make changes directly in the box under the language name. - To auto-translate for all languages, click on **Google Translate**. ![manage-translation-in-properties-panel.avif](https://docs.flutterflow.io/assets/images/manage-translation-in-properties-panel-068d129b671bcca4e8c18d198cea4785.avif) :::note[RichText and Combine Text] Static text in each **RichTextSpan** is translatable and appears in the Languages table like text from a standard Text widget. Text assembled with the **Combine Text** function does not appear in the Languages table and is not included in **Translate All**. If you need separately styled translatable text, use a [**RichText** widget](https://docs.flutterflow.io/resources/ui/widgets/text#richtext-widget) and enter the text in its RichTextSpan children. ::: ## Translating Predefined Messages FlutterFlow Studio allows you to manage the translation for the following types of predefined messages. - **iOS Permission Messages**: iOS permission messages are the prompts shown to iOS users when your app requests access to device features, such as the camera or photo library. - **Preset In-App Messages**: These are built-in messages that FlutterFlow Studio displays for specific actions, such as authentication and file upload actions. To add translations for predefined messages, navigate to **Settings and Integrations** > **Project Setup** > **Languages**. Scroll down to the **Translation** section and select the category containing the message you wish to translate. Start by entering your message in the base language. Then, either use the **Translate Message** button for automatic translation or manually add your translations and mark them as **Fixed** to prevent them from being overridden by auto-translate. :::note Permission messages are displayed based on the features included in your app. For instance, Camera and Photo Library permission messages appear when a page contains a button with the **Upload Photo/Video action**. :::

## Accessing Language-Specific Data When building a multi-language app, you may need data like the current language code or language-specific text. In FlutterFlow Studio, you can retrieve the following types of language-related data: - **Current Language Code**: This provides the ISO language code for the current app language (e.g., en, de, fr). - **Language-Dependent Text**: Allows you to specify different values for each language. For instance, you might want to display a country flag or name based on the current app language. These options are accessible through **Set from Variable > Internationalization**. ![retrieve-lang-data.png](https://docs.flutterflow.io/assets/images/retrieve-lang-data-2eef5ceefd42854023441907287fb4f1.png) ## Localizing Dates To ensure your app displays dates in formats familiar to users from different regions, you can use the predefined **DateTime Format Options** while displaying dates. For example, in the United States, dates follow a **month, day, year** format (e.g., 12/31/2023), whereas in India, they use a **day, month, year** format (e.g., 31/12/2023). To accommodate these regional differences, set the format option to `yMd`, a locale-aware format that automatically adjusts date representation based on the user's locale. ![localize-dates.avif](https://docs.flutterflow.io/assets/images/localize-dates-c521dbf44268a20cec711f682e08779d.avif) :::tip Here are a few more locale-aware formatting options you can use: - **`yMMMd`** – Formats the date with an abbreviated month and day, e.g., `Dec 31, 2023` (US) or `31 Dec 2023` (India). - **`jm`** – Displays time with minutes, e.g., `5:30 PM` (US) or `17:30` (Europe). For custom locale-specific date formats, you can also [**create your own patterns**](https://docs.flutterflow.io/resources/data-representation/global-properties#custom-formatting). ::: ## Localizing Numbers Different regions use different symbols for decimal and thousand separators. For example, the U.S. uses a period for decimals and a comma for thousands, while many European countries use the opposite. To localize the numbers, set the [**Number Format Options**](https://docs.flutterflow.io/resources/ui/widgets/text#formatting-numbers) to **Decimal** and then set the **Decimal Type** to **Automatic**. ![localize-numbers.avif](https://docs.flutterflow.io/assets/images/localize-numbers-4f0c4f5d020f9b74b44201477b9f5b59.avif) ## Localizing Currency Currency symbols and their placement vary by locale. For example, in the U.S., the dollar sign appears before the amount (`$1,000.00`), whereas in countries like France, the currency symbol is placed after the amount (e.g., `1 000,50 €`). To handle this behavior, enable the **Display as Currency** option under Number Format settings and leave the **Currency Symbol** field empty to automatically adjust based on the user’s locale. ![localize-currency.avif](https://docs.flutterflow.io/assets/images/localize-currency-04a7d016aed333db6a0bed72beb35887.avif) ## Testing Localization testing is crucial to ensure that all elements work properly across different languages and locales. Here are a few ways to test localization: - **Change Device Locale**: Test your app by changing the device locale to verify translations and layout adjustments. - **Use Emulators**: Use Android or iOS emulators to simulate different locales and ensure everything is displaying correctly. - **Long Texts**: Verify that long translations do not overflow or cause UI issues. - **Manual Testing**: Manually verify the accuracy of translations, date formats, number formats, etc. # Alert Dialog > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/alerts/alert-dialog The action allows you to alert the user of important situations that require acknowledgment in the form of a pop-up or custom-designed dialog. With this feature, you can choose to display a pre-built pop-up or create a custom design that suits your specific requirements. The action allows you to alert the user of important situations that require acknowledgment in the form of a pop-up or custom-designed dialog. With this feature, you can choose to display a pre-built pop-up or create a custom design that suits your specific requirements.

### Types of Alert Dialog We allow you to define two types of Alert Dialog Actions: - **Informational Dialog:** To show some information the user should be aware of before interacting with the app. Contains only a single action button. - **Confirm Dialog:** This dialog can contain two action buttons. It can trigger the subsequent action based on whether a user confirms the action. It can also be used before performing any non-revertable user action, for example, before deleting a user account. - **Custom Dialog**: This is a fully customizable dialog that you can create using [components](https://docs.flutterflow.io/resources/ui/components). ### Adding Informational Dialog [Action] Follow the steps below to add this type of action to any widget: 1. Select the **Widget** (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties panel (the right menu), and click **+ Add Action**. 3. Search and select the **Alert Dialog** (under *Alerts/Notifications*) action. 4. Set the **Alert Dialog Type** to **Informational Dialog**. 5. Provide the **Title** and **Message** for the dialog. Note: You can also set it from a variable; for example, a combined text with a value from a variable. 6. Also, enter a **Dismiss Text** that will be shown on the action button.

### Adding Confirm Dialog [Action] Follow the steps below to add this type of action to any widget: 1. Select the **Widget** (e.g., Button) on which you want to define the action. 2. Select **Actions** from the Properties panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 1. Click on the **+ Add Action**. 2. On the right side, search and select **Alert Dialog**. 3. Set the **Alert Dialog Type** to **Confirm Dialog**. 4. Provide the **Title** and **Message** for the dialog. Note: You can also set it from a variable; for example, a combined text with a value from a variable. 5. Now, enter a **Dismiss Text** (shown on the action button that will cancel the Action) and a **Confirm Text** (shown on the action button that will trigger the Action that you will define in the next step). 6. Now, click on the **+** button and select **Add Conditional**. 7. On the right side (**Set Condition for Action**), set the **Source** to **Confirm Dialog Response**. 1. Under the **TRUE** section, add an action that will be triggered if a user gives confirmation. 2. Under the **FALSE** section, add an action that will be triggered if a user cancels this dialog. 3. Click **Close**.

### Adding Custom Dialog [Action] Before you add this action, ensure you [create a component](https://docs.flutterflow.io/resources/ui/components/creating-components) that you want to display as a custom dialog. Now follow the steps below to add this type of action to any widget: 1. Select the **Widget** (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties panel (the right menu), and click **+ Add Action**. 3. Search and select the **Alert Dialog** (under *Alerts/Notifications*) action. 4. Set the **Alert Dialog Type** to **Custom Dialog** and **Select Component**. 5. It is recommended to set the appropriate **Width** and **Height** for the custom dialog. 6. Optionally, you can set the **Background** and **Barrier Color** for this dialog. ![Setting background color and barrier color](https://docs.flutterflow.io/assets/images/custom-dialog-f68560d78150e1f20ecaed3aab6b928f.avif) 7. By default, this type of action blocks the following action (if any) from triggering while this action is in progress, meaning the dialog is present on the screen. However, in some cases, you might want to allow the next action (after this) to execute, for example, making an API call immediately after showing the custom loading dialog. To do so, enable **Non Blocking** option. 8. By default, **Non Dismissble** option closes the dialog when you click outside of it. To disable this behavior, enable this option.

9. By default, the custom dialog appears in the center of the screen. However, you can use the **Dialog Alignment** property to decide where to position the dialog on the screen. ![The Dialog Alignment setting of a custom dialog action, with X and Y set to -1 to place the dialog at the top left.](https://docs.flutterflow.io/assets/images/align-custom-dialog-light-f4a1221d43c2c0d4d5cd0bc69e58d38c.png) 10. To position the dialog around the widget that opened it, enable the **Align with the Target Widget**, and then align using the **Target Alignment** property. **Tip**: If dialog goes out of the screen, enable **Avoid Overflow**.

# Dismiss Custom Dialog > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/alerts/dismiss-custom-dialog With this action, you can easily close the custom dialog, providing a convenient way for users to dismiss it. This functionality is handy when you want to give users the option to close the dialog from any widget within it, like a close button. With this action, you can easily close the [custom dialog](https://docs.flutterflow.io/concepts/alerts/alert-dialog#adding-custom-dialog-action), providing a convenient way for users to dismiss it. This functionality is handy when you want to give users the option to close the dialog from any widget within it, like a close button.

## Adding Dismiss Custom Dialog [Action] Follow the steps below to add this type of action to any widget: 1. Select the **Widget** (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties panel (the right menu), and click **+ Add Action**. 3. Search and select the **Dismiss Custom Dialog** (under *Alerts/Notifications*) action. 4. You can set a default value to be sent when the user closes the custom dialog. You can do so by enabling the **Has Value** option. For instance, if the dialog provides a list of colors and the user closes it without selecting any color, you can set a default color value of "Black" to be sent as the default selection. ![The action panel of a button in a dialog component, with a Dismiss Dialog action on tap.](https://docs.flutterflow.io/assets/images/adding-dismiss-custom-dialog-action-light-a0a9d461f6eb1d96fef9fae68492a6e7.png) # Haptic Feedback > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/alerts/haptic-feedback Using this action, you can vibrate the user's device. Typically this is used to draw users' attention to the action they have performed. For example, vibrating the user's device on setting the alarm. Using this action, you can vibrate the user's device. Typically this is used to draw users' attention to the action they have performed. For example, vibrating the user's device on setting the alarm. ## Types of Haptic Feedback Depending on the action a user has performed (e.g., bookmark an item, on-off flashlight), you can set the different vibration intensity and duration types. Here are the types of haptic feedback: 1. **Light**: This creates a very low-intensity vibration similar to pressing a virtual on-screen key. 2. **Medium**: This creates a medium-intensity vibration similar to pressing a key on a keyboard. 3. **Heavy**: This creates a high-intensity vibration similar to clicking an item. 4. **Selection Click**: This vibrates the device when selection changes through discrete values. Similar to changing hours and minutes on the clock app. 5. **Vibrate**: This creates a vibration for a short duration. :::caution - The *Light*, *Medium*, *Heavy*, and *Selection Click*, these types of haptic feedback only work on iOS version 10 and above. - The *Selection Click* type only works on Android API levels 23 and above. ::: ## Adding Haptic Feedback [Action] Go to your project page on FlutterFlow Studio and follow the steps below to define the Action to any widget. 1. Select the **Widget** (e.g., Button) on which you want to define the action. 2. Select **Actions** from the Properties panel (the right menu), and click **+ Add Action**. 3. Search and select the **Haptic Feedback** (under *Alerts/Notifications*) action. 4. Set the **Feedback Type** among the **Light**, **Medium**, **Heavy**, **Selection Click**, and **Vibrate**.

# Notifications > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/notifications Learn how to add notifications in FlutterFlow Studio. **Notifications** are alerts or messages that appear on a user's device outside the normal UI flow of an app. They can inform the user of time-sensitive or high-priority messages, events, or actions that require attention. Notifications may appear as banners, alerts, pop-ups, or lock-screen notifications, depending on user preferences and platform design guidelines. Notifications enhance your app by increasing user engagement and delivering critical information in real time. Whether it’s an urgent alert or a gentle nudge, these timely messages: - **Prompt User Action**: Remind users to perform tasks or revisit the app, ensuring higher retention and conversion. - **Foster Engagement**: Encourage ongoing interaction through updates, promotions, or new content notifications. - **Deliver Value**: Provide relevant insights—such as location-specific alerts or personalized reminders—at the right moment. ## Types of Notifications Generally, notifications can be divided into two main categories: **Local Notifications** and **Push (remote) Notifications**. **Local Notifications** are scheduled directly on the device and do not require a server component. They are commonly used for time-based reminders or location-based triggers, such as a daily workout reminder at 7:00 AM. To implement local notifications in FlutterFlow Studio, you can integrate the [flutter_local_notifications](https://pub.dev/packages/flutter_local_notifications) package using [custom actions](https://docs.flutterflow.io/concepts/custom-code/custom-actions). **[Push Notifications](https://docs.flutterflow.io/concepts/notifications/push-notifications)**, on the other hand, are delivered from a remote server through a platform-specific push notification service. They are primarily used for real-time updates, such as chat messages, social media alerts, or news updates. In FlutterFlow Studio, [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) (FCM) is used to handle push notifications, enabling seamless communication between your app and users. # Push Notifications > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/notifications/push-notifications Push Notifications let you deliver time-sensitive, real-time messages to users even when the app isn’t active. These notifications rely on Firebase Cloud Messaging (FCM) behind the scenes, which routes messages to both Android and iOS devices. When integrated correctly, you can use push notifications to: **Push Notifications** let you deliver time-sensitive, real-time messages to users even when the app isn’t active. These notifications rely on [**Firebase Cloud Messaging (FCM)**](https://firebase.google.com/docs/cloud-messaging) behind the scenes, which routes messages to both Android and iOS devices. When integrated correctly, you can use push notifications to: - Send alerts for new content (e.g., chat messages, and updates). - Re-engage users with timely reminders or offers. - Provide relevant information (e.g., order status, location-based alerts). Push notifications involve several key components working together to deliver messages to users' devices. In FlutterFlow Studio, you can construct and send notification payloads—such as title, message body, and additional data like image—to a push service, Firebase Cloud Messaging (FCM). FCM receives notifications and routes them to the appropriate devices. Each device is identified by a unique **Device Token/Registration Token** generated by the FCM to target specific devices. The user's device receives these notifications and handles the payload by displaying messages or navigating the user to specific screens. ## Push Notifications Setup You can add and send push notifications manually or trigger them based on user actions within the app. Here are the steps in detail: :::note[General Prerequisites] Before you begin, ensure that you: - Complete all the steps in [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). Note that, while setting up, make sure to follow step number 5 and 8 carefully from [**Allow FlutterFlow Studio to Access Your Project**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#allow-flutterflow-studio-to-access-your-project) section to properly add the **Cloud Functions Admin** role to **firebase@flutterflow.io** user. - Upgrade your Firebase project to the [**Blaze plan**](https://firebase.google.com/pricing) to enable [**Cloud Functions**](https://firebase.google.com/docs/functions), which are required specifically for FlutterFlow Studio’s push notification setup, such as retrieving the FCM token and sending notifications trigger from FlutterFlow Studio. ::: :::note[iOS Prerequisites] To send push notifications to iOS devices, you must: - Have an active [**Apple ID**](https://appleid.apple.com/account?appId=632&returnUrl=https%3A//developer.apple.com/account/). - Enroll in the [**Apple Developer Program**](https://developer.apple.com/programs/enroll/) (a paid membership is required). For more details, visit the [**Apple Developer Program**](https://developer.apple.com/programs/). ::: ### Enabling Push Notification :::caution **Please note, push notifications will not work in these scenarios:** * Push notifications will not work on an iOS simulator. To test you will need to use a real device. * Push notifications will not be delivered to users who are logged out of your app. To send push notifications to users who are not logged in, consider implementing [**Anonymous Firebase Login**](https://docs.flutterflow.io/integrations/authentication/firebase/anonymous-login) within your app * Push notifications will not work if you have the app open on your device. ::: To enable push notifications: 1. Navigate to the **Settings and Integrations > Push Notifications** and **Enable Push Notifications**. 2. Now, click on the **Deploy** button. This will create and deploy the *Cloud Functions* in your Firebase project that are necessary for push notifications to work. 3. Optionally, you can enable **Allow Scheduling** to send push notifications at a later time. Once enabled, you can select **Scheduler Granularity**, which determines how precisely the notifications will be sent. You can choose the granularity based on how time-sensitive your notifications are; For example: - If you need the notification to be sent at an **exact time** (e.g., 11:37 AM), choose **"1 minute"**. - If a slight delay is acceptable, you can select **"15 minutes"** or **"1 hour"**, meaning the notification will be sent within that timeframe. - **Higher precision (e.g., 1-minute intervals) requires more computing resources**, which may **slightly increase costs** (up to $0.50 per month). - **Lower precision (e.g., 1-hour intervals) is more cost-effective**, as it reduces the frequency of function execution (around $0.05 per month). :::caution[Upgrading to Blaze Plan] If you encounter deployment errors instructing you to contact support, it could be because you recently upgraded your Firebase project to the **Blaze plan**. After upgrading, Firebase may take approximately **10-15 minutes** to propagate the changes. If you receive this error, wait **10-15 minutes** and then try deploying again. ::: ![img.png](https://docs.flutterflow.io/assets/images/enable-push-notification-75d9cd132af0f04b1b31f832849cb38a.avif) :::note By default, the **Automatically Prompt Users for Permission** option is enabled, meaning your app will automatically prompt users requesting for permission to receive push notifications when the app is started. However, this may be disruptive to your user sign-in flow. If you disable it, you can control when the permission is requested. To do so, you will need to manually [**Request Permission**](https://docs.flutterflow.io/resources/projects/settings/project-setup#request-permission-action) at the appropriate point in your app. **It is recommended to keep this option always enabled**. ::: ### Configuring iOS App To receive the push notifications in an iOS app, you need to perform the following additional steps. #### Step 1: Creating a Key Apple requires developers to create a key for the push notifications inside the *Apple Developer Console* to verify the push notification's sender. To create an APNs key in your Apple Developer account, go to the [**Keys**](https://developer.apple.com/account/resources/authkeys/list) section and click the **(+)** button. Enter a **Key Name**, select **Apple Push Notifications service (APNs)**, and click **Configure**. Choose the appropriate **Environment** (Sandbox, Production, or both) and set any [**Key Restriction**](https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns#Team-scoped-keys) as needed. Once configured, click **Save**, then **Continue** and **Register**. Finally, download and securely store the key file, as it will be required for integration with your Firebase project. :::tip After testing push notifications in the development environment, it's advisable to create a new key specifically for production use and upload it to your Firebase project. :::

#### Step 2: Add APNs Key to Firebase Project To add the **APNs** key to your Firebase project, navigate to your **Firebase Project Dashboard > Project Settings** and select the **Cloud Messaging** tab. Scroll down to the **Apple app configuration** section and locate the **APNs Authentication Key**. Click **Upload** and select your APNs auth key file (that you downloaded in the [previous step](#step-1-creating-a-key)). Enter the **Key ID**, which can be found inside the key entry in [Keys](https://developer.apple.com/account/resources/authkeys/list). Finally, enter the **Team ID**, available in the [**Apple Developer Account**](https://developer.apple.com/account) inside the **Membership details** section.

## Send Push Notifications To send push notifications, go to **FlutterFlow Studio** > **Settings and Integrations** > **Push Notifications**, then open the **Manually Trigger Notifications** section. Enter the notification details and click **Send Notification**. A confirmation popup will appear—type **"Send Notification"** and click **Send Notification** again to deliver your message. To send push notifications, you need to provide the following details: - **Notification Title:** Enter the title of the notification. - **Notification Text:** Provide the message content for the notification. - **Notification Image (Optional):** Upload an image to be displayed with the notification. - **Target Audience** **(Optional):** Choose whether to send notifications to **iOS**, **Android** users, or **All** users regardless of their device type. - **Deliver With Sound** **(Optional):** Enable this option if you want the notification to play a sound. - **Batch Notifications** **(Optional):** Toggle this setting if you want to send the notification in batches. Enable this only when you have over 10K users. - **Scheduled Time (Optional):** Choose the specific date and time for the notification to be sent. This option is available only when the **Allow Scheduling** option is enabled, and the selected date and time follow your timezone. - **User References (Optional):** Send push notifications to a specific user or a few users. Enter the user document reference (from the 'users' collection in Firestore) into the *User References* in this format: `/users/user_id`. :::tip You can easily copy and paste the document reference directly from the [**Firestore Data Manager**](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-content-manager) in FlutterFlow Studio. ![pn-with-data-2](https://docs.flutterflow.io/assets/images/pn-with-data-2-38ba3bb21ddf877d8c9bbf8ae2547113.avif) ::: - **Initial Page (Optional):** Choose the page the app should open when the user taps the notification.

## Push Notifications with Data Sometimes, you might want to include additional data with your push notifications, which can then be used to display more detailed information on the page when it is opened through a push notification. For instance, consider a news app that sends push notifications for breaking news. When the user taps the notification, the additional data like the article’s title, summary, and image can be displayed on the news page. :::caution Currently, we only support sending *Firestore DocumentReferences* as data. ::: To send a push notification with data, you need a page that accepts a parameter of type **DocumentReference**. Start by building the notification, and set the **Initial Page** to the one that accepts the parameter. In the **Parameter Data** section, copy-paste the document reference from Firestore. Finally, click **Send Notification** to deliver the push notification with the specified data. :::tip On the page that receives the DocumentReference, you can fetch additional details of the item using the [**Backend Query**](https://docs.flutterflow.io/resources/backend-query/document-from-reference). ::: ![pn-with-data.avif](https://docs.flutterflow.io/assets/images/pn-with-data-78bba6fa30b96c152057792dfbbec77d.avif) ## Trigger Push Notification [Action] You may want to send a push notification when a specific event occurs in your app. For example, notifying a user when they receive a new message, when an appointment is booked, or when there is a price change. You can send the push notification when such an event occurs by adding the **Trigger Push Notification** action. In this action, you can decide who should receive the push notification by setting the **Audience** to either **Single Recipient** or **Multiple Recipients**. - **Single Recipient:** Sends a notification to one specific user. For example, notifying the **group creator** when a new member joins. - **Multiple Recipients:** Sends a notification to multiple users. For example, notifying **all group members** when someone joins the group. :::tip - You must provide the document reference of the user who should receive the notification. - You can set other notification details as per your requirements. ::: ![trigger push notifications](https://docs.flutterflow.io/assets/images/trigger-pn-38ef8379e58d26e2b910534153ff7b10.avif) ## Testing Push Notifications Cloud Function You can also test the Push Notifications Cloud Function directly from the Google Cloud console, without needing to trigger from FlutterFlow Studio. This is especially useful for debugging purposes. For step-by-step instructions, including an example and how to structure the request, refer to the [Testing Cloud Functions in Google Cloud Console](https://docs.flutterflow.io/concepts/custom-code/cloud-functions#testing-cloud-functions) section. ## Update App Badge Count (iOS only) [Action] The **Update App Badge Count** action lets you manually display a numeric badge on your **iOS app icon**. This badge typically indicates pending tasks or updates, such as unread messages, notifications, or reminders. :::note[Platform Support] In Android, badges automatically appear on app icons with push notifications. We would like to add this functionality for iOS. However, we are blocked by [**this**](https://github.com/firebase/flutterfire/issues/9563) issue. Therefore, it is important to note that this action **does not automatically set the badge count** when receiving a push notification in iOS—rather, it must be triggered manually while your app is running. ::: ![badge-count](https://docs.flutterflow.io/assets/images/badge-count-950c23375ca20d6239ec2246c78fb86e.avif) :::tip[possible use cases] - In a **messaging app**, you might manually increment the badge count each time a new chat message arrives while the user has the app open or decrease it as they read the messages. - In an **email app**, you could manually update the badge count each time a new email arrives while the user is actively using the app and decrease it as emails are opened or marked as read. - In a **calendar app**, you might set the badge count to reflect the number of upcoming events for the day, incrementing or decrementing it based on the user's interactions or changes in their schedule. ::: To implement, simply enter the number of **Badge Count** the app should display on the home screen icon. ![set-app-badge-count-ios](https://docs.flutterflow.io/assets/images/set-app-badge-count-ios-41c8bb9a7140b280051345356d6cdfbf.avif) ## FAQs
Push notifications not working; Getting cloud function error: PERMISSION_DENIED: Missing or insufficient permissions If you encounter an error with push notifications, specifically a cloud function failure due to permission issues, it might be related to your Google Cloud organization's settings. Organizations can disable automatic IAM grants for default service accounts, leading to this error. To fix this issue, manually grant the Editor role to the default service account used by your project. You can do this by visiting the GCP IAM page and assigning the Editor role to the following service account: - For App Engine (Gen 1): `{firebase-project-id}@appspot.gserviceaccount.com` - For Compute Engine (Gen 2): `{project-number}-compute@developer.gserviceaccount.com` ![pn-faq-img-1](https://docs.flutterflow.io/assets/images/pn-faq-img-1-c3cee31c4aaf730b44f2ec4c635c6682.png) Also, ensure that these principals (emails) and their roles are present in the permissions tabs in *App Engine Default service account*, *Default compute service account*, and *firebase-adminsdk*. You can do this by visiting the GCP Service Accounts page, clicking on each service account email, and granting access to these principals in the permissions tab. Below is a sample image for App Engine Default service account. ![pn-faq-img-2](https://docs.flutterflow.io/assets/images/pn-faq-img-2-6c76aedc7a87b21690b34f727945ed18.png)
# OneSignal > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/notifications/one-signal Integrating OneSignal lets you send emails and SMS (text messages) to your users. This can help you Integrating OneSignal lets you send emails and SMS (text messages) to your users. This can help you get more engagement, make more sales, and keep users coming back. After you set up OneSignal, you'll be able to easily add users to or remove them from OneSignal's subscription list. ![img.png](https://docs.flutterflow.io/assets/images/os-img-f9a915fcc8fd97f76cf0e8b93194261b.png) :::note[Prerequisites] - Before you begin, make sure the project is on **Blaze plan** on Firebase. - [**Create an Account**](https://dashboard.onesignal.com/signup) on OneSignal ::: ## Initial Setup Here's a detailed, step-by-step guide to help you integrate OneSignal: ### Setup in OneSignal 1. To get started, you need an app created on OneSignal. You can create one from the [dashboard](https://dashboard.onesignal.com/apps). ![img_1.png](https://docs.flutterflow.io/assets/images/os-img_1-7252718c2ea36679e6d21ba6376567fc.png) 1. After creating your app, activate the services you need, like SMS and Email. Go to your app settings by clicking **App > Settings > Platforms** and then select **Activate** for the services you want to use. * If you're planning to use SMS, you'll need a [Twilio](https://twilio.com/) account and then follow the steps from the official [SMS Quickstart documentation](https://documentation.onesignal.com/docs/twilio-setup#step-2-twilio-account-setup).
SMS Configuration
* For sending emails, configure your settings as per the guidelines provided in the OneSignal [documentation](https://documentation.onesignal.com/docs/email-quickstart). ### Setup in FlutterFlow Studio To enable OneSignal in FlutterFlow Studio: 1. Navigate to **Settings and Integrations** > **Integrations** > **OneSignal**. 2. Switch on the **Enable OneSignal** toggle. 3. Gather your credentials: - **App ID**: Find this in your OneSignal dashboard under **Settings > Keys & IDs > OneSignal App ID**. - **API Key**: Located in the same section as the App ID, under **Rest API Key**. - **User Key**: Go to your user profile icon, then **Account & API Keys > User Auth Key**. - Click **Deploy**.
4. Now, at appropriate event in your app, you can [add an action](#adding-onesignal-action) that adds the user to the OneSignal's subscription. 5. To test SMS functionality, follow the continuation of the instructions in the [SMS documentation](https://documentation.onesignal.com/docs/sending-sms-messages#sending-sms-notifications-from-dashboard). 6. To try out sending Emails, continue with instructions from [here](https://documentation.onesignal.com/docs/sending-email#sending-email-notifications-from-dashboard). ## Types of OneSignal action There are two main actions you can utilize in OneSignal: - **Add**: This lets you add users with their details like Email Address, Phone Number, and Tags. - **Dismiss**: Use this to remove a user from the subscription list. ### Adding OneSignal action To add a OneSignal action, such as adding a user, follow these steps: 1. Select the **Widget** (e.g., Button, etc.) on which you want to add the action. 2. Select **Actions** from the Properties Panel (the right menu). 3. Search and select the **OneSignal** (under Integration) action. 4. Select the [Type](#types-of-onesignal-action) of the action. 5. To add a user, enable the subscription options you want. You can set the value directly or use a variable. Remember, phone numbers should be in the [E.164 format](https://documentation.onesignal.com/docs/sms-faq#what-is-the-e164-format). 6. Optionally, add Tags for more personalized messaging. For example, you could tag users based on their spending amount to target them with specific emails or SMS messages about their purchases.
You can find out if the user was successfuly added to the subscription by navigating to **OneSignal dashboard > App > Audience > Subscriptions**. ![img_2.png](https://docs.flutterflow.io/assets/images/os-img_2-38c9b00550e4ec0a49a984f30c841cca.png) :::note[OneSignal for Supabase Users] Currently, our OneSignal integration supports only Firebase authentication. If you want to use [**Supabase authentication**](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup), you may need to use [**custom code**](https://docs.flutterflow.io/concepts/custom-code) to notify your users. ::: # App Events > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/app-events Learn how to use App Events in FlutterFlow Studio. **App Events** allow different parts of your app to communicate without being directly connected. Instead of tightly coupling pages and components together, you can trigger an event in one place and handle it somewhere else. This helps keep your app more modular, easier to maintain, and simpler to scale as new features are added. In many apps, making `Page A` react to something that happened on `Page B` often requires passing data through navigation parameters, updating app state, or building complex callback chains. As your app grows, this approach can quickly become difficult to manage. App Events provide a cleaner pattern. Any part of your app can broadcast a named event (optionally with data), and any other part of the app can listen for that event and respond accordingly. The sender and receiver do not need to know about each other, which keeps your architecture loosely coupled. For example, imagine a user adds a product to the cart from a product detail sheet. Instead of manually updating every place that shows cart information, the app can trigger a **CartUpdated** event. The cart badge, mini cart, or product list page can listen for this event and refresh itself automatically. The component that added the item doesn’t need to know which parts of the app will update. It simply announces that the cart has changed. ![app-event.avif](https://docs.flutterflow.io/assets/images/app-event-56ecf95098e14853bdedb5dbe084ef8a.avif) ## Key Concepts ### Events An **Event** is a named signal that indicates something happened in your app. For example: - `Internet Connection Changed` : The device’s network connectivity status changed (e.g., went offline or came back online) - `Cart Updated` : An item was added to or removed from the cart You can also pass relevant details along with an event. For example, a `Cart Updated` event might include information about the specific product that was added or removed. This data can be defined using a **FlutterFlow Studio [DataType](https://docs.flutterflow.io/resources/data-representation/data-types)** to ensure the event carries structured and consistent information. ### Event Handlers Event handlers define **what should happen when an event occurs**. When an event is triggered, the handler runs an **Action Block** that performs the required logic. ### Global vs. Local Events App Events can be scoped as **Global** or **Local**, which determines **where the event is handled and who can respond to it**. Global events are handled at the app level, while Local events are handled by specific pages or components that choose to listen for them. Choosing the right scope helps keep your app architecture clean and prevents unnecessary coupling between parts of the UI. | | Global | Local | | --- | --- | --- | | **Where it's handled** | At the app level | On specific pages or components that explicitly subscribe to the event | | **Number of handlers** | Exactly one (the assigned Action Block) | Many — any page or component can add a handler | | **Subscription management** | Automatic — always active | Manual — handlers are added and cancelled using actions | | **Best for** | App-wide concerns such as analytics, logging, authentication state, or global notifications | Page or component reactions such as refreshing lists, updating widgets, or syncing UI elements | | **Processing** | Sequential queue (events processed one at a time) | Broadcast stream (all subscribers notified immediately) | ### Actions You can **trigger and respond to App Events** using the following actions: - **Trigger App Event:** Fires an event. This action can be used anywhere actions are supported, such as on button taps, page load triggers, or inside action flows. - **Add Local App Event Handler:** Starts listening for a local event on the current page or component and runs the assigned **Action Block** when the event is triggered. - **Cancel Local App Event Handler:** Stops listening for a local event on the current page or component when you no longer want it to respond to that event. ## Using App Events Follow the steps below to use App Events in your app: ### 1. Create an App Event 1. Open the **App Events** page from the left sidebar. 2. Click the **+** button to create a new event. 3. Enter a name of the event. 4. Configure the event settings: - **Description** *(optional):* Add a short explanation of when and why this event fires. This description appears as a comment in the generated Dart code. - **Scope:** Choose **Global** or **Local** depending on where the event should be handled. - **Include Event Data:** Enable this if the event needs to pass additional information when it fires. - **Data Type:** If event data is enabled, select the **DataType** that defines the structure of the event payload. - **Nullable:** Specify whether the event data can be `null`. 5. **If the scope is Global**, assign a handler **Action Block**. This Action Block runs automatically whenever the event is triggered. If the event includes data, the Action Block must have a parameter matching the event's Data Type.

### 2. Trigger the Event 1. Open the **Action Flow Editor** on the widget or page where the event should be triggered. 2. Add a new action as **Trigger App Event** (under the **App Events** group). 3. Configure the action: - **Event to Trigger:** Select the app event you created. - **App Event Data:** If the event includes data, provide the values to pass with the event. - **Wait for Completion (Global events only):** If enabled (default), the event queue waits until the handler Action Block completes before processing the next queued event. Disable it for fire-and-forget behavior. This option is not shown for local events. - **Debug ID** *(optional):* Add a label to help identify this trigger during debugging.

### 3. Handle the Event #### For Global Events No additional setup is required. The Action Block you created in [Step 1](#1-create-an-app-event) is called automatically whenever the event fires, from anywhere in the app. #### For Local Events 1. On the page or component that should respond to the event, open the **Action Flow Editor** (commonly under **On Page Load** or **On Component Load**). 2. Add a new action as **Add Local App Event Handler**. 3. Configure the handler as per the following: - **Local App Event to Handle:** Select the event you want this page or component to listen for. - **Handler Action Block:** Choose the Action Block that should run when the event is triggered. If the event includes data, the Action Block must have a parameter matching the event's Data Type.

*(Optional)* If you want to stop listening later (for example, after a certain condition is met or a toggle is switched off), add a **Cancel Local App Event Handler** action and select the same event.

:::tip Local event subscriptions are automatically cleaned up when the page or component is disposed (removed from the widget tree). You only need to manually cancel if you want to stop listening *before* the page closes. ::: ## Examples Let’s look at a couple of examples to understand how **App Events** can be useful in real-world scenarios. ### Internet Connectivity Status (Global Event) Internet connectivity affects the **entire app**, not just a single page. Instead of handling connectivity changes separately on every screen, you can trigger a **global event** whenever the device goes offline or reconnects and handle the response from one centralized place. When the app detects that the device has gone **offline** or come **back online**, the global event handler can react accordingly. For example, it can: - Show a **“No Internet Connection”** banner or snackbar when the device goes offline - Hide the banner when the connection is restored - Pause or resume background sync or network-dependent actions You can also include additional event data to provide more context about the connectivity state, such as: - `isConnected` → `true` / `false` - `connectionType` → `wifi` / `mobile` / `none` ![global-event.avif](https://docs.flutterflow.io/assets/images/global-event-1e6a594f6137c21bc3bd5f0dad1b4c2f.avif) Here’s the complete setup: 1. Create a **DataType** called `ConnectivityStatus` with the following fields: - `isConnected` (Boolean) - `connectionType` (String) → `wifi`, `mobile`, or `none` 2. Create a **Global App Event** called `Internet Connection Changed` with the following configurations: - Scope: **Global** - Include Event Data: **On** - Data Type: `ConnectivityStatus` 3. Create an **Action Block** called `handleConnectivityChange` that: - Checks the `isConnected` value - Shows a **“No Internet Connection”** banner when `false` - Optionally displays the current `connectionType` when connected - Hides the banner when the connection is restored 4. **Trigger the event** whenever connectivity changes: - In a connectivity listener or custom action → **Trigger App Event** - Pass `isConnected: true` with `connectionType: wifi` or `mobile` when connected - Pass `isConnected: false` with `connectionType: none` when offline The app responds consistently to connectivity changes from anywhere. All network status handling is centralized in a single Action Block, making the behavior easy to maintain and extend. ### Multi-Tab Dashboard Sync (Local Event) In many apps, a dashboard contains **multiple tabs showing related data**. When information is edited in one tab, the other tabs should update to reflect the latest state. Instead of directly wiring the tabs together, you can trigger a **local event** so that each tab can react independently. When a change happens, the tabs listening for the event can react in different ways, such as: - Refreshing backend queries to fetch the latest data - Updating summary widgets or charts - Reloading lists or tables displayed in other tabs Because this is a **local event**, only the pages or components that subscribe to it will respond. ![local-event.avif](https://docs.flutterflow.io/assets/images/local-event-28abb7116637070ff0dec8f563c9303e.avif) Here’s the complete setup: 1. Create a **Local App Event** called `Dashboard Data Changed` with the following configurations: - Scope: **Local** - Include Event Data: **Off** 2. On each **dashboard tab component** (typically on **On Component Load**): - Add **Add Local App Event Handler** - Set the App Event to `DashboardDataChanged` 3. Create an **Action Block** called `refreshDashboardTab` that: - Re-runs the backend queries used by the dashboard - Refreshes the UI components that depend on that data 4. On any **edit or save action** inside a tab: - Add **Trigger App Event** - Set the App Event to `DashboardDataChanged` Once triggered, all tabs that are listening for the event refresh automatically. ## How Event Processing Works Understanding the event lifecycle helps you design reliable event-driven flows. Internally, when an App Event is triggered, it follows a predictable flow inside the app. The event is first placed in a queue and then processed in order. Based on its **scope** (Global or Local), the event is routed to the appropriate handler, which performs the defined actions. ![flow.avif](https://docs.flutterflow.io/assets/images/flow-ceddbd8c582d88da179d98bdc5de2b71.avif) Here are a few things to remember: - **Global events** are queued and processed sequentially. If multiple global events are triggered quickly, they run one after another, not in parallel. - **Local events** are broadcast to all active subscribers immediately when triggered. - **Wait for Completion** (Global events only, enabled by default) makes the event queue wait until the handler Action Block completes before processing the next event. Disable it for fire-and-forget behavior. - **Global events** always run their assigned handler, no matter where the event is triggered. - **Local event** handlers exist only while their page or component is active. When the page is disposed, the subscription is automatically removed. ## Best Practices ### When to Use Global vs. Local **Use Global events when:** - The reaction should happen **anywhere in the app**, regardless of which page is currently open (e.g., showing snackbars, handling auth state changes, logging events). - The logic should be handled in **one centralized place**. - The behavior is **app-wide** and should always run when the event is triggered. **Use Local events when:** - Only **specific pages or components** need to respond to the event. - Different parts of the UI may need to **react differently** to the same event. - The handler needs access to **page-level state or widget data**. In short, **Global events are for app-wide reactions**, while **Local events are for page-specific behavior**. ### Naming Conventions Use clear, past-tense names that describe **what already happened**, not what should happen. This keeps event flows easy to read and understand. Examples: - `User Logged In` (not `Login`) - `Cart Updated` (not `Update Cart`) - `Payment Completed` (not `Process Payment`) This makes action flows read naturally, for example, “When `Cart Updated` is triggered, refresh the product list.” :::note FlutterFlow Studio automatically generates a camelCase identifier from this name behind the scenes, which is used internally in code. Examples: - `User Logged In` → `userLoggedIn` - `Cart Updated` → `cartUpdated` - `Payment Completed` → `paymentCompleted` ::: ### Keep Handlers Focused Each event handler (Action Block) should perform **one clear responsibility**. This keeps event flows easier to understand and maintain. If multiple reactions are needed: - Use a **Local event** and add separate handlers on different pages or components, or - Use a **single Global handler** that runs a small sequence of related actions. ### Avoid Event Chains Avoid triggering many events from inside other event handlers. While this is technically possible, long chains of events can quickly become difficult to follow and debug. If you find yourself chaining events frequently, consider **passing additional data through a single event** instead. ### Use Debug IDs During Development The **Debug ID** field in the **Trigger App Event** action lets you label where an event was triggered. This is especially helpful when the same event can be fired from multiple places in the app, making it easier to trace and debug event flows. ## FAQs
Why do I see “No local app events available to handle”?

This message appears when adding an Add Local App Event Handler action if either:

  • No App Events have been created with Local scope.
  • A handler has already been added for all available local events on the current page or component.
Fix: Create a new App Event with Local scope, or check whether the event you want to handle already has a handler on this page or component.

Why do I see “No local app event handlers available to cancel”?

This message appears when adding a Cancel Local App Event Handler action if there are no active local event handlers on the current page or component. Fix: You must first add a handler using Add Local App Event Handler before you can cancel it.

Why is my Global event handler not firing?

Check the following:

  • The event scope is set to Global.
  • A valid Handler Action Block is assigned in the event configuration.
  • The Action Block parameters match the event’s data type (if the event includes data).

Why is my Local event handler not firing?

Verify the following:

  • The Add Local App Event Handler action is being executed (for example, placed inside On Page Load or On Component Load).
  • The event scope is set to Local, since global events will not appear in the local handler dropdown.
  • The page or component listening for the event is still active and mounted (has not been navigated away from).

Why are events firing in an unexpected order?

App Events are processed sequentially through an event queue. If Wait for Completion is enabled (true), each event finishes handling before the next one starts. If the order seems unexpected, check whether some triggers have Wait for Completion set to false, which allows subsequent events to start before the previous event finishes. **Also note** that global events are processed sequentially through a queue, while local events are broadcast immediately to all active subscribers and do not go through the queue.

# AI Agent > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/ai-agent Use AI Agent from the FlutterFlow Studio desktop app to set up supported AI agent CLI tools, connect them to your project, and build with natural-language prompts. AI Agent lets you work with AI coding agents directly from the FlutterFlow Studio desktop app. Instead of manually opening a terminal, navigating to your project, and configuring command-line tools yourself, FlutterFlow Studio checks the required setup and helps prepare the tools needed to work with your project. After you choose an agent, FlutterFlow Studio launches it with the correct project context. Depending on your selected agent, FlutterFlow Studio may also install or verify the required CLI, initialize or reuse a local FlutterFlow AI workspace, register the FlutterFlow MCP server, and guide the agent through authentication. Once connected, you can describe the change you want, review the agent's plan, and apply updates to your project. The agent works with your FlutterFlow Studio project through the [FlutterFlow CLI](https://docs.flutterflow.io/flutterflow-cli) and the same agent workflow described in [Build with AI Agents](https://docs.flutterflow.io/flutterflow-cli/build). :::note[Desktop app only] AI Agent is available only in the FlutterFlow Studio desktop app. It is not available in browser-based FlutterFlow Studio. To use AI Agent, download the [**FlutterFlow Studio desktop app**](https://flutterflow.io/desktop). ::: :::note[Different from in-app AI Agents] This page is about using external AI coding agents to build and edit your FlutterFlow Studio project. If you want to create AI-powered chat, text-to-speech, speech-to-text, image generation, or video generation experiences inside your app, see [**AI Agents**](https://docs.flutterflow.io/integrations/ai-agents). ::: AI Agent is useful for project editing tasks such as: - Creating or updating pages and components - Adjusting widget properties, layout, styling, and responsiveness - Wiring actions, action blocks, app state, and app events - Updating theme values, design tokens, and navigation - Reviewing project structure and finding issues - Applying focused changes to a specific widget with Copy AI Selector For more details about what agents can and cannot edit, see [Agent Edit Scope](https://docs.flutterflow.io/flutterflow-cli/build#agent-edit-scope). ## Prerequisites Before using AI Agent, make sure you have: - The [FlutterFlow Studio desktop app](https://flutterflow.io/desktop) installed and signed in. - An account with the provider of your selected agent, such as a ChatGPT account for **Codex** or an Anthropic account for **Claude**. ## Set Up AI Agent When you open AI Agent for the first time, FlutterFlow Studio checks whether the required tools are ready for the selected agent. :::note You do not need to download a separate AI agent desktop app before getting started. The setup panel checks the required CLI tools for the selected agent and lets you install missing tools from the AI Agent setup panel. ::: To set up AI Agent: 1. Open your project in the **FlutterFlow Studio desktop app**. 2. Select the **brain icon** in the toolbar. 3. In the **Set up your AI agent** panel, choose **Claude** or **Codex**. 4. Review the setup checklist. FlutterFlow Studio checks the selected agent's CLI, Flutter SDK, FlutterFlow CLI, local workspace, and sign-in status. 5. If any required CLI tools are missing, click **Install required tools**. 6. After installing tools or signing in, click **Re-check** to refresh the setup status. 7. When prompted, sign in with the account for the selected agent, such as your Anthropic account for Claude or your ChatGPT account for Codex. The selected agent runs on your own account and follows that account's usage and limits. The coding CLI runs locally on your computer and sends prompts, relevant project context, and model responses through your selected agent provider. Data handling and retention follow your provider account's policies and data controls. FlutterFlow Studio does not receive or store your conversations.

## Use AI Agent After setup is complete: 1. Describe what you want the agent to do, such as "Create a profile settings page," "Fix the login button action," or "Update this card to match the new design." 2. Review the agent's proposed changes before applying them. 3. Verify the result visually. :::tip For targeted widget updates, right-click the widget in the builder and select [**Copy AI Selector**](https://docs.flutterflow.io/flutterflow-cli/build#copy-ai-selector). Paste the selector into your prompt so the agent can locate the exact widget you want to update. :::

### Read the Agent's Steps While the agent works, the panel groups its steps by the file or screen they relate to. For longer tasks, related steps appear in grouped rows. Each project change appears in a separate row. Select a row to see the full details of the step, such as the command the agent ran. #### Follow the Agent's Plan When the agent makes a plan for a task, the panel shows it as a checklist that the agent updates as it works. The header reads **Plan** followed by the progress, such as **2 of 5 done**. While the agent works, the checklist stays in view above the status line next to the spinner. Each step shows its status: - **Not started:** An empty circle. - **In progress:** A dot, with the step in bold on a tinted row. - **Done:** A green check, with the step struck through. When the agent finishes, the checklist returns to its original position in the conversation and collapses to one line, such as **Plan 3 of 5 done**. Select the line to expand the steps. Plans in earlier conversations appear the same way. The checklist appears only when the agent sends a plan, so not every task has one. If the agent drops a step from its plan, the step is removed from the checklist and the total step count is updated. #### See What the Agent Is Doing The status line next to the spinner describes what the agent is doing instead of only showing **Working…**. For example: - **Writing pages/home_page.dart…** while the agent edits a file. The path is relative to the agent's workspace. - **Checking the project…** while the agent validates your project. - **Saving to FlutterFlow…** while the agent pushes its changes to your project. - **Saved**, with a green check, after a push finishes successfully. The line stays until the agent starts its next step. The status line also describes steps such as reading files, searching the project, and running tests. When a tool doesn't have a specific status message, the line reads **Using a tool…**. While the agent is thinking or writing its reply, it reads **Working…**. ### Attach Images You can send images to the agent along with your message, such as a screenshot of a design you want to match or a screenshot showing an issue. FlutterFlow Studio supports PNG, JPEG, GIF, and WebP images. To attach an image, use any of these methods: - Paste an image from your clipboard into the prompt box. - Drag an image file onto the prompt box. - Click **Attach files** (the paperclip icon) and select an image. Each image appears in the prompt as an attachment. In the conversation, hover over the attachment to preview the image. ### Run Your App from the Agent You can ask the agent to run your app and check its own changes. For example, ask it to "run my app on the iOS simulator." The agent uses the same [Local Run](https://docs.flutterflow.io/testing/local-run) setup you use to run your app on a device, so Local Run must be set up on your computer. The agent can: - List the devices available to run your app on, then start the app on the one you name. If you don't name a device, the agent uses the one selected in Local Run. - Start an Android emulator or the iOS Simulator when no phone, emulator, or simulator is listed. The iOS Simulator is available only on a Mac. If several emulators are set up, the agent asks which one to start. - Read the app's logs and the runtime errors it reports. - Take a screenshot of the running app. - Hot reload or hot restart the app after it saves changes to your project, and stop the app when you ask. The agent doesn't ask for confirmation before it runs your app. Its run steps are grouped into one row in the conversation, which you can select to see each step. A screenshot of your app appears on its own. Closing the panel or ending the conversation leaves the app running. To stop it, click **Stop** in the Local Run controls, or open the Local Run menu and stop it there. ### Work with Branches The agent works on the branch you have open in the editor. When you switch to another branch, the agent follows you. When the agent wants to work on a different branch, it asks you first. The agent never moves the editor to another branch on its own. #### Switch Branches in the Editor When you open another branch from the branches menu, create a branch, or close a branch, the AI Agent panel stays open and keeps the same conversation. The panel shows **Moving the agent to branch …** while it moves the agent's workspace to the branch. When the move finishes, the conversation shows a **Now on branch …** marker, and a **Branch …** chip appears in the prompt box. The chip identifies the current branch and is included with your next message to the agent. #### Respond to a Branch Request When the agent wants to switch to another branch, a prompt appears above the prompt box. It reads **The agent wants to switch to branch …**. If the agent also asks to create the branch, it reads **The agent wants to create and switch to branch …**. Choose one of the following: - **Switch:** FlutterFlow creates the branch if the agent requested a new one and it doesn't exist yet. It opens the branch in the editor and moves the conversation there. New branches start from the latest commit of your current branch and include your uncommitted changes. This matches creating a branch from the branches menu. A **Branch …** chip confirms the switch and is included with your next message to the agent. - **Not now:** The agent stays on the current branch. A **Branch switch declined** chip records your decision and is included with your next message to the agent. #### Unpushed Edits If the agent has edited page files in its workspace and hasn't pushed them to your project, switching branches would discard those edits. In that case, the prompt reads **The agent has unpushed edits** and lists the affected files. The editor stays on the current branch until you choose one of the following: - **Not now:** Stay on the current branch. You can ask the agent to push its edits first, and then switch. - **Discard and switch:** Discard the unpushed edits and move to the other branch. - **Try again:** Check the workspace for unpushed edits again, for example after the agent has pushed them, and then switch. If FlutterFlow can't switch, the prompt reads **Couldn't switch to branch …** with the reason. Select **Try again** to retry, or **Not now** to stay where you are. :::note If the AI Agent panel is open in a separate window, you can see and decline a branch request, but **Switch** is unavailable. Dock the panel back into the editor to switch branches. Switching branches in the editor while the panel is in a separate window closes that window. ::: ### Move the Panel By default, the AI Agent panel is docked on the right side of the editor. To move it, follow these steps: 1. Click the **Open in separate window** icon in the panel header. 2. Click and hold the header of the separate window, then drag it to the position you want. When Test Mode is open, it makes room beside the panel instead of opening underneath it. If the support chat bubble is visible, it moves beside the panel while the panel is open. ## Settings Select the **Settings** icon in the AI Agent panel to manage how FlutterFlow Studio connects to local agents, stores workspaces, and opens sessions. - **Workspace location:** Shows where FlutterFlow Studio creates the agent's local workspaces and displays the current workspace for the open project. - **Claude:** Lets you sign in to Claude and review the permissions that control which tools Claude can run without asking each time. You can open the Claude permissions file at `~/.claude/settings.json`. - **Codex:** Shows your signed-in ChatGPT account, plan, and current usage limits as reported by the Codex CLI. You can also log out from here. - **Codex permissions:** Lets you review the permissions that control which tools Codex can run without asking each time. You can open the Codex permissions file at `~/.codex/config.toml`. - **Interface:** Sets how the agent edits the open project in new conversations, either **fft** or **FlutterFlow AI SDK**. It's **fft** by default, which gives the agent your project as Dart-syntax files and the `fft` CLI. Each interface has its own workspace. A conversation stays in the interface it started in, so changing the setting doesn't affect the open conversation, and conversations from both interfaces stay in the conversation list. This setting applies per project and is available on both macOS and Windows. - **Terminal:** Selects which terminal app FlutterFlow Studio uses when you choose **Open in terminal** to resume an agent session. - **Show conversation recap:** Turns the conversation recap on or off. When enabled, FlutterFlow Studio shows a one-line recap above the prompt after a few exchanges in a thread. - **Voice dictation:** Turns dictation on or off. It's on by default, so you can dictate prompts with the mic button or by holding Space in the prompt box. When you turn it off, FlutterFlow Studio hides the mic button, and Space always types a space. Turning it off also hides **Send when Space is released** and **Send when a recording is stopped**, which control whether a dictated message sends automatically. - **Troubleshooting:** Lets you download diagnostic logs for AI Agent setup and conversations, including tool installs, workspace initialization, CLI launches, and errors. Conversations and personal data are not included in these logs. - **Privacy:** Confirms that the coding CLI runs locally and that conversations are handled according to your selected agent provider's policies and data controls. FlutterFlow Studio does not receive or store your conversations. :::tip If the setup status does not update after installing tools or signing in, click **Re-check**. If it still does not update, restart the FlutterFlow Studio desktop app and open the AI Agent panel again. ::: ## Best Practices - Be specific about the outcome you want, not just the widget you want changed. - Use **Copy AI Selector** when multiple widgets look similar or when the target widget is deeply nested. - Ask the agent to inspect the current project before making broad changes. - Review changes in the visual builder before continuing with additional prompts. - Keep a [Live Session](https://docs.flutterflow.io/flutterflow-cli/build#live-sessions) running only while you are actively using it. # FlutterFlow CLI > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-cli Learn how to download and manage your FlutterFlow Studio projects locally using the FlutterFlow CLI. The [FlutterFlow CLI](https://pub.dev/packages/flutterflow_cli) lets you manage FlutterFlow Studio projects from the command line. You can create new projects, modify existing ones using AI agents, and download them to your local machine. ## Installation To use the FlutterFlow CLI, you first need to install it globally using Dart's package manager with the following command: ``` dart pub global activate flutterflow_cli ``` ### Get API Token To use the CLI, you'll need to create an API token and use it in your requests. See the documentation [here on how to generate an API token.](https://docs.flutterflow.io/accounts-billing/account-management#how-do-i-generate-an-api-token) :::tip[Building with Codex?] Install the FlutterFlow Studio plugin for secure onboarding and a guided create, edit, and export workflow. See [Build with Codex](https://docs.flutterflow.io/flutterflow-cli/codex). ::: ## FAQ
I am getting an error as FormatException: Missing argument for…

This error likely indicates that you haven't correctly entered the command option along with its value. Double-check that all required information has been entered. If everything is correct and you're still encountering the error, it might be due to using an outdated version of the FlutterFlow CLI. To resolve this, you can update to the latest version by running the installation command: ``` dart pub global activate flutterflow_cli ``` This should update the CLI and fix the issue.

# Exporting Projects > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-cli/exporting Learn how to download and manage your FlutterFlow Studio projects locally using the FlutterFlow CLI. Follow the steps below to export your project.

### Command Details - If you wish to exclude assets from the download, use `-no-include-assets` in your command. This will download the project code without the assets. For example: `flutterflow export-code --project your_project_id --dest path_to_output_folde --no-include-assets --token your_token` - You can download code from a specific branch by switching to that branch and using the toolbar command, or by including the `-branch-name` or `-b` flag in your command and specifying the branch you wish to download from. #### All supported command options | Flag | Behavior | Default | | --- | --- | --- | | --dest / -d | Specifies a destination folder other than the current directory. | Current directory | | --[no]-include-assets | Option to download assets (images, GIFs). Useful for consecutive code exports if the assets folder hasn't changed. | False | | --branch-name / -b | Downloads from a specific branch. | Main | | --[no]-fix | Option to run dart fix on the code after downloading. | False | | --[no]-parent-folder | Option to download the code into a subfolder instead of directly into the directory. | False | | --[no]-as-module | Whether to generate the project as a Flutter module. | False | | --[no]-as-debug | Whether to generate the project with debug logging to be able to use FlutterFlow Studio Debug Panel inside the DevTools. | False | | --project-environment | Which [development environment](https://docs.flutterflow.io/testing/dev-environments) to be used. If empty, the current environment in the project will be downloaded. | Current environment | ### Filtered exports If you are updating an existing project and do not want certain files to be overwritten during a code export, you can create a `.flutterflowignore` file in the root of your project directory. This file should contain a list of files to be ignored using globbing syntax. #### Example: If your project is located at: ``` /Users/yourname/projects/my_flutterflow_app/ ``` Then, place the `.flutterflowignore` file in: ``` /Users/yourname/projects/.flutterflowignore ``` #### Example `.flutterflowignore` contents: ``` my_flutterflow_app/android/app/build.gradle # Prevents FlutterFlow from overwriting native Android build configuration my_flutterflow_app/ios/Runner/Info.plist # Keeps iOS app metadata unchanged my_flutterflow_app/web/index.html # Ensures custom modifications to the web entry file are retained ``` This ensures that the specified files and directories are not overwritten during code export. For more details on globbing syntax, refer to [this guide](https://pub.dev/packages/glob#syntax). ## FAQ
I am getting an error as FormatException: Missing argument for…

This error likely indicates that you haven't correctly entered the command option along with its value. Double-check that all required information has been entered. If everything is correct and you're still encountering the error, it might be due to using an outdated version of the FlutterFlow CLI. To resolve this, you can update to the latest version by running the installation command: ``` dart pub global activate flutterflow_cli ``` This should update the CLI and fix the issue.

# Build with AI Agents > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-cli/build Create and edit FlutterFlow Studio projects from your terminal using your preferred AI coding agent. The [FlutterFlow CLI](https://pub.dev/packages/flutterflow_cli) lets you create and edit FlutterFlow Studio apps from the terminal using your own AI coding agent, such as Claude Code, Gemini CLI, Codex, or any MCP-compatible client. You describe what you want in plain English, the agent plans and applies the changes, and the result lands as a real FlutterFlow Studio project you can open in the visual builder. A FlutterFlow Studio project is the source of truth. The CLI is how you create or edit it from your local workspace. If you use Codex, see [Build with Codex](https://docs.flutterflow.io/flutterflow-cli/codex) for the FlutterFlow Studio plugin installation, secure authentication flow, and Codex-specific troubleshooting. ![flutterflow-cli-ff-builder-using-same-ff-app](https://docs.flutterflow.io/assets/images/flutterflow-ff-builder-using-same-ff-app-ec46b7dc9dab6a03f2766eca594ffa83.avif) ## Architecture `flutterflow ai init` creates a local **workspace** - a folder pre-configured with an MCP config file pointing at the FlutterFlow MCP server. When you launch your AI agent inside that folder, it discovers the MCP server and gains a set of tools that talk to FlutterFlow Studio's cloud: 1. You prompt the agent. 2. The agent plans changes and calls the MCP server's tools. 3. The MCP server applies those changes to your FlutterFlow Studio project. 4. You verify the result in the FlutterFlow Studio visual builder. The workspace is just a folder on your disk. The actual project lives in FlutterFlow Studio server. :::tip[What is MCP?] The [**Model Context Protocol**](https://modelcontextprotocol.io) is an open standard that lets AI agents call external tools. The FlutterFlow AI MCP server exposes FlutterFlow Studio's project APIs to your agent so it can read and modify your project on your behalf. ::: :::note[Remember] - **FlutterFlow CLI is not a replacement for the visual builder.** FlutterFlow Studio is still faster for most visual work. FlutterFlow CLI is for precision, repeatability, and automation. - **FlutterFlow CLI doesn't execute your app.** It produces a FlutterFlow Studio project, which you can test and run inside the FlutterFlow Studio visual builder. ::: :::note[Prerequisites] Before you start, make sure you have: - **FlutterFlow CLI installed.** See [**Installation**](https://docs.flutterflow.io/flutterflow-cli). - **A FlutterFlow Studio API key.** See [**generating an API token**](https://docs.flutterflow.io/accounts-billing/account-management#how-do-i-generate-an-api-token). - **An MCP-compatible AI agent installed locally**, such as [**Claude Code**](https://www.claude.com/product/claude-code), [**Gemini CLI**](https://github.com/google-gemini/gemini-cli), or [**Codex**](https://github.com/openai/codex). - **A FlutterFlow Studio project ID** (only if you're editing an existing project). ::: :::tip[Using Claude Code?] The [**FlutterFlow Studio plugin for Claude Code**](https://docs.flutterflow.io/flutterflow-cli/claude-code) can handle the CLI install and API key setup for you, as an alternative to the manual setup below. ::: ## Setup Workspace Open your terminal in the folder where you want the workspace to live, then run: ```bash flutterflow ai init ``` By default, `flutterflow ai init` targets the production FlutterFlow Studio environment. To initialize a workspace against a non-production environment, pass the environment explicitly: ```bash flutterflow ai init --env beta flutterflow ai init --env enterprise-india ``` This launches an interactive setup wizard. Walk through the prompts: 1. **Workspace name.** A short, lowercase name with no spaces. This becomes the folder name for your project. ``` Workspace name Directory to scaffold the FlutterFlow AI workspace in. > mindfly ``` 2. **Existing project ID.** Press **Enter** with no input to create a new app, or paste an existing project ID to bind the workspace to it. ``` Existing project ID to edit (press Enter to create a new app) > ``` 3. **FlutterFlow Studio API key.** Paste your API key and press **Enter**. Input is masked. 4. **Register MCP server with detected coding CLIs.** The wizard scans your `PATH` and offers to register the FlutterFlow AI MCP server with each agent it finds (Claude Code, Gemini CLI, Codex, OpenCode). Answer `Y` (default) for each one you plan to use. ``` Register FlutterFlow AI MCP server with coding CLIs Detected: claude, gemini, codex Register with claude? [Y/n] ``` 5. **Confirm.** The wizard prints a summary. Review it and press **Enter** (default `Y`) to proceed. ``` Ready to create: Workspace: mindfly Project ID: (none, unlinked) API key: set (***abcd) Base URL: https://api.flutterflow.io (built-in for prod) MCP CLIs: claude, gemini, codex Proceed? [Y/n] ``` When the wizard finishes, you'll have a workspace folder ready for your agent. Depending on which CLIs you registered, the folder will contain one or more of: - `.mcp.json` for Claude Code - `.gemini/settings.json` for Gemini CLI - `.codex/config.toml` for Codex - `opencode.json` for OpenCode Each file points the corresponding agent at the FlutterFlow AI MCP server.

## Launch your Agent Move into the workspace and start your agent. The example below uses Claude Code; the same pattern applies to any agent you registered in the wizard. `cd` into the workspace and launch the agent's CLI. Codex users who installed the FlutterFlow Studio plugin should start a new Codex task from this workspace. See [Build with Codex](https://docs.flutterflow.io/flutterflow-cli/codex#choose-your-codex-surface). ```bash cd mindfly claude ``` The first time the agent opens the workspace, it detects the new MCP server and asks you to approve it. The exact prompt varies by agent. Claude Code's looks like this: ``` New MCP server found in .mcp.json: flutterflow_ai MCP servers may execute code or access system resources. All tool calls require approval. > 1. Use this and all future MCP servers in this project 2. Use this MCP server 3. Continue without using this MCP server ``` Choose **option 1** to approve the FlutterFlow AI MCP server (and any others added to this workspace later) without being asked again. > **Why approve?** Without the MCP server, the agent can edit local files but can't push changes to your FlutterFlow Studio project. With it approved, the agent has the same tools you'd run yourself from the CLI.

## Generate a New App With the agent connected, describe the app you want at the prompt: ``` > create a minimalist meditation app ``` Phrase it however you like: `a recipe-sharing app with a social feed`, `a habit tracker with streaks`, `a tip calculator for restaurants`. The agent plans the app, generates the changes, pushes them to FlutterFlow Studio through the MCP server, and reports back. Open FlutterFlow Studio in your browser and navigate to the project. The generated app will be reflected in the visual builder. From there you can keep refining visually or send another prompt to the agent. Once the app exists, the workspace is bound to it. Follow-up prompts in the same session are treated as edits, not new generations, you'll see the agent acknowledge the switch with something like: ``` The project is bound, so I'll switch to edit mode. Let me check the workspace and read the edit template. ``` From that point on, the same rules apply as when [editing an existing project](#edit-an-existing-project) - concurrency, branches, scope, and refreshing context.

## Edit an Existing Project :::note[Prerequisite] Have your **project ID** ready. Open the project in the FlutterFlow Studio editor. The project ID is the path segment after `/project/` in the URL. ::: Editing an existing project follows the same flow as [creating a new one](#setup-workspace). You run `flutterflow ai init` to scaffold a workspace, then drive changes from your agent. The only difference is one step in the wizard: when it asks for an **existing project ID**, paste yours instead of pressing Enter: ``` Existing project ID to edit (press Enter to create a new app) > mindfly-c9lbgr ``` The workspace is now bound to that project. `cd` into the workspace folder, [launch your agent](#launch-your-agent), and describe the changes you want, such as "add a profile screen", "switch the primary color to teal", or "wire up the login form to Firebase Auth". The agent reads the current project, plans the change, and pushes it through the MCP server. Open FlutterFlow Studio in your browser to verify. :::caution[Pinned projects] The FlutterFlow AI SDK writes project data in the format of the latest FlutterFlow Studio version, which a project pinned to an older version can't open. The SDK works on a pinned project only when the project is pinned to the latest stable FlutterFlow Studio version. For any other pin, pulls, pushes, and other SDK requests fail with an error that names the pinned version. This includes a project pinned to an older version and a project pinned to **Next stable release**. It also applies to a branch when its main project is pinned. To use the SDK on such a project, open **Settings & Integrations > App Details**, and then set **Pinned FlutterFlow Studio Version** to the latest stable version or to **Latest Version (Unpinned)**. For more information, see [**Pinned FlutterFlow Studio Version**](https://docs.flutterflow.io/resources/projects/settings/flutterflow-version-management). Only project members see this error. If a request fails because of a pinned project, your agent doesn't retry it or fall back to another command, because those requests are refused too. A merge that you started before the project was pinned can still be aborted. If a project's pin changes while a request is running, the request isn't applied. Run it again. :::

### Copy AI Selector You can right-click any widget in the builder and select **Copy AI Selector** when you want the agent to update a specific widget in your app. This copies a precise location for the selected widget, which you can paste into your prompt so the agent knows exactly which widget to inspect or modify. This is helpful when a page has repeated widgets, nested components, or similar labels. Instead of describing the widget only by its position or text, you can give the agent the copied selector value and ask for a targeted change, such as updating that widget's style, action, visibility, or data binding.

### Concurrent Edits with Builder You can edit visually while an agent is working, but writes use **optimistic concurrency**: when the agent pushes, the server checks the project's last-modified timestamp against the agent's snapshot. If anyone else (you in the visual builder, a teammate, or another agent) modified the project in between, the push is rejected. The agent will re-read the latest state and retry. This may also mean re-planning if your change conflicts with what it was about to do. So nothing gets silently overwritten, but expect occasional retries when you and the agent are editing the same project at once. ### Agent Edit Scope **In scope** - Pages, components, app state, theme, navigation, action blocks, app events - Custom functions, actions, widgets, classes, and enums - API endpoints, queries, custom data types and enums - Pub and library dependencies, design tokens, GenUI catalog, Firebase Auth wiring - [Native config files](#native-config-files), such as `AndroidManifest.xml`, `Info.plist`, and the `Podfile`. Unlocking or relocking a file always needs your approval. **Out of scope** - Anything outside the FlutterFlow Studio project itself, such as running the app, deploying it, creating Firebase projects, managing secrets, or handling App Store submissions. ### Refreshing Stale Context If you've made visual edits since the agent last read the project, the agent's local snapshot is stale. Two ways to fix it: - **Ask the agent to refresh.** Most agents call the [`refresh-context`](#mcp-tools) tool on their own when they detect drift, but you can prompt explicitly: "refresh the project context." - **Run it from the CLI.** `flutterflow ai context-check` reports whether the local snapshot is behind, and `flutterflow ai refresh-context ` pulls the latest. See [MCP tools](#mcp-tools) for the full command list. ## Live Sessions Live Sessions let your AI agent apply changes to a running FlutterFlow Studio app and display those updates directly on the connected device. This is useful when you want to iterate quickly. You can ask the agent to update screens, fix issues, inspect logs, trigger hot reloads or hot restarts, capture screenshots, and then immediately review the results on your running devices. To use Live Sessions, run your app from the FlutterFlow Studio desktop app on a connected device or simulator, then activate your agent. Once the live session starts, confirm its status in the desktop app, ask the agent to make changes, and review those updates as they appear in the running app. :::note Keep the desktop app and the running app session open for as long as you want live updates to continue. :::

## Native Config Files Your agent can edit the same native [**Configuration Files**](https://docs.flutterflow.io/concepts/custom-code/configuration-files) that you edit in the **Custom Code** section of the editor: `AndroidManifest.xml`, `build.gradle`, `proguard-rules.pro`, `MainActivity.kt`, `Info.plist`, `Runner.entitlements`, `AppDelegate.swift`, and the `Podfile`. Each file is either locked or unlocked: - **Locked**: FlutterFlow Studio generates the file. The agent adds snippets at the places the editor offers for that file, and creates file-level variables for any `{{variableName}}` placeholders the snippets use. A variable's value is either text or one of your app constants. `MainActivity.kt` and the `Podfile` have no snippet places, so the agent can change them only after you unlock them. - **Unlocked**: your project owns the whole file, and FlutterFlow Studio stops updating it when you add integrations later. The agent can replace the file's content, but FlutterFlow Studio doesn't apply snippets to an unlocked file. If a snippet uses a `{{variableName}}` placeholder that the agent didn't declare as a variable, the run fails. The editor, by comparison, creates an empty variable for you. ### Approve Unlocking and Locking The editor asks you to confirm before it unlocks or locks a file. The agent follows the same rule: a `run` never changes whether a file is locked, and the agent can't unlock a file to get around an error. If the agent needs to change an entire locked file, it prefers a snippet and otherwise asks you to unlock the file. :::caution Unlocking a file means you manage it yourself, and it can diverge when you add new integrations. Locking a file discards the content your project owns and goes back to the version FlutterFlow Studio generates. Snippets and variables are kept. ::: You can approve a change in either of these ways: - **Run the command yourself.** `flutterflow ai native-file unlock FILE` and `flutterflow ai native-file lock FILE` print what the change does and ask `Continue? [y/N]`. An unlock starts the file from the content FlutterFlow Studio generated, so the result matches unlocking it in the editor. Add `--yes` only if you run the command in a terminal that can't ask you a question. Without `--yes`, the command refuses to run there. Don't let an agent pass `--yes`. - **Approve the agent's tool call.** The `native_file.unlock` and `native_file.lock` tools run only after you approve the call in your agent. When a file has content that a lock would discard, the agent first shows you that content. It locks the file only after you confirm and approve a second call. If a teammate saves the file in between, the agent shows you the new content and asks again. To check the state of your files, run these read-only commands, or ask your agent to: ``` flutterflow ai native-file list flutterflow ai native-file show Podfile ``` `list` shows whether each file is locked and how many snippets and variables it has. `show` lists a file's snippets and variables, and prints the content the way the editor shows it, with `{{variableName}}` placeholders left in place. Both commands default to the workspace project. Pass a project ID after the file name to use a different one. :::note Customizing a native file for the first time, whether by adding a snippet or a variable or by unlocking it, needs a paid plan, the same as in the editor. On the Free plan, the agent's push fails. Files that you already customized stay editable. ::: ## Investigate Project Activity When a project behaves unexpectedly, ask your agent to retrieve the project's activity logs and identify changes that might explain the issue. The agent calls the read-only `activity_logs` tool with: - `projectId`: The ID of the project. - `startTime` and `endTime` (optional): The inclusive time range to retrieve. Each value is an ISO 8601 timestamp that ends with `Z` or includes a timezone offset, such as `2026-10-07T10:00:00+04:00`. If you omit `startTime`, there is no start-time limit. If you omit `endTime`, there is no end-time limit. For example, replace `PROJECT_ID` with your project's ID in this prompt: "Retrieve the activity logs for project `PROJECT_ID` between 10:00 and 11:00 on October 7, 2026 (UTC+4), and explain what changed on the Home page." The tool uses your FlutterFlow Studio API key and works with any project you have read access to, including projects where you're a read-only collaborator. It doesn't need an initialized workspace. The result is JSON that contains: - An activity timeline with a description of each edit, its source (editor, SDK, or hosted agent), and whether it was an undo or redo. - Whether each recorded update was applied. - The fields that each update changed, with their values before and after the update. - Markers for history that isn't available. Free-form text and binary values are redacted, so the result doesn't include text that people typed into the project. If the result is large, the tool saves it to a JSON file in the `.flutterflow_ai/cache/activity_logs/` folder of your workspace and returns the file's path. Ask your agent to read that file. :::note - Activity logs record changes that reached FlutterFlow Studio. They don't include rejected requests or conversations between you and your agent. - Older entries don't have change details, and the result marks them as not recorded. History beyond its retention period is marked as expired or missing. - The SDK source indicates how a change was submitted, not whether a person or an AI agent decided to make it. ::: ## Branches and Rollback The CLI can point to any branch of a FlutterFlow Studio project. Since each branch is accessed through its own URL, it has its own project ID. To work on a specific branch, open it in the FlutterFlow Studio editor, copy the project ID from the URL, and paste it when `flutterflow ai init` prompts for an existing project ID. To roll back, use FlutterFlow Studio's project version history in the visual builder, which is the same mechanism used for visual edits. Each agent push lands as a commit there with whatever commit message the agent supplied. ## Working with Libraries A workspace has one **primary project** and can also track the [library projects](https://docs.flutterflow.io/resources/projects/libraries) that the primary project depends on. Your agent can then edit a library and the app that uses it from the same workspace. When you run `flutterflow ai init` with an existing project ID, the CLI downloads every library the project depends on, including libraries that other libraries depend on. Each library gets its own folder under `libraries/`, with its own `dsl/`, `generated_code/`, and `PROJECT_CONTEXT.md`. The primary project keeps the workspace root. ``` workspace/ ├── dsl/ (primary project) ├── generated_code/ (primary project) ├── PROJECT_CONTEXT.md (primary project) └── libraries/ ├── auth_kit/ │ ├── dsl/ │ ├── generated_code/ │ └── PROJECT_CONTEXT.md └── design_system/ ``` To change which libraries `init` downloads, pass `--with-libraries`: | Value | Libraries downloaded | | --- | --- | | `auto` or `all` (default) | All libraries, including nested ones. | | `direct` | Only libraries the primary project depends on directly. | | `none` | No libraries. | | `ID_1,ID_2` | Only the libraries with these project IDs. | ### Choose Which Project a Command Changes The `run`, `validate`, `refresh-context`, `codegen refresh`, and `status` commands accept a `--target` flag: - `--target primary` (default) uses the primary project. - `--target lib:NAME_OR_ID` uses the library with that local folder name or project ID. If the library can't be found in the workspace, the command fails instead of falling back to the primary project. Pass `--all` to `refresh-context` or `codegen refresh` to refresh the primary project and every library at once. ``` flutterflow ai run libraries/design_system/dsl/edit.dart --target lib:design_system flutterflow ai refresh-context --all ``` The `run` and `validate` tools that your agent calls through the MCP server also accept a `target` argument. ### Manage Library Dependencies Use these commands to change which libraries the primary project depends on: | Command | What it does | | --- | --- | | `add-library LIBRARY_PROJECT_ID` | Adds the library as a dependency and downloads it. Use `--name` to set the local folder name and `--version` to pin a version. | | `remove-library NAME_OR_ID` | Removes the dependency. Use `--keep-files` to leave the `libraries/` folder on disk. | | `update-library NAME_OR_ID --version VERSION` | Changes the pinned version and downloads it again. | | `publish-library --version VERSION` | Publishes a new library version from the current state of the target project. Use `--target lib:NAME_OR_ID` to publish a library, `--description` to add a description, and `--and-update-primary` to also pin the primary project to the new version. | | `library-versions` | Lists published versions, newest first, and marks the version the primary project uses. | To create a library from the CLI, run `flutterflow ai create-project --name NAME --library`. Add `--attach` to also add the new library as a dependency of the primary project. To make the primary project of a new workspace a library, run `flutterflow ai init --as-library`. ### Frozen and Live Version Pins A library dependency is pinned to a version in one of two ways. The pin decides whether your edits to a library reach the primary project: - **Frozen**: a version number such as `1.3.0`. The primary project keeps using that published snapshot. Publish a new version and update the pin to pick up library changes. - **Live**: `current` or `latest`. The primary project uses the library's latest saved state, so edits to the library appear in the primary project right away. `flutterflow ai status` shows `(live)` or `(frozen)` next to each library. If you run `add-library` without `--version`, the dependency is pinned to the highest published version, which is frozen. To iterate on a library and an app together, switch the dependency to a live pin: ``` flutterflow ai update-library design_system --version current ``` When the library is ready, publish it and update the primary project in one step: ``` flutterflow ai publish-library --version 1.3.0 --target lib:design_system --and-update-primary ``` :::note Publishing requires a paid plan and access to branching, the same as publishing a library from the editor. See [Libraries](https://docs.flutterflow.io/resources/projects/libraries#publishing-a-library) for the requirements. ::: :::caution Publishing a project marks it as a library permanently. For this reason, `publish-library` refuses to publish the primary project unless you created the workspace with `--as-library` or you pass `--allow-primary`. `--and-update-primary` works only for libraries the primary project depends on directly, not for nested ones. ::: ### Manage Libraries from the MCP Server Your agent can run the whole library lifecycle through the MCP server, without the CLI. Each tool runs the matching command, so it applies the same checks and updates your workspace and the `libraries/` folder the same way. | Tool | Command it runs | Arguments | | --- | --- | --- | | `library.create` | `create-project --library` | `name`, and optionally `attach` and `team`. | | `library.add` | `add-library` | `libraryProjectId`, and optionally `name` and `version`. | | `library.update` | `update-library` | `library` and `version`. | | `library.remove` | `remove-library` | `library`, and optionally `keepFiles`. | | `library.publish` | `publish-library` | `version` and `userPrompts`, and optionally `target`, `description`, `andUpdatePrimary`, and `allowPrimary`. | | `library.versions` | `library-versions` | Optionally `target` and `limit`. | - `library.create` creates a permanent project, so your agent asks for your approval first. It never prompts for a team. If your account can place the project in more than one team, the call fails and lists the choices, and the agent calls it again with `team`. If you set `attach`, the library is added to the primary project pinned to `current`. If the attach fails, the call returns an error, but the library project already exists, so the agent shouldn't create it again. After a successful attach, the agent calls `library.add` to download the library's files. - `library.add` accepts a `version` that is `MAJOR.MINOR.PATCH` or `current`. It refuses any other value before the command runs. - `library.publish` needs your approval and refuses to run without `userPrompts`, which must hold your own words asking to publish. The prompts aren't saved with the published version. The same rules as `publish-library` apply, including the refusal to publish the primary project unless you created the workspace with `--as-library` or the agent passes `allowPrimary`. - `library.versions` only reads, so it needs no approval. An agent that works only through MCP can update a library and the app together. It sets the dependency to `current` with `library.update`, edits the library and runs the changes with `target` set to `lib:NAME`, and then calls `library.publish` with `target` set to `lib:NAME` and `andUpdatePrimary` set to `true`. ## Publish to FlutterFlow Hosting Your agent can publish your project to its FlutterFlow-hosted web address, the same as **Publish** in [Web Publishing](https://docs.flutterflow.io/deployment/web-publishing). The `web-publish` command and the `web_publish.start` and `web_publish.status` MCP tools do this. :::caution Publishing replaces your live website. Ask your agent to publish only when you want it to. The `run` command pushes changes to your project but never publishes it. ::: | Command | What it does | | --- | --- | | `web-publish start` | Publishes the project as saved in FlutterFlow Studio, so push your changes first. Add `--env KEY` to choose an environment, `--no-custom-domain` to skip your custom domain, and `--wait` to follow the publish until it ends. | | `web-publish status --request ID` | Reports whether the publish is `queued`, `running`, `succeeded`, `failed`, or `timed_out`. Without `--request`, it reports the latest publish of the environment. Add `--wait` to follow the publish. | Both commands accept `--json`. Both also take a project ID, and use the workspace's primary project if you leave it out. `start` returns as soon as the build is queued. A queued build isn't a finished publish, because the build takes several minutes. The status shows the live URLs only after the publish succeeded. If it failed, the status includes the build error and a hint. With `--wait`, the command exits with code 0 only if the publish succeeded. It stops waiting if the publish still hasn't finished 15 minutes after the request, and the publish might still finish. A publish that is running, failed, or timed out might have updated part of your live site. Check the live URL before you assume the site is unchanged. The publish is refused if: - Web isn't enabled for the project, or the project has errors that block a build. - The project uses Firestore or Firebase Authentication and has no **Firebase Web Config** set in its Firebase settings. - The project uses Razorpay in production mode. - A publish to the same project and environment is already running. The error includes its request ID so you can follow that one. - You don't have editor access to the project, or to the main project when you publish a branch. A branch publishes to the main project's subdomain. The subdomain must already be reserved. The CLI and MCP server don't reserve subdomains, so publish once from **Web Publishing** in FlutterFlow Studio first. ## Switching Projects A workspace has one primary project, plus any libraries it tracks. To work on a different app, run `flutterflow ai init` in a **new** folder and link it to the new project ID. `init` refuses to run in a non-empty directory, so it won't re-bind an existing workspace. ## MCP tools Run these from inside a FlutterFlow AI workspace. Your agent calls them via the MCP server; you can also run them directly in the terminal. | Category | Command | What it does | | --- | --- | --- | | **Build** | `run` | Apply changes to your FlutterFlow Studio project. | | | `validate` | Dry-run a change without pushing it. | | **Explore** | `inspect` | Whole-project summary or a scoped view of structure. | | | `resources` | List reusable project and library resources. | | | `search` | Search the project for a name or identifier. | | | `status` | Show workspace and project state. | | **AI integration** | `mcp` | Register the FlutterFlow MCP server with Claude Code, Codex, Gemini CLI, Cursor, Copilot, and other MCP-aware clients. | | **Native files** | `native-file` | List, show, unlock, or lock the project's [native config files](#native-config-files). | | **Publish** | `web-publish` | [Publish to FlutterFlow hosting](#publish-to-flutterflow-hosting) and check the result. | | **Plan & audit** | `plan` | Capture intent before a run. | | | `trace` | Replay a prior run. | | | `history` | List prior commands and outcomes. | | | `activity_logs` | Retrieve a project's [activity logs](#investigate-project-activity) for a time range. | | **Diagnose** | `doctor` | Check for common workspace problems. | | | `context-check` | Report whether the local snapshot is behind the live project. | | | `precache` | Pre-load project context. | | **Stay current** | `upgrade` | Update the FlutterFlow CLI tooling. | | | `refresh-workspace` | Refresh the workspace's local config. | | | `refresh-context` | Pull the latest project state into the local snapshot. | | **Learn** | `docs [topic]` | Open FlutterFlow AI documentation for a topic. | Run `flutterflow ai --help` from inside a workspace for the full command list and per-command flags. When the agent invokes a command via MCP, every call is subject to your agent's approval rules. # Build with Codex > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-cli/codex Use the FlutterFlow Studio plugin in Codex CLI or the ChatGPT desktop app to create, edit, and export FlutterFlow Studio projects with natural-language prompts. The [FlutterFlow Studio plugin for Codex](https://github.com/FlutterFlow/flutterflow-codex) lets you create and edit FlutterFlow Studio projects by describing the outcome you want in plain language. The plugin guides Codex through FlutterFlow Studio authentication, workspace setup, project inspection, branch-aware editing, validation, and code export. FlutterFlow/flutterflow-codex Open GitHub ↗ The plugin uses the FlutterFlow CLI and each workspace's project-scoped MCP server. FlutterFlow Studio remains the source of truth for the project, so you can open the result in the visual builder and continue editing there. For the agent-independent architecture and full FlutterFlow AI command list, see [Build with AI Agents](https://docs.flutterflow.io/flutterflow-cli/build). ## Choose your Codex surface The FlutterFlow Studio plugin works in both Codex CLI and Codex inside the [ChatGPT desktop app](https://learn.chatgpt.com/docs/app). The FlutterFlow Studio workflow is the same after installation, but plugin discovery, installation, requirements, and task startup differ between the two surfaces. Follow only the section for the surface you use. FlutterFlow Studio is currently distributed from the [FlutterFlow Codex GitHub repository](https://github.com/FlutterFlow/flutterflow-codex), which contains a single-plugin Codex marketplace. In Codex CLI, you add the GitHub URL and install the plugin with commands. In the ChatGPT desktop app, you open **Plugins** from the main sidebar and add the GitHub marketplace from the **Create** menu. ### Codex CLI Use this path when you run Codex from a terminal. #### Terminal requirements Before you begin, make sure you have: - [Codex CLI](https://learn.chatgpt.com/docs/codex/cli) installed. - [Dart and Flutter](https://docs.flutter.dev/get-started/install) available on your `PATH`. - A FlutterFlow Studio API token available from your [FlutterFlow Studio account](https://app.flutterflow.io/account). You only need to copy it when the plugin asks you to authenticate. Install or update the FlutterFlow CLI: ```bash dart pub global activate flutterflow_cli ``` #### Install in Codex CLI 1. Add the [FlutterFlow Codex GitHub marketplace](https://github.com/FlutterFlow/flutterflow-codex) and install the plugin: ```bash codex plugin marketplace add https://github.com/FlutterFlow/flutterflow-codex --ref main codex plugin add flutterflow@flutterflow ``` 2. Start a new Codex CLI session from the folder where you want to work: ```bash cd /path/to/your/projects codex ``` 3. Enter `/plugins` to open the terminal plugin browser. Confirm that `flutterflow@flutterflow` is installed and enabled. 4. Close the plugin browser and describe the FlutterFlow Studio outcome you want at the prompt. If Codex CLI was already running when you installed or updated the plugin, exit and relaunch it so the new session loads the FlutterFlow Studio skill. ### ChatGPT desktop app (Codex) Use this path when you work with Codex inside the ChatGPT desktop app. #### Desktop requirements Install and open the [ChatGPT desktop app](https://chatgpt.com/download/). You do not need Codex CLI or terminal plugin commands to add the FlutterFlow Studio marketplace in the app. You can install the plugin before configuring FlutterFlow Studio tooling or authentication. When you start your first FlutterFlow Studio task, the plugin checks for Dart, Flutter, and the FlutterFlow CLI, then guides you through anything that is missing. It asks for a FlutterFlow Studio API token only when authentication is required. :::note[Use the main Plugins page] Select **Plugins** from the main Codex sidebar. **Settings > Plugins** manages installed plugins, skills, apps, and MCPs, but it does not provide the **Add marketplace** action. ::: #### Install in the ChatGPT desktop app 1. Select **Plugins** from the main Codex sidebar. ![Codex sidebar with the Plugins option](https://docs.flutterflow.io/assets/images/chatgpt-sidebar-plugins-386fecc653c5150fa4bb621d7c48ac19.png) 2. On the Plugins page, open the **Create** menu and select **Add marketplace**. ![Create menu on the Plugins page with Add marketplace selected](https://docs.flutterflow.io/assets/images/chatgpt-add-marketplace-b9da6a81befa9db25652aae350aad6e9.png) 3. Enter the [FlutterFlow Codex marketplace GitHub URL](https://github.com/FlutterFlow/flutterflow-codex): ```text https://github.com/FlutterFlow/flutterflow-codex ``` 4. Complete the marketplace setup, then open the FlutterFlow Studio plugin's details. 5. Select the plus button on the plugin details page to install it. 6. Start a new Codex task so the FlutterFlow Studio skill loads. 7. Choose the parent folder where Codex should create a new FlutterFlow Studio workspace, or choose an existing FlutterFlow AI workspace if you are continuing work on a project. 8. Describe the FlutterFlow Studio outcome you want in the task composer. After adding the GitHub marketplace, follow OpenAI's [plugin installation flow](https://learn.chatgpt.com/docs/plugins) to open the plugin details, select the plus button, and start a new task. :::note The plugin does not replace the FlutterFlow CLI. It gives Codex a supported workflow for driving the CLI and the workspace-specific FlutterFlow Studio tools. ::: ## Authenticate securely :::note[API token and API key] The FlutterFlow Studio account page calls this credential an **API token**. The FlutterFlow AI workflow also refers to it as an **API key** and uses the `FF_API_KEY` environment variable. Code export and Firebase deployment use the `FLUTTERFLOW_API_TOKEN` environment variable. ::: Authentication works the same way in Codex CLI and the ChatGPT desktop app. You do not need to paste your FlutterFlow Studio API token into the Codex task. When Codex needs authentication, it will ask you to: 1. Open your [FlutterFlow Studio account](https://app.flutterflow.io/account) and copy the API token. 2. Return to Codex and type only `copied`. The plugin then runs its secure clipboard hand-off. It reads the clipboard once, validates the credential format, stores it in a private configuration file with restricted permissions, and clears the live clipboard without displaying the credential. :::caution Never paste a FlutterFlow Studio API token into the chat. Avoid passing it with the `--api-key` command-line option because command arguments can be visible to other processes and the CLI persists that value to credential files. Clipboard-history applications and cross-device clipboard services may retain a copy that the plugin cannot clear. Clear those histories separately if you use them. ::: ## Create a new FlutterFlow Studio app In Codex CLI or the ChatGPT desktop app, start the task from the parent folder where you want the local FlutterFlow Studio workspace, then describe the app you want. For example: > Create a new FlutterFlow Studio app called `habit_tracker`. Make it a minimalist > habit tracker with daily check-ins, streaks, and a weekly progress view. Codex will: 1. Check FlutterFlow Studio authentication. 2. Initialize a version-matched FlutterFlow AI workspace. 3. Read the workspace's generated instructions and typed project SDK. 4. Plan and validate the app before creating the remote FlutterFlow Studio project. 5. Return a link to open the project in FlutterFlow Studio. After the first successful creation, use follow-up prompts in the same workspace to edit the project rather than trying to create it again. ## Edit an existing project If you know the project ID, include it in the prompt: > Edit my FlutterFlow Studio project ``. Add a settings page with profile, > notification, and privacy sections. You can find the project ID in its FlutterFlow Studio editor URL: ```text https://app.flutterflow.io/project/ ``` If you do not know the project ID, ask Codex to help you choose a project. The FlutterFlow CLI provides an interactive searchable project picker: > List my FlutterFlow Studio projects so I can choose which one to edit. Codex creates or reuses a local workspace bound to that project. Before it applies changes, it confirms the active FlutterFlow Studio branch, inspects the current project, and runs the workspace test gate. :::tip[Target a specific widget] In the FlutterFlow Studio builder, right-click a widget and select **Copy AI Selector**. Paste that selector into your prompt when you want Codex to update an exact widget instead of identifying it from its label or position. ::: ## Export Flutter code Ask Codex for the export destination and identify the project: > Export my FlutterFlow Studio project `` to Flutter code in > `./generated_app`. Code export uses the standard FlutterFlow CLI export workflow rather than the AI project-editing workflow. See [Exporting Projects](https://docs.flutterflow.io/flutterflow-cli/exporting) for export options, branch selection, and `.flutterflowignore` behavior. ## What the plugin checks before applying changes For project edits, the plugin guides Codex through these safety checks: - Work inside an initialized workspace containing `.flutterflow/config.yaml`. - Read the workspace's version-matched `AGENTS.md` before authoring changes. - Confirm the active FlutterFlow Studio branch and its project ID. - Inspect the current project and use its typed SDK rather than guessing names. - Run `flutterflow ai test` before applying changes. - Apply changes with an explicit commit message. - Inspect history, trace information, and project context after the operation. Validation failures do not push a change. Failures later in the create, network, conflict, push, or post-push phases may have remote effects, so Codex inspects the result before retrying an operation. ## FlutterFlow MCP in Codex FlutterFlow MCP is project-scoped. When the CLI initializes a workspace, it can write Codex configuration to `.codex/config.toml` for that workspace's vendored FlutterFlow MCP server. Open a new Codex task from the initialized workspace after this configuration is written so the tools load. If MCP tools are unavailable, the plugin can continue through the FlutterFlow CLI instead of blocking the workflow. ## Update the plugin ### Update in Codex CLI Refresh the FlutterFlow Studio marketplace and reinstall the terminal plugin from the updated snapshot: ```bash codex plugin marketplace upgrade flutterflow codex plugin add flutterflow@flutterflow ``` Exit and relaunch Codex CLI, then start a new task. Existing CLI sessions and tasks do not reload an updated plugin bundle. ### Update in the ChatGPT desktop app Open **Plugins** in the ChatGPT desktop app and manage the installed FlutterFlow Studio plugin from there. After installing an updated version, start a new task; already-open tasks do not reload plugin updates. Update the FlutterFlow CLI separately: ```bash dart pub global activate flutterflow_cli ``` ## Troubleshooting
The plugin is not available in Codex CLI Enter `/plugins` and look for `flutterflow@flutterflow`. Confirm that it is installed and enabled. If you installed or updated it while Codex CLI was running, exit and relaunch Codex, then start a new task.
The plugin is not available in the ChatGPT desktop app Open **Plugins** from the main Codex sidebar, not from Settings. Open the **Create** menu and select **Add marketplace**, then add the [FlutterFlow Codex GitHub marketplace](https://github.com/FlutterFlow/flutterflow-codex): ```text https://github.com/FlutterFlow/flutterflow-codex ``` Open the FlutterFlow Studio plugin details and select the plus button to install it. Then start a new task so the FlutterFlow Studio skill loads.
The flutterflow command is not found Install or update the CLI: ```bash dart pub global activate flutterflow_cli ``` Restart your terminal or Codex if the Dart global executable directory was added to `PATH` during installation.
Authentication is missing or rejected Copy a current token from your [FlutterFlow Studio account](https://app.flutterflow.io/account), return to Codex, and type `copied` when the plugin asks. Do not paste the token into the chat. If FlutterFlow Studio rejects a saved credential, generate a replacement token and repeat the secure clipboard hand-off.
Codex cannot find the FlutterFlow Studio workspace Run the task from the initialized workspace directory. Its root contains: ```text .flutterflow/config.yaml ``` Do not initialize a new workspace inside a populated, unrelated directory. If a workspace already exists for the project, open that folder instead of creating another one.
MCP tools do not appear Confirm that the workspace contains `.codex/config.toml`, then start a new Codex task from that workspace. Codex loads project-scoped MCP configuration at the start of a task.
The visual builder changed after Codex inspected the project Ask Codex to refresh the project context before applying another edit: > Refresh the FlutterFlow Studio project context, then re-check the planned change. FlutterFlow Studio uses optimistic concurrency to prevent Codex from silently overwriting a newer visual-builder or teammate edit. See [Concurrent Edits with Builder](https://docs.flutterflow.io/flutterflow-cli/build#concurrent-edits-with-builder) for details.
## Support - Review the [FlutterFlow Codex plugin source and release notes](https://github.com/FlutterFlow/flutterflow-codex). - Report plugin bugs through [FlutterFlow Codex GitHub issues](https://github.com/FlutterFlow/flutterflow-codex/issues). - Run `flutterflow ai docs [topic]` inside an initialized workspace for version-matched FlutterFlow AI reference material. # Claude Code Plugin > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/flutterflow-cli/claude-code Use the FlutterFlow Studio plugin in the Claude Code terminal or desktop app to build and edit FlutterFlow Studio apps with AI, including automatic CLI install, secure API key setup, and a guided build workflow. The **FlutterFlow Studio plugin for [Claude Code](https://www.claude.com/product/claude-code)** packages FlutterFlow Studio's agentic building experience as a Claude Code plugin, and works in both the **Claude Code terminal (CLI)** and the **Claude Code desktop app**. Once installed, it: - **Installs the FlutterFlow CLI automatically** when a session starts. If the Dart SDK is missing, it points you to the installer instead of failing. - **Stores your API key securely** by reading it once from your clipboard, so the key never appears in the chat. - **Adds a guided build skill** (`/flutterflow:build`) that sets up a workspace, then follows an orient → validate → apply workflow for every change. The plugin drives the same [FlutterFlow CLI](https://pub.dev/packages/flutterflow_cli) described in [Build with AI Agents](https://docs.flutterflow.io/flutterflow-cli/build). If you use a different agent (such as Gemini CLI or Codex), or prefer to install the CLI and configure the MCP server yourself, follow that page instead. Both paths produce the same result. :::tip[Open source] The plugin is open source. Browse the code, releases, and issues on GitHub at [FlutterFlow/flutterflow-claude](https://github.com/FlutterFlow/flutterflow-claude). ::: :::note[Prerequisites] Before you start, make sure you have: - **Claude Code** installed and signed in (the terminal CLI, the desktop app, or both). Get them from [claude.com](https://www.claude.com/product/claude-code). - **Git**, which Claude Code uses to install the plugin. - **Dart**, bundled with [Flutter](https://docs.flutter.dev/get-started/install), which the FlutterFlow CLI requires. If it's missing, the plugin detects it and links you to the installer. ::: :::note[Platform support] macOS and Linux work out of the box. On **Windows**, the plugin's automatic setup requires a `bash` on your PATH (from Git Bash or WSL). Without one, install the CLI manually (see [Installation](https://docs.flutterflow.io/flutterflow-cli)) and let `flutterflow ai` prompt for your API key. The CLI itself supports Windows end-to-end. ::: ## Choose Your Claude Code Surface The plugin behaves the same in the Claude Code terminal and the Claude Code desktop app. Only plugin installation and session startup differ. Both surfaces read the same Claude Code configuration, so installing the plugin once makes it available in both. ### Claude Code Terminal (CLI) Use this path when you run `claude` from a terminal. 1. Install the plugin with two slash commands inside a Claude Code session: ``` /plugin marketplace add FlutterFlow/flutterflow-claude /plugin install flutterflow@flutterflow ``` Or run the equivalent commands from your shell: ```bash claude plugin marketplace add FlutterFlow/flutterflow-claude claude plugin install flutterflow@flutterflow ``` 2. Start a new session from the folder where you want to work. This can be an existing FlutterFlow AI workspace or the parent folder where a new one should be created: ```bash cd /path/to/your/projects claude ``` 3. Describe the FlutterFlow Studio outcome you want at the prompt. If Claude Code was already running when you installed the plugin, start a new session so the build skill and automatic setup load. :::note [`FlutterFlow/flutterflow-claude`](https://github.com/FlutterFlow/flutterflow-claude) is the GitHub repository the plugin installs from; `flutterflow` after the `@` is the marketplace name. :::
📸 Image placeholder: terminal install. Screenshot of a Claude Code terminal session after running the two /plugin commands, showing the marketplace added and the confirmation that the flutterflow plugin is installed and enabled.
### Claude Code Desktop App Use this path when you work in the [Claude Code desktop app](https://www.claude.com/product/claude-code) on macOS or Windows. Installation happens entirely in the app, with no terminal commands required. 1. Open the account menu in the lower-left corner of the app and select **Settings**. ![Open Settings from the account menu in the Claude desktop app.](https://docs.flutterflow.io/assets/images/01-open-settings-276e42c1f7fc635ec4155a37f6e3ed4e.png) 2. Under **Customize**, select **Plugins**. ![Open the Plugins settings page under Customize.](https://docs.flutterflow.io/assets/images/02-plugins-settings-1b39f38ce6bb7f1b5bd129f1d58b4f5f.png) 3. Select **Add**, then **Add marketplace**. ![Open the Add menu and select Add marketplace.](https://docs.flutterflow.io/assets/images/03-add-marketplace-7f3d33fdb3eb99750740509dd4f6d5a1.png) 4. In **URL**, enter `https://github.com/FlutterFlow/flutterflow-claude`, then select **Use "https://github.com/FlutterFlow/flutterflow-claude"**. ![Add the FlutterFlow Studio plugin marketplace by its GitHub URL.](https://docs.flutterflow.io/assets/images/04-marketplace-url-2b69a165b3c101dda6efcd21454771e4.png) 5. In the plugin directory, select **Code**. Under the `flutterflow` marketplace, find the **FlutterFlow Studio** plugin and select the **+** button on its card. ![Find the FlutterFlow Studio plugin in the Code directory and select its plus button.](https://docs.flutterflow.io/assets/images/05-install-flutterflow-084f2a256360b4d429ba250be3d896c9.png) 6. Wait for the **FlutterFlow Studio is installed and ready to use.** confirmation. ![Confirmation that FlutterFlow Studio is installed and ready to use.](https://docs.flutterflow.io/assets/images/06-installed-toast-4202bd5fb9f4859bdfea6407a7e6cc51.png) 7. Close Settings, open the **Code** tab, and start a new session. Choose **Local** as the environment, select the folder where you want to work, and describe the FlutterFlow Studio outcome you want in the prompt box. The folder can be an existing FlutterFlow AI workspace or the parent folder where a new one should be created. :::note[Desktop app specifics] - Plugins are available in the desktop app's **Local** and **SSH** sessions, not in cloud or WSL sessions. - The desktop app reads your `PATH` when it launches. If Dart or the FlutterFlow CLI was installed while the app was open and a session can't find them, quit and reopen the app. ::: ## Set Up Your API Key The plugin authenticates with your FlutterFlow Studio API key, and key setup works the same on both surfaces. Until a key is configured, the plugin prints a reminder when a session starts: ``` [flutterflow] No FlutterFlow API key configured. [flutterflow] 1) Copy an API key from https://app.flutterflow.io/account [flutterflow] 2) Come back and tell Claude: "I copied my FlutterFlow API key" ``` **Never paste the API key into the chat**, because conversations are logged and retained. Instead, hand the key over through your clipboard: 1. Open your [FlutterFlow Studio account page](https://app.flutterflow.io/account) and copy your API key. If you don't have one yet, see [generating an API token](https://docs.flutterflow.io/accounts-billing/account-management#how-do-i-generate-an-api-token). 2. Come back to Claude Code and say: **"I copied my FlutterFlow Studio API key"**. Claude runs a script bundled with the plugin that reads the clipboard once, validates the key, stores it in `~/.config/flutterflow/claude-env.sh` with owner-only permissions, and clears the clipboard. The key itself never enters the conversation. If validation fails (for example, you copied something else in the meantime), Claude asks you to copy the key again and retry. :::caution[Clipboard history managers] Tools like Raycast, Alfred, Windows clipboard history (Win + V), and Apple's Universal Clipboard keep their own copy of everything you copy, even after the system clipboard is cleared. If you use one, purge the key from its history after setup. ::: Working over **SSH or in a headless environment**? The clipboard hand-off isn't available there, so Claude offers a one-line terminal command that prompts for the key with hidden input. Alternatively, run `flutterflow ai` in your own terminal and let its setup wizard prompt for the key. :::note Avoid entering the key through `/plugin configure` for now, because its input dialog has known issues in current Claude Code versions ([#73530](https://github.com/anthropics/claude-code/issues/73530), [#62442](https://github.com/anthropics/claude-code/issues/62442)). The clipboard hand-off above is the recommended path. ::: ## Build with FlutterFlow Studio Start a new Claude Code session in your working folder: `claude` in the terminal, or a **Local** session in the desktop app. On the first session after setup, the plugin installs the FlutterFlow CLI automatically and prints a notice while it works: ``` [flutterflow] Installing the FlutterFlow CLI… ``` After that, describe what you want to build. The build skill triggers on FlutterFlow Studio tasks, or you can invoke it explicitly with `/flutterflow:build`: ``` > Create a FlutterFlow app for tracking daily habits > Add a profile page with an avatar, display name, and a settings list > Change the primary color to teal and update the home page title ``` Under the hood, the skill follows a disciplined workflow: 1. **Workspace.** Ensures you have a FlutterFlow AI workspace (`flutterflow ai init`), bound either to a new app or to an existing project. If you're editing an existing project but don't have its ID handy, Claude lists your account's projects and asks which one to use. 2. **Orient.** Reads the project before changing it, using commands like `status`, `inspect`, `resources`, and `search`. 3. **Author → validate → apply.** Writes changes as declarative Dart files, checks them with `flutterflow ai validate` first, and only then applies them with `flutterflow ai run`. Each applied change lands as a commit in your FlutterFlow Studio project. Open the project in the visual builder to verify the result, then keep refining, either visually or with follow-up prompts. :::note[MCP server approval] Workspaces created by `flutterflow ai init` also register the FlutterFlow AI MCP server with Claude Code via a project-scoped `.mcp.json`. If Claude Code asks to approve a new MCP server named `flutterflow_ai` when you open a session in the workspace, approve it; the build skill and the MCP server drive the same project state. See [Build with AI Agents](https://docs.flutterflow.io/flutterflow-cli/build#launch-your-agent) for details. ::: :::tip[Everything works from the terminal too] The plugin drives the standard `flutterflow ai` CLI, so the same commands work in any terminal, for example `flutterflow ai init my-app`, `flutterflow ai status`, `flutterflow ai validate`, and `flutterflow ai run`. See the [MCP tools reference](https://docs.flutterflow.io/flutterflow-cli/build#mcp-tools) for the full command list. ::: ## Managing Your API Key **Rotate the key.** Create a new API key on your [account page](https://app.flutterflow.io/account), copy it, and tell Claude *"I copied my FlutterFlow Studio API key"* again. The stored key is replaced and used for subsequent commands. **Remove the key entirely.** Delete the stored key file and clear the CLI's cached credentials: ```bash rm -f ~/.config/flutterflow/claude-env.sh flutterflow ai logout --all ``` **If a key ever appears in the chat**, treat it as compromised: delete it on your [account page](https://app.flutterflow.io/account) and create a new one. ## Update the Plugin Plugin installs track the latest version of the FlutterFlow Studio marketplace. To update, run this from a terminal (or `/plugin marketplace update flutterflow` inside a terminal session), then start a new session. The update applies to the terminal and the desktop app alike: ```bash claude plugin marketplace update flutterflow ``` ## Troubleshooting
The CLI installed, but the flutterflow command isn't found

The CLI installs to Dart's pub-cache, which may not be on your PATH. Add it to your shell profile and restart the session: ```bash echo 'export PATH="$HOME/.pub-cache/bin:$PATH"' >> ~/.zshrc ```

The CLI didn't install because Dart is missing

The FlutterFlow CLI requires the Dart SDK, which ships with Flutter. Install Flutter (recommended) or Dart on its own, then start a new Claude Code session. The plugin retries the install automatically.

The desktop app can't find the dart or flutterflow command

The desktop app reads your PATH once, when it launches. If Dart or the FlutterFlow CLI was installed while the app was open, quit and reopen the desktop app. On macOS, make sure your shell profile (for example ~/.zshrc) exports the path; on Windows, add it to your user PATH.

Nothing happens on session start (Windows)

The plugin's automatic setup runs as a bash script, so it needs a bash on your PATH. Install Git Bash or WSL. Alternatively, install the CLI manually with dart pub global activate flutterflow_cli and let flutterflow ai prompt for your API key the first time you run it.

FlutterFlow Studio rejected my API key (401 error)

The key is invalid or was revoked. Copy a fresh key from your account page and tell Claude "I copied my FlutterFlow Studio API key". Don't paste the key into the chat.

# GenUI Chat > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/genui-chat Add a conversational AI surface to your FlutterFlow Studio app that can render catalog components, call action blocks as tools, and react to local app events. Usually, applications follow a fixed model: developers design screens, define navigation, and hard-code interactions. Users are limited to these predefined flows, and anything outside those paths simply isn’t supported. With GenUI, your app provides agent-driven experiences. Instead of relying on rigid flows, an AI agent can assemble user journeys dynamically in real time. Developers no longer need to predict every scenario. Instead, they define the building blocks and the AI orchestrates them into meaningful, context-aware experiences for the user. This represents a fundamental shift, from building fixed applications to building flexible capabilities that an agent can compose on demand. Think of it as building the components, and AI decides when to use them. **Traditional App:** The user clicks 'View Order' → navigates to `OrderDetailPage` → sees order info + tracking + items list. The flow is fixed, and every interaction must be pre-built. **With GenUI:** Build `OrderSummaryCard`, `TrackingStatusCard`, `OrderItemsList` as separate components. Build `getOrderDetails` as a tool. The AI decides what to show based on what the user asks. For example, a user asks, “Show my recent orders.” Instead of responding with text, the agent renders **order card components** with details like items, price, and delivery status. The user then asks, “Where is my latest order?” Now, instead of showing another block of text, the agent switches to a **map component** to display the live delivery location. This demonstrates how the agent dynamically selects the most relevant UI component based on the user’s intent. ![personal-shopper.avif](https://docs.flutterflow.io/assets/images/personal-shopper-b9e7ccff90193aeb9638a5b8da227793.avif) :::tip[GenUI is not a chatbot] GenUI may look like a chat interface, but it is fundamentally different from traditional chatbots. Instead of responding with text messages, the AI renders real UI components, such as cards, lists, forms, and maps—directly in the interface. Users don’t just read responses; they interact with fully functional UI. This means GenUI is not about conversations, it’s about dynamically composing application experiences using your actual app components. ::: :::note This doesn’t replace traditional UI. Navigation, dashboards, and structured flows still play an important role. GenUI introduces a **new layer** — dynamic, adaptive, and conversational — that handles the long tail of use cases traditional interfaces can’t efficiently cover. ::: ## GenUI Is Built on A2UI GenUI is FlutterFlow Studio's implementation of [**A2UI (Agent-to-UI)**](https://a2ui.org/). An [**open project by Google**](https://github.com/google/A2UI) that defines a declarative UI protocol for agent-driven interfaces. A2UI allows AI agents to generate rich, interactive UIs that render natively across platforms (web, mobile, desktop) without executing arbitrary code. ## Three Pillars of GenUI GenUI introduces three core pillars that work together to transform your app into an agent-driven experience: **1. Component Catalog:** Instead of replying with plain text, the AI uses your FlutterFlow Studio components, such as product cards, booking tiles, or dashboards, to present information directly in the interface. Users don’t read the text; they interact with real UI. **2. Tools:** Your existing FlutterFlow Studio action blocks become capabilities the AI can use. Whether it’s fetching data, calling APIs, submitting forms, or triggering workflows, the AI can execute these actions and use the results instantly. It moves beyond conversation and starts performing real tasks inside your app. **3. App Event Integration:** Your app’s events provide real-time context to the AI. Things like user actions, state changes, or backend updates can trigger responses. With auto-response enabled, the AI doesn’t wait for input; it proactively reacts and updates the experience as things happen. ![three-pillars.avif](https://docs.flutterflow.io/assets/images/three-pillars-e833097b98c4cf315e6622864d5d66a1.avif) ## Adding GenUI Let’s walk through how to add a GenUI Chat by building a simple product lookup assistant. Follow the steps below: 1. Make sure you’ve completed the [Firebase integration](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase), including the [initial setup](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) and configuration files. 2. Go to **Firebase Console > AI Logic** and enable it. GenUI is powered by **Google Gemini** via [**Firebase AI Logic**](https://firebase.google.com/products/firebase-ai-logic) and uses a **usage-based pricing model**. You can get started on the **Spark (free)** plan for testing and low usage, but for production or higher usage, you’ll need to upgrade to the **Blaze (pay-as-you-go)** plan, where costs depend on AI requests and token usage. :::tip We recommend monitoring your usage in the Firebase Console, setting up budget alerts to avoid unexpected charges, and upgrading to Blaze before moving to production. ::: 3. In your FlutterFlow Studio project, create a **`ProductListCard`** component, which displays product details such as the image, name, and description. This component accepts a parameter of Data Type **`Product`**. 4. Create an Action Block named **`getProductDetails`**, which retrieves the details of a single product and returns it as a **`Product`** data type. 5. Place the **GenUI Chat** widget on a page or component like any other FlutterFlow Studio widget. 6. Go to the Properties panel and define domain instructions to guide how the assistant behaves and communicates in your app. These instructions help the AI understand your app’s context, tone, and what it should prioritize. If left empty, it defaults to a generic assistant that builds UI in response to user requests. **Example System Prompt:** `You are a helpful AI shopping assistant for an e-commerce app. Help users discover products, compare options, track orders, and complete purchases.` 7. Select the components that the AI is allowed to render in responses. For this example, select the `ProductListCard` component created in step 3. To learn how to configure components for GenUI, refer to the [Component Catalog](https://docs.flutterflow.io/concepts/component-catalog) documentation. 8. If needed, add the [Action Blocks](https://docs.flutterflow.io/resources/functions/action-blocks) that the AI can call. For this example, select the action block named `getProductDetails`, created in step 4. Note that only Action Blocks that return a value can be added. To learn how to configure them for GenUI, refer to the [Tools Configuration](https://docs.flutterflow.io/concepts/tools) documentation. 9. If needed, choose Local [App Events](https://docs.flutterflow.io/concepts/app-events) to connect to the conversation. To learn how to configure app events for GenUI, refer to the [App Events Integrations](https://docs.flutterflow.io/concepts/app-event-integration) documentation.

### Customization You can fully customize the chat interface using the following options available in the Properties panel: - **Layout & container:** Background, border radius, padding, message spacing, and max message width - **Header:** Visibility, title, icon, background color, and text color - **Avatars:** Visibility, size, and image sources for both user and AI - **Message bubbles:** Background colors, text colors, and border radii for user and AI messages - **Input field:** Placeholder text, background, border radius, and padding - **Send button:** Icon and background styling - **Welcome state:** Visibility, icon, title, and subtitle shown when the chat is empty - **Starter prompts:** Prompts shown as chips on the empty chat, and what a tap does - **Scrolling behavior:** Auto-scroll to new messages and animation duration - **Thinking/status message:** Text displayed while the AI is generating a response **Default Behavior:** - Header is shown by default - Avatars are enabled by default - Auto-scroll is enabled - Input placeholder defaults to “Type a message…” - Thinking message defaults to “Thinking…” - Welcome state is shown when there are no messages - The header shows a robot icon, and the welcome state shows a chat bubble icon. Pick your own icon, or turn **Show Icon** off to hide it. - The send button is disabled and dimmed while the AI is generating a response. **Starter prompts:** Starter prompts appear as tappable suggestions (chips) when the chat is empty, even if the welcome message is off. To add one, select the **GenUI Chat** widget, open **Starter Prompts** in the properties panel, and click **Add Prompt**. Keep prompts short: the chip truncates text that doesn't fit on one line. Use **On Chip Tap** to choose what happens when a user taps a chip: - **Fill Input** (default): Fills the message input so the user can review or edit the prompt before sending it. If they already have a draft, the prompt appears after the draft text. Tapping the chip doesn't open the on-screen keyboard. - **Send**: Sends the prompt immediately. Users can't tap the chips while a reply is in progress.

## Examples #### 1. Customer Support Agent **Traditional Approach:** Build a help center with FAQ pages, a ticket form, and a chatbot that matches keywords to canned responses. **GenUI Approach:** - **Catalog Components:** TicketStatusCard, FAQArticle, EscalationForm, SatisfactionSurvey, AgentContactCard - **Tools:** `lookupTicket(ticketId)`, `searchKnowledgeBase(query)`, `createTicket(details)`, `getCustomerHistory(customerId)` - **App Events:** `NewTicketUpdateEvent` (auto-respond) when a support ticket is updated in the backend, the AI proactively informs the user A user opens the support chat. They describe their issue in natural language. The AI searches the knowledge base using the tool, finds a relevant article, and renders it as a FAQ Article component. If that does not resolve the issue, the AI creates a ticket using `createTicket`, shows the TicketStatusCard with the new ticket ID, and says it will notify them of updates. Later, when the support team updates the ticket, a `NewTicketUpdateEvent` fires, and the AI proactively shows the updated TicketStatusCard with the resolution. The developer did not build a "ticket lookup flow" or a "knowledge base search screen." They built components and tools. The AI composed the journey. #### 2. E-Commerce Personal Shopper **Traditional Approach:** Build product listing pages, filters, a search bar, a comparison tool, a cart, and a checkout flow. **GenUI Approach:** - **Catalog Components:** ProductCard, ComparisonTable, PriceHistoryChart, ReviewSummary, CartSummary, PromoCodeBanner - **Tools:** `searchProducts(query,filters)`, `getProductDetails(productId)`, `getReviews(productId)`, `addToCart(productId,quantity)`, `applyPromoCode(code)`, `getPriceHistory(productId)` - **App Events:** `CartUpdatedEvent` (context injection) keeps the AI aware of what is already in the cart; `FlashSaleEvent` (auto-respond) alerts the user about time-sensitive deals A user says, "I need a gift for my dad who likes woodworking and coffee." The AI searches products, shows a curated set of ProductCards, and when the user shows interest in a specific item, pulls up the ReviewSummary and PriceHistoryChart. The AI knows what is in the cart (via CartUpdatedEvent context) and can suggest complementary items. When a flash sale starts on a relevant product, the AI proactively shows the PromoCodeBanner. No search results page. No filter sidebar. No "compare" button. The AI built a personalized shopping experience from the components and tools available to it. ## Current Limitations Here are some important limitations and considerations to keep in mind: - The only supported backend today is **Firebase AI Logic**. - App event listeners currently work only with **LOCAL** app events. - Catalog components cannot expose action parameters. - Avatar images must be valid network URLs (local asset paths are not supported). - Each rendered surface supports only a single catalog component as its root. ## Best Practices #### Describe Everything The AI reads your component and parameter descriptions to decide what to render and what values to provide. The quality of your descriptions directly impacts the quality of the AI's responses. - Name components clearly: `ProductCard` not `Card1` - Name parameters descriptively: `estimatedDeliveryDate` not `date` - Add descriptions to parameters: "The product's price in USD" not just "price" - Add descriptions to action blocks: "Searches the product catalog and returns matching items with prices and availability" not just "search" The AI is only as smart as the vocabulary you give it. #### Design for Composition Components and tools work best when they are designed to be composed: - **Retrieval Tool + Display Component:** `getOrderDetails()` returns an `OrderStruct` -> `OrderStatusCard` accepts an `OrderStruct` as a parameter. The AI calls the tool and passes the result to the component. - **Granular Over Monolithic:** A `ProductCard`, `ReviewSummary`, and `PriceChart` give the AI three options. A single `ProductDetailPage` component gives the AI one. - **Consistent Data Types:** Use the same DataStruct across related tools and components. If `searchProducts` returns `ProductStruct`, make `ProductCard` accept `ProductStruct`. #### Use Events for Temporal Awareness App events give the AI a sense of time and change. Without them, the AI only knows what the user tells it. With them, the AI knows what is happening. - Use **auto_respond: false** for continuous state awareness, such as user navigation, preference changes, background data updates. - Use **auto_respond: true** for time-sensitive signals, such as alerts, completions, threshold breaches, incoming messages. #### Write System Prompts Like Onboarding Documents The system prompt is the AI's job description. Write it like you are onboarding a new team member: - What is their role? - What domain should they know about? - What should they prioritize? - What should they never do? - What tone should they use? - What business rules must they follow? A great system prompt makes the difference between a useful assistant and a generic chatbot. ## Behind the Scenes GenUI is powered by [**Firebase AI Logic**](https://firebase.google.com/products/firebase-ai-logic) (Google Gemini) as its LLM backend. At a high level, the system works as: **Your configuration → code generation → runtime widget powered by Firebase AI Logic and the [GenUI](https://pub.dev/packages/genui) package**. You define components, tools, and events in FlutterFlow Studio, and GenUI automatically generates the necessary code and runtime behavior to render dynamic UI experiences. ## FAQS
The widget builds but the AI only sends text

Check the catalog first. If no component fits the request, text is the expected fallback. Also, confirm that your system prompt and component descriptions make it clear when each component should be used.

I can't add a component to the catalog

The most common causes are: - The component has an action parameter. - A required complex parameter is missing a default value. - The component was deleted or renamed after being configured.

I can't add an Action Block as a tool

The Action Block must return a value, and every parameter, plus the return type, must be supported by the tool serializer.

My event listener is not firing

Make sure the following are correctly set: - The event is LOCAL scope. - The right event is being triggered at runtime. - `auto_respond` is set the way you expect.

Why does a component fail validation?

Common reasons include: - It has an action parameter. - It is configured twice in the same catalog. - A required complex parameter is missing a default value. - The configured component no longer exists.

Why is the model choosing the wrong component?

Usually one of these is true: - The names are too generic. - Parameter descriptions are weak. - Multiple catalog components overlap too much in purpose. - The system prompt does not explain how the assistant should prioritize them.

Can the model render multiple items?

Yes, but the reliable pattern is to use a single catalog component that accepts a list rather than expecting the model to assemble multiple independent sibling components on its own.

Why is the model not calling a tool?

Usually, the issue is not codegen. It is tool discoverability: - The name is vague - The description is weak - The system prompt does not make it clear when the tool should be used - The model already has enough context to answer without calling it

What happens when a tool fails?

The generated tool code catches the exception, clears the loading state, and sends an error payload back to the model. The UI should remain stable, and the model can decide how to explain or recover.

Why can't I select my event?

The event must be LOCAL scope and must still exist in the project or dependency where it was defined.

Why didn't the assistant respond immediately?

Check the following: - whether `auto_respond` is actually `true` - whether the event is being triggered - whether the system prompt tells the model to react visibly Note: Even with immediate inference, not every event will result in a visible response.

Why does the assistant only react on the next user message?

That is the expected behavior for `auto_respond: false`. The listener queues hidden context instead of triggering a separate inference call.

Can one GenUI widget listen to the same event twice?

No. Duplicate listeners for the same event on the same widget are rejected during validation.

Do conversations persist across app restarts?

No. Conversations do not persist across app restarts. If a user closes and reopens the app, the chat history is reset.

Can I choose the Gemini model or adjust parameters like temperature?

GenUI uses Firebase AI Logic, which manages the underlying Gemini model and its configuration. At the moment, you cannot directly select specific model variants or adjust parameters like temperature or top_p. The system is designed to provide a simplified, managed experience without requiring manual tuning.

What happens when Firebase AI Logic quota or rate limits are exceeded?

If you exceed Firebase AI Logic or Gemini free-tier limits, requests will fail with a 429 quota-exceeded error. This typically means you’ve hit limits such as requests per minute or free-tier usage caps. In some cases, the error will include a retry time, after which you can try again. While the Spark plan works for testing, it is subject to strict free-tier limits, so for higher usage or production apps, you should expect to upgrade to a paid plan and monitor usage closely

# Component Catalog > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/component-catalog Configure the FlutterFlow Studio components that GenUI is allowed to render inside the chat surface. The **Component Catalog** is the list of FlutterFlow Studio components that GenUI can render inline in the conversation. Without a catalog, GenUI can still chat and call tools, but it has no specific UI to render. Internally, GenUI creates documentation for each catalog component. That documentation includes: - Component name - Component description - Parameter names - Parameter types - Required or optional status - Parameter descriptions The model's render decisions are only as good as the naming and descriptions you provide. ## Component Requirements #### The component must be serializable at the API boundary Catalog components cannot expose **action parameters**. GenUI only knows how to pass structured data into the component, not callbacks or arbitrary closures. #### Parameters should use supported types Supported parameter categories in the generated catalog pipeline include: - `String` - `int` - `double` - `bool` - `Color` - `DateTime` - `TimestampRange` - `LatLng` - `GooglePlace` - `JSON` - `DataStruct` - `Enum` - media-path string types such as `ImagePath`, `VideoPath`, `AudioPath`, and `MediaPath` - `List` of supported item types #### Required complex parameters need explicit defaults If a catalog parameter is non-nullable and uses one of these complex types: - `Color` - `DateTime` - `TimestampRange` - `LatLng` - `GooglePlace` - `DataStruct` - `JSON` then you should either: - set an explicit default value, or - make the parameter optional For instance, if your **EventCard** component has a required `eventDate: DateTime` parameter, you must either set a default value in the component editor or make the parameter optional. Without this, GenUI validation will reject the component. GenUI validation enforces this because those types do not have a safe implicit fallback in generated constructor code. ## Runtime Rules #### One root component per surface Each GenUI surface renders exactly one catalog component as its root. That root component can be a rich component tree internally, but the model cannot compose arbitrary parent wrappers like `Column`, `Container`, or other widgets that are not in the catalog. #### The model can only use listed catalog components If a component is not in the catalog, it does not exist from the model's perspective. ## Best Practices #### Use list-friendly components Because a surface has one root component, a component that accepts `List` is often the right shape for result sets: - `TransactionList` - `SearchResultsGrid` - `CartItemsSummary` #### Prefer focused components over screen-sized composites Good catalog components are reusable units, such as: - `ProductCard` - `OrderSummary` - `InvoicePreview` - `ReviewSummary` - `AppointmentConfirmation` These give the model flexible building blocks. A large page-like component is harder to reuse and usually harder for the model to choose well. #### Use consistent `DataStruct` across tools and components If a tool returns `ProductStruct`, prefer catalog components that also accept `ProductStruct` or `List`. That keeps tool output and rendering input aligned and makes the tool-to-UI handoff more reliable. #### Describe parameters like you are documenting an API Good: - `estimatedDeliveryDate`: "Expected arrival date in ISO 8601 format." - `inventoryStatus`: "Availability state shown to the user, such as inStock or backOrdered." Weak: - `date` - `status` #### Keep component names specific Use clear, descriptive names that reflect the component’s purpose. Good: - `OrderStatusCard` - `SensorAlertSummary` - `QuoteBreakdown` Weak: - `Card1` - `Summary` - `Details` #### Avoid ambiguous overlap If two components do roughly the same thing, the model has to guess. Either merge them, rename them more clearly, or narrow their intended use. # Tools Configuration > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/tools Expose Action Blocks to GenUI so the model can fetch data, run workflows, and use real results in its responses. In GenUI, **Tools** are Action Blocks that the model can call during a conversation. A tool is appropriate when the model needs fresh data or needs to perform work before it can answer. Common uses: - Query APIs or databases - Run calculations - Fetch records by ID - Transform structured data - Trigger a workflow that still returns a useful result :::caution If the Action Block does not return anything, it cannot be used as a GenUI tool. ::: For each tool, GenUI includes: - Function name - Description - Parameters - Required or optional status - Parameter descriptions - Return type - Return description That means the Action Block name and description matter. They are part of the tool-selection signal the model sees. :::note If a tool throws an exception, the error is caught and sent back to the model as a structured error payload. The UI remains stable and the model can explain the failure or suggest alternatives. ::: ## Tool Requirements #### The Action Block must return a value Tools are designed around request/response semantics. No return value means nothing meaningful can be sent back to the model. #### Parameter and return types must be supported Supported tool types include: - `String` - `int` - `double` - `bool` - `Color` - `DateTime` - `TimestampRange` - `LatLng` - `GooglePlace` - `JSON` - `DataStruct` - `Enum` - media-path string types such as `ImagePath`, `VideoPath`, `AudioPath`, and `MediaPath` - list forms of the same supported types Unsupported types are rejected during validation. #### Duplicate tools are not allowed on the same widget Configuring the same Action Block twice on one GenUI widget is treated as an error. ## Loading Messages Each tool can define its own loading message in the widget configuration. - If set, that message is shown while the tool runs. - If omitted, the generated tool uses `Processing...`. This is separate from the widget-level thinking message, which defaults to `Thinking...` and is shown before the tool call starts. ## Serialization Rules The generated code serializes common FlutterFlow Studio data types into model-friendly JSON: - **Color**: CSS color string. e.g., `Color(0xFF4CAF50)` → `"#4CAF50"` - **DateTime**: ISO 8601 string. e.g., `DateTime(2024, 3, 15)` → `"2024-03-15T00:00:00.000"` - **TimestampRange**: start|end milliseconds string. e.g., `TimestampRange(1700000000000, 1700086400000)` → `"1700000000000|1700086400000"` - **LatLng**: serialized string form. e.g., `LatLng(37.7749, -122.4194)` → `"37.7749,-122.4194"` - **GooglePlace**: serialized place payload (JSON object with place details) - **DataStruct**: converted using `toMap()`. e.g., `Product(name: "Shoes", price: 99)` → `{ "name": "Shoes", "price": 99 }` - **Enum**: serialized enum string. e.g., `OrderStatus.delivered` → `"delivered"` ## Best Practices #### Keep tools focused Prefer small, specific tools: - `getOrderDetails` - `searchProducts` - `getWeatherForLocation` - `calculateQuote` over broad tools like: - `handleRequest` - `fetchData` - `processWorkflow` #### Write descriptions for model behavior, not just for humans Good: `Retrieves the current order status, tracking number, and ETA for a given order ID.` Weak: `Looks up an order.` #### Return structured data when possible If the output can be represented as Custom Data Type `DataStruct`, do that instead of flattening everything into strings. Structured output is easier for the model to feed into catalog components. #### Match tool output to catalog input Reliable GenUI setups usually follow this shape: - A tool returns `OrderStruct` - A catalog component accepts `OrderStruct` That gives the model a clean path from retrieval to rendering. ## Common Examples #### Data lookup `getOrderDetails(orderId: String) -> OrderStruct` The model calls the tool, gets a structured order result, and renders an order summary component. #### Search `searchProducts(query: String, maxPrice: double?) -> List` The model calls the tool and then renders a list-style catalog component using the returned products. #### Calculation `calculateMonthlyPayment(amount: double, rate: double, termMonths: int) -> PaymentQuoteStruct` The model uses the result to explain the output and optionally render a quote component. # App Events Integrations > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/app-event-integration Feed local app events into GenUI so the conversation can react to live app state and time-sensitive signals. App Event Integration lets GenUI listen to FlutterFlow Studio **LOCAL** app events and turn them into conversation context. This is how GenUI becomes aware of things the user did not explicitly type: - Cart changes - Workflow completion - Alerts - Navigation context - Device or sensor updates GenUI automatically listens for matching local events and converts them into hidden context messages for the conversation. ## Two Integration Modes - **Context Injection**: Use `auto_respond: false` when the event should enrich future replies without interrupting the user immediately. In this mode, the event message is added to a pending queue, which is then flushed before the next user message is sent, allowing the model to use these queued messages as hidden context during the next inference. - **Proactive Response**: Use `auto_respond: true` when the event should trigger an immediate GenUI response. In this mode, the event message is sent directly into the conversation as an InternalMessage, inference starts right away, and the model may respond with text, UI, both, or nothing visible depending on the prompt and context. ## Message Construction You can either enter a custom message directly in the **Message Template** field or bind it to a variable for dynamic content. If the event includes payload data, GenUI automatically appends it. For example, entering “Your order status is:” and triggering the event which includes event data such as `pending` or `in transit` will result in messages such as “Your order status is pending.” ## Pending Context Queue For `auto_respond: false`, GenUI stores pending event messages in memory until the user sends the next message. The queue has a maximum size of 50, and if it overflows, the oldest messages are dropped first. Before the next user request is sent, these messages are injected directly into the conversation history as InternalMessages, allowing the model to use them as context without triggering additional model calls. ## Best Practices #### Use context injection for ambient state For example: - Updated cart contents - Current page context - Background sync results These make future replies smarter without causing unsolicited responses. #### Use proactive response for time-sensitive events For example: - Threshold alerts - Task completion - Failed jobs - Incoming high-priority updates These are the moments where an immediate assistant response is justified. #### Keep event data structured If an event carries payload data, use a stable, well-designed data type. The generated message ends up calling `toMap()`, so clearer payload structure produces clearer AI context. #### Do not flood the queue If a background signal can fire rapidly, consider batching it before triggering the event. The queue has a hard cap of 50 messages. ## Examples #### Cart awareness without interruption Use a `CartUpdated` local event with `auto_respond: false`. Each cart update quietly enriches the pending context so the next time the user asks, "What's in my cart?" the model already has the latest state. #### Immediate alerting Use a `TemperatureAlert` local event with `auto_respond: true`. When the event fires, GenUI immediately triggers inference and the model can warn the user and render a supporting UI component if the catalog contains one. # Integrating Native SDKs Using Method Channels > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/concepts/advanced/method-channels Learn how to integrate third-party native SDKs into your FlutterFlow Studio project using Method Channels. This guide walks through setting up channels, writing native code, and connecting it back to FlutterFlow Studio. Flutter lets you build one app that runs on mobile, web, desktop, and embedded experiences from a single codebase. You write your app logic in Dart once, which is then compiled natively for the target platform. This is a big advantage for teams that want to reduce duplication between Android and iOS apps while maintaining great performance and flexibility. For native developers accustomed to Kotlin, Java, Swift, or Objective-C, Flutter provides access to platform-specific functionality. The bridge between Dart and native code is called a **MethodChannel**. You can think of it as a two-way door: Dart can ask Android or iOS to run some code, and the platform can send results back. The two sides communicate using messages, rather than shared memory, which makes the system simple and secure. With MethodChannels, you can: * Call Android and iOS APIs that aren’t built into Flutter. * Use advanced third‑party SDKs (e.g., barcode scanners, Bluetooth libraries, custom UI components). * Perform operations that need native performance or device-specific access. * Return data from the native side into Flutter with low latency. **Why this matters for native engineers** | What you need | How MethodChannel helps | | :---- | :---- | | Reach every platform API | You can call any Android or iOS API from Flutter using familiar native code. | | Keep the app smooth | Messages are encoded in binary and handled asynchronously, so the UI remains responsive. | | Keep the key code native | You can keep performance-sensitive or secure logic in Kotlin/Swift while building UI in Dart. | | Bridge advanced SDKs | Integrate with native libraries that do not have Flutter support, without waiting for a plugin. | You’re not limited by what Flutter provides out of the box. MethodChannels lets you plug in your native knowledge exactly where needed, so you don’t lose years of platform experience when moving to Flutter. ## What is a MethodChannel? A **[MethodChannel](https://docs.flutter.dev/platform-integration/platform-channels)** or **Platform Channels** is Flutter’s core mechanism for integrating platform-specific functionality. It allows Dart code to send messages to, and receive responses from, the host platform’s native code \- Android (written in Kotlin or Java) or iOS (written in Swift or Objective-C). This enables your Flutter app to access device features and third-party native libraries that are outside the scope of the Flutter framework or its plugin ecosystem. Here is an example of MethodChannel. ```js class _BatteryLevelScreenState extends State { // Define the MethodChannel with a unique name. This name must match the one used on the native side. static const platform = MethodChannel('com.example.battery'); // Variable to hold the battery level. String _batteryLevel = 'Unknown battery level.'; // Method to invoke the native method to get the battery level. Future _getBatteryLevel() async { String batteryLevel; try { // Invoke the method on the native side. final int result = await platform.invokeMethod('getBatteryLevel'); batteryLevel = 'Battery level at $result%.'; } on PlatformException catch (e) { // Handle exception if the native code fails. batteryLevel = "Failed to get battery level: '${e.message}'."; } // Update the UI with the retrieved battery level. setState(() { _batteryLevel = batteryLevel; }); } ``` MethodChannels operate over a named channel using a message-passing model. You define a unique **channel name**, such as `'com.example/device'`, and both the Flutter and native sides agree to use it. On the Dart side, you call a method using `invokeMethod()`, sending an optional payload. The platform side sets up a listener (known as a method call handler) that waits for these invocations, runs native logic, and returns a result. This message flow is asynchronous and decoupled: * Dart code doesn’t block while the native code runs; it returns a `Future` that resolves when the result is ready. * Native code must explicitly return a result using either `success`, `error`, or `notImplemented`, ensuring consistent feedback. ### Key Concepts {#key-concepts} * **Channel Name**: A unique identifier string that both Flutter and native code must use. Example: `'com.example/platform'`. Naming collisions should be avoided by namespacing based on your app or organization. * **Method Invocation**: Flutter calls `invokeMethod('methodName', arguments)`. The method name is a simple string. Arguments can be null or any value supported by Flutter’s `StandardMessageCodec` (bool, int, double, string, List, Map). * **Method Handler**: Native code uses a handler (e.g., `setMethodCallHandler` on Android) to listen for calls and run logic when the specified method name is matched. * **Result Callback**: The native handler must return a result via `result.success(...)`, `result.error(...)`, or `result.notImplemented()`. These responses are passed back to Dart, completing the `Future`. ### Example Message Flow ![method-channels.avif](https://docs.flutterflow.io/assets/images/method-channels-ec81d7359e3e6892c652e1b5905c3bee.avif) This design ensures clear separation between platform and UI logic, and it keeps the UI thread non-blocking for both Dart and native sides. It also makes the communication extensible—you can define as many methods as you need over a single channel or use multiple channels for modular organization. ### When to Use a MethodChannel MethodChannel is most appropriate when: * You need to use Android/iOS APIs not available in Flutter or plugins (e.g., access to specific hardware sensors, native storage APIs). * You need to integrate a proprietary or vendor SDK (e.g., analytics, payment, OCR) written for the platform. * You need to launch a platform-native UI (e.g., a full-screen scanner or a native file picker). * You’re bridging a legacy native feature into a Flutter app or gradually migrating a native app to Flutter. ### What MethodChannels Are Not * They are not **shared memory** \- All data is copied through serialization, not shared by reference. Only standard types are supported (primitives, lists, maps, typed data). Large data transfers require full serialization/deserialization. * They are **not synchronous** \- Calls return Futures immediately without blocking. Results arrive asynchronously via the event loop. Platform errors surface as PlatformExceptions when the Future completes. * They are **not opinionated** \- You define the API contract (method names, arguments, types) on both sides. There's no compile-time validation across the boundary \- mismatches fail at runtime. Document your contract and validate inputs since type safety isn't enforced. By understanding these characteristics, you can create robust, maintainable bridges between Dart and native code. You can write minimal, purpose-driven native handlers and keep the rest of your app in Flutter, achieving both deep platform access and cross-platform speed. ## Real-World Use Cases for MethodChannels While Flutter plugins cover many common platform integrations, there are frequent scenarios where you require direct access to native SDKs or platform-specific APIs. MethodChannels offer a direct path for these integrations without waiting for third-party plugin support. Ultimately, method channel integration is essentially plugin development \- you're writing the same native bridge packaged for your app instead of as a public package. Once complete, it can be imported into FlutterFlow Studio. The following examples show when building your own native integration is more practical than waiting for or wrestling with existing plugins. The following examples outline situations where MethodChannels are suitable. ### Accessing Device Hardware Not Exposed by Plugins **Example:** Retrieve mobile network signal strength, advanced battery metrics, or thermal status. * Low-level APIs like Android's `TelephonyManager` or iOS's `CoreTelephony` are rarely exposed through Flutter plugins. * These require direct permission management and native invocation. * With MethodChannels, you can call only what you need, without waiting for a plugin update or writing one from scratch. **Benefit:** Access hardware-level telemetry or diagnostics crucial for field-service apps, testing tools, or enterprise reporting. ### Integrating Proprietary SDKs or Vendor Libraries **Example:** Use a third-party identity verification SDK, document scanner, or encrypted storage SDK. * Many vendors distribute Android/iOS SDKs only and have no Flutter wrappers. * A minimal native wrapper and MethodChannel interface let you expose only the needed functionality. * Native SDK updates remain decoupled from Flutter UI changes. **Benefit:** Unlocks core business features (KYC, biometrics, payments) without dependency on plugin authors or external wrappers. ### Embedding Native UI Views Temporarily **Example:** Show a native PDF viewer, a camera UI from a vendor SDK, or an AR interface. * `PlatformView` allows embedding native UI, but it requires more setup and introduces performance tradeoffs. * If the native UI is temporary or full-screen, you can invoke it via MethodChannel and return control to Flutter afterward. **Benefit:** Delivers platform-native experiences where needed while preserving Flutter’s rendering pipeline elsewhere. ### Background Tasks and Event-Driven Native APIs **Example:** Respond to geofencing events, push token refresh, or Bluetooth device state changes. * These use cases originate in native services or background tasks. * You can queue or debounce events on the native side and send them to Flutter via MethodChannel when the app is active. * For continuous updates, use `EventChannel`, as MethodChannel is ideal for transactional or one-off data transfers. **Benefit:** Achieves OS-level integration (e.g., location, power, Bluetooth) without polling or Dart-side complexity. ### Secure Device Data Retrieval **Example:** Fetch IMEI, MAC address, device fingerprint, or system identifiers. * These APIs often require special entitlements and native-side permission prompts. * Native logic can validate permissions, sanitize data, and decide what’s safe to return. **Benefit:** Ensures security-sensitive operations remain native-controlled, supporting enterprise, regulated, or BYOD environments. ## Implementing a MethodChannel This section walks through the complete implementation of a MethodChannel, showing how to define the channel in Flutter (Dart), connect it to native platform code, and properly exchange messages, arguments, and results. For native developers used to Android or iOS, this breakdown will show how to bridge Dart and native code in a way that is robust, testable, and production-ready. ### 1. Dart Side (Flutter) In Flutter, you use the `MethodChannel` class from the `services` package to create a communication path. The Dart side always initiates the call, and the native side responds. **Define and Use a Channel:** ```js import 'package:flutter/services.dart'; const platform = MethodChannel('com.example/device'); ``` * The channel name `'com.example/device'` must match **exactly** with the one used on the native side. * Channel names should follow a reverse-domain convention to avoid collisions. **Sending a Method Call:** ```js Future getBatteryLevel() async { try { final int result = await platform.invokeMethod('getBatteryLevel'); return 'Battery level: $result%'; } on PlatformException catch (e) { return 'Failed to get battery level: ${e.message}'; } } ``` * `invokeMethod` sends a string method name and optional arguments to native code. * The result comes back asynchronously via a `Future`. * Always wrap the call in a `try-catch` block to handle `PlatformException`, which may occur if: * The native method throws an error * The method is not implemented * Data serialization fails **Notes:** * You can pass arguments to `invokeMethod()` as the second parameter (e.g., a `Map`). * The result can be any JSON-compatible Dart type: `int`, `String`, `bool`, `double`, `List`, or `Map`. ### 2. Android Side (Kotlin) The Android side handles Dart calls using a `MethodChannel` registered in `MainActivity`. This handler runs on the **main thread** by default, so long-running work should be offloaded to a background thread. **Setting Up the Channel:** ```js import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugin.common.MethodChannel import android.os.BatteryManager import android.content.Context ``` **Handling the Method Call:** ```js class MainActivity: FlutterActivity() { private val CHANNEL = "com.example/device" override fun configureFlutterEngine(flutterEngine: FlutterEngine) { super.configureFlutterEngine(flutterEngine) MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result -> when (call.method) { "getBatteryLevel" -> { val batteryLevel = getBatteryLevel() if (batteryLevel != -1) { result.success(batteryLevel) } else { result.error("UNAVAILABLE", "Battery level not available.", null) } } else -> result.notImplemented() } } } private fun getBatteryLevel(): Int { val batteryManager = getSystemService(Context.BATTERY_SERVICE) as BatteryManager return batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY) } } ``` **Notes:** - Always return a result using one of the following: * `result.success(data)` — returns data to Dart * `result.error(code, message, details)` — throws `PlatformException` in Dart * `result.notImplemented()` — throws `MissingPluginException` in Dart - Do **not** call `result` multiple times. Flutter expects a one-time, one-result reply per method call. - If your native call involves I/O, network, or anything that blocks, use a background thread: ```js Thread(Runnable { val resultData = longRunningOperation() runOnUiThread { result.success(resultData) } }).start() ``` ### 3. iOS Side (Swift) In iOS, the platform channel is handled via `FlutterMethodChannel` in `AppDelegate.swift`. Similar to Android, the method call handler runs on the **main thread** by default. **Setting Up the Channel:** ```js import UIKit import Flutter @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { let controller = window?.rootViewController as! FlutterViewController let batteryChannel = FlutterMethodChannel(name: "com.example/device", binaryMessenger: controller.binaryMessenger) ``` **Handling the Method Call:** ```js batteryChannel.setMethodCallHandler { (call: FlutterMethodCall, result: @escaping FlutterResult) in if call.method == "getBatteryLevel" { UIDevice.current.isBatteryMonitoringEnabled = true let level = UIDevice.current.batteryLevel if level >= 0 { result(Int(level * 100)) } else { result(FlutterError(code: "UNAVAILABLE", message: "Battery level not available.", details: nil)) } } else { result(FlutterMethodNotImplemented) } } return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ``` **Notes:** * Always return exactly one response per method call. * Use `FlutterError` to send detailed error info to Dart. * If needed, use `DispatchQueue.global().async` to run long tasks in the background, then return via `DispatchQueue.main.async`. ### Best Practices on MethodChannels To implement **MethodChannels** successfully: * **Use consistent channel and method names** between Dart and native code. * **Use standard types** for data exchange (prefer `String`, `int`, `bool`, `List`, `Map`). * **Always handle errors** clearly on both sides. * **Offload long-running native logic** to background threads. * **Keep the native side minimal and testable**, separating SDK logic from channel code where appropriate. By following these steps and patterns, you’ll be able to bridge Flutter with native code cleanly—supporting deep platform integrations while maintaining a smooth UI and maintainable codebase. ## Integrating MethodChannels in FlutterFlow Studio FlutterFlow Studio is a visual development platform that generates complete Flutter applications. While it supports writing custom Dart code through **Custom Actions** and **Custom Functions**, it does not allow direct editing of platform-native code (Kotlin, Swift) through its web UI. This introduces some important considerations when integrating Flutter’s `MethodChannel` API for platform-specific functionality. **Step 1: Create a Custom Flutter Plugin** **1.1 Initialize the Plugin** Use the Flutter CLI to create a new plugin: ```jsx flutter create --template=plugin --platforms=android,ios my_custom_plugin ``` This command sets up a plugin project with the necessary structure for both Android and iOS platforms. **1.2 Implement Platform-Specific Code** Within the generated plugin, navigate to the platform-specific directories (`android` and `ios`) to implement the desired functionality. For example, to retrieve the device's battery level: * **Android (Kotlin):** Modify `MyCustomPlugin.kt` to access the battery information using Android's `BatteryManager`. * **iOS (Swift):** Update `MyCustomPlugin.swift` to utilize `UIDevice` for battery level retrieval. **1.3 Publish to GitHub** After implementing and testing your plugin: 1. Initialize a Git repository in your plugin directory. 2. Commit your changes. 3. Push the repository to GitHub. Ensure your `pubspec.yaml` is correctly configured, and consider tagging releases for versioning. **Step 2: Add the Plugin as a Dependency in FlutterFlow Studio** To integrate your custom plugin into a FlutterFlow Studio project: 1. Navigate to **Custom Code > Custom Actions** or **Custom Widgets** in FlutterFlow Studio. 2. Create a new Custom Action or Widget. 3. In the **Settings** panel on the right, scroll to **Dependencies**. 4. Add your plugin using the Git URL: ```yaml my_custom_plugin: git: url: https://github.com/yourusername/my_custom_plugin.git ``` 5. In the code editor, import your plugin: ```jsx import 'package:my_custom_plugin/my_custom_plugin.dart';` ``` 6. Implement the desired functionality using the plugin's API. For detailed guidance, refer to FlutterFlow Studio's documentation on [using unpublished or private packages](https://docs.flutterflow.io/concepts/custom-code/#using-unpublished-or-private-packages). **Step 3: Utilize the Plugin via Custom Actions in FlutterFlow Studio** With the plugin integrated, you can now create Custom Actions to leverage its functionality: 1. Define a new Custom Action in FlutterFlow Studio. 2. In the code editor, implement the action using your plugin. For example: ```jsx Future getBatteryLevel() async { final batteryLevel = await MyCustomPlugin.getBatteryLevel(); return batteryLevel; } ``` 3. Compile the custom code to ensure there are no errors. 4. Use this Custom Action within your FlutterFlow Studio project's action flows, just like any built-in action. This approach allows you to encapsulate complex logic within reusable actions, enhancing modularity and maintainability. ### Managing Private Repositories If your plugin repository is private, FlutterFlow Studio needs access to it. As per FlutterFlow Studio's documentation, you may need to provide authentication credentials or use SSH keys. Refer to the [FlutterFlow Studio documentation](https://docs.flutterflow.io/concepts/custom-code#using-unpublished-or-private-packages) for detailed instructions on integrating private packages. ## Common Pitfalls and Debugging MethodChannels are powerful but require careful implementation. When the Dart and native sides are not aligned, or error handling is overlooked, it often leads to runtime issues or silent failures. This section outlines the most common problems developers face with MethodChannels, especially in projects generated by tools like FlutterFlow Studio, and provides actionable solutions to help you debug effectively and write resilient platform-channel integrations. ### MissingPluginException **Symptom:** Flutter throws a `MissingPluginException`, typically saying the plugin or method is not implemented. **What it means:** Flutter tried to invoke a method on the MethodChannel, but the native side did not recognize the channel or method name. **Common causes:** * Dart `MethodChannel` name does not match the native channel name. * Native code handler (`setMethodCallHandler`) was never set up or was incorrectly placed. * Custom native code was overwritten when re-downloading a FlutterFlow Studio project without preserving changes. * The method was invoked before the Flutter engine or the channel was fully initialized. * Hot reload only updates Dart code, but not with native channel implementations. **How to fix:** * Confirm that the channel name is **identical** in Dart and native code (case-sensitive). * On Android, ensure the channel is registered inside `configureFlutterEngine()`. * On iOS, set up the `FlutterMethodChannel` inside `didFinishLaunchingWithOptions()`. * Log the available channels/methods to confirm registration during app startup. * Native channel implementations require a full restart because the platform-specific code must be recompiled and relinked. ### Incorrect Argument or Result Types **Symptom:** App crashes with type casting errors or returns `null` unexpectedly. **What it means:** The data passed between Dart and native does not match expected formats. **Common causes:** * Dart sends an argument as a Map but native expects a String, or vice versa. * Native code returns a platform object that can't be serialized by Flutter. * The return value is not compatible with `StandardMessageCodec`. **How to fix:** * Only use standard types: `int`, `double`, `String`, `bool`, `List`, or `Map` with JSON-safe contents. * On Dart side, specify the expected return type with generics: `invokeMethod(...)`. * On native side, validate input types before using them. Consider using try/catch or safe casting. * Avoid sending complex objects like native SDK responses directly—convert to a simple dictionary or string. ### No Response or App Hangs **Symptom:** The Dart call to `invokeMethod()` never returns, or the UI freezes. **What it means:** The native side didn’t complete the method call correctly, or a long-running task is blocking the UI thread. **Common causes:** * Native method handler fails to call `result.success`, `result.error`, or `result.notImplemented`. * The method call handler throws an exception that prevents the response from being sent. * Heavy logic (e.g., file I/O, network calls) is blocking the main thread. **How to fix:** * Always call one—and only one—of the result callbacks. * Wrap native code in try/catch blocks to catch and report any exceptions. * Offload slow operations to a background thread or coroutine (Kotlin) or dispatch queue (Swift). * Use Dart timeouts or loading indicators to keep the UI responsive while waiting. ### Calling `result` Multiple Times **Symptom:** The app crashes with a runtime error like "Reply already submitted" or shows inconsistent results. **What it means:** The native code responded more than once for the same method call. **Common causes:** * Both success and error branches are executed due to logic errors. * Async operations or callbacks race to return multiple responses. * A timeout, retry, or exception causes unintended second calls. **How to fix:** * Track whether a response has been sent using a flag (e.g., `var responded = false`). * Use return statements or guards to prevent multiple result calls. * Structure async callbacks carefully to ensure only one callback path runs. ### Debugging Tips by Platform **Flutter/Dart:** * Use `print()` or `debugPrint()` to log method calls and results. * Always wrap `invokeMethod` in `try/catch` and log exceptions. * Add logs before and after `invokeMethod()` to verify flow. * Use Flutter DevTools to inspect console logs and application state. **Android (Kotlin/Java):** * Use `Log.d("MethodChannel", "Received: ${call.method}")` inside the handler. * Use `adb logcat | grep flutter` to filter platform logs. * Ensure `configureFlutterEngine()` is actually called—older project setups may require manual configuration. * Use breakpoints in Android Studio for step-by-step inspection. **iOS (Swift/Objective-C):** * Use `print()` or `NSLog()` to trace handler execution. * Watch the Xcode console for startup logs or channel registration issues. * Ensure you're calling `result(...)` correctly and only once. * Check if the `AppDelegate` is properly casting `window?.rootViewController` to `FlutterViewController`. By understanding and anticipating these pitfalls, developers can avoid common errors that derail Flutter-to-native communication. MethodChannels are extremely reliable when implemented correctly, and with structured debugging, most issues can be diagnosed and resolved quickly—even in FlutterFlow Studio-generated apps where visibility into the build system may be limited. ## Performance and Architecture Best Practices Integrating native functionality through MethodChannels can bring significant value to your app \- but only if it’s done with performance and maintainability in mind. Below are the five most important best practices engineers should apply in real-world production apps, along with deeper insights into why each one matters. :::note[Important Context for FlutterFlow Studio Users] FlutterFlow Studio generates clean Dart code and supports Custom Actions for inserting Dart logic, but it does not currently support inline native (Kotlin/Swift) editing. ::: ### Don’t Block the Main Thread * By default, all MethodChannel calls are handled on the **main UI thread**, which is also responsible for rendering the app. * Native operations like database access, file I/O, Bluetooth scanning, or network requests **must** be moved off the main thread. * Use background threads (e.g., `Executors` or `coroutines` on Android, `DispatchQueue.global()` on iOS) to perform long-running tasks. * Return results on the main thread using `runOnUiThread` (Android) or `DispatchQueue.main.async` (iOS). Blocking the UI thread for even a few milliseconds can cause dropped frames, janky animations, and a visibly unresponsive app, especially on mid-range devices. :::tip While UI interactions and workflows look smooth inside FlutterFlow Studio, once you export and test the app on a real device, slow operations in Kotlin or Swift can still freeze the app. Always delegate those tasks to background threads before calling back into Dart. ::: ### Keep MethodChannel Code Minimal * Your MethodChannel handler should act like a **controller**, not a service. It should delegate execution to well-structured, modular native components. * This keeps the interface between Dart and native thin and easy to maintain. * For example, `getBatteryLevel` in Kotlin should just delegate to `BatteryService().getLevel()`. * This separation helps native teams evolve platform code independently of Flutter UI updates. Clean separation of concerns leads to better test coverage, easier onboarding, and avoids hard-to-debug cross-layer bugs. ### Use Only JSON-Compatible Data * The Flutter engine uses `StandardMessageCodec` for MethodChannel communication. * It supports only a limited set of Dart-native types: `int`, `double`, `bool`, `String`, `List`, `Map`, and `null`. * Any native types (e.g., `Bitmap`, `Bundle`, `NSData`, `UIColor`) must be converted to a JSON-friendly structure first. * If data is complex (e.g., a barcode result or device info), serialize it to a flat Map or a JSON string before sending it across. Type mismatches across the bridge don’t fail at compile time—they crash at runtime. Keeping your types simple prevents hard-to-diagnose issues. :::tip When using Dart Custom Actions that invoke MethodChannels, ensure the return values can be used in FlutterFlow Studio bindings. Only supported types (like `String` or `int`) can be stored in App State or used in conditions or widgets. ::: ### Validate and Sanitize Dart Inputs * Treat incoming Dart method calls like external API requests. Assume they can be malformed. * Use pattern matching (switch/case or `when`) to route and verify each method call. * Validate presence and type of arguments before using them. For example: ```js val timeout = call.argument("timeout") ?: return result.error("INVALID", "Missing timeout", null) ``` * Defensive coding helps avoid unexpected behavior, native crashes, or incorrect hardware usage. Dart developers might call your method incorrectly. Native code must fail safely and visibly. :::tip Custom Actions in FlutterFlow Studio can include parameters from the UI, but if the parameter isn’t set or passed correctly in a workflow, the Dart code will still execute. Validate these inputs natively before use. ::: ### Log Clearly on Both Sides * Add logging on both Dart and native layers for every MethodChannel call: * What method was called? * What were the arguments? * What was returned, and how long did it take? * Use structured logs (`Log.d("MethodChannel", "method=... args=... result=...")` on Android, `NSLog` or `print()` on iOS). * Align log timestamps across layers to help trace issues during debugging sessions. When something goes wrong in production, good logs make the difference between a 10-minute fix and a multi-day investigation. :::tip Use `debugPrint()` inside Dart Custom Actions to log output alongside platform logs. In test builds, these logs help verify whether native results are arriving as expected. ::: ## Summary & Guidance MethodChannels are a foundational tool for extending the power of your app beyond what plugins alone can provide. They allow direct access to platform-native APIs and SDKs, enabling teams to solve tough integration challenges and deliver production-grade features with full control. But like any system boundary, MethodChannels require disciplined design. Misuse can lead to fragile bridges, performance bottlenecks, and increased maintenance overhead. When implemented thoughtfully, MethodChannels provide: * A clean interface between Dart and native layers * Strategic reuse of platform-optimized SDKs and APIs * A clear path to ship advanced features without waiting on plugin ecosystems * A sustainable integration model that scales with your team and product Flutter will continue to evolve with innovative solutions for platform interoperability in the future through two key tools: FFIgen and JNIgen. FFIgen automates the creation of Objective-C and Swift API bindings, while JNIgen handles Java and Kotlin API connections, making native code integration more streamlined and maintainable across platforms. # Branching > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/collaboration/branching Learn how branching in FlutterFlow Studio allows you to add new features without disrupting your current progress. Understand the workflow of creating and merging branches, resolving conflicts, and the difference between merging and rebasing, with practical examples and tips. Branching creates a separate copy of your work, so you can add new features without disrupting your current progress. It enables multiple developers or teams to work simultaneously on different features without interfering with each other. Suppose you have an eCommerce app and you want to add a new feature, such as a product recommendation system. Instead of incorporating it directly into your existing `main` branch and potentially causing problems, you can create a branch to work on this new feature in isolation. Once it's complete, you can integrate it back into the `main` branch. :::note While all users can access the branching menu and create commits, only **Growth** plan and above support creating new branches. ::: :::caution Creating a branch here doesn't create one on GitHub. Branches stay and are managed solely within FlutterFlow Studio. You can also learn more about [**managing custom code on GitHub**](https://docs.flutterflow.io/exporting/push-to-github#manage-custom-code-on-github). ::: ## Branching Overview Before you create and merge a branch, it is essential to understand the general workflow. Here's what it looks like: ![branching](https://docs.flutterflow.io/assets/images/branching-overview-bbc4d99782390c8234732aaed3f94c1e.avif) First, create a new branch from the `main` branch. After making your changes in a new branch and finalizing the feature, merge this new branch back into the `main` branch. If there are any conflicts, you must resolve them first. :::note It’s important to understand what merging actually means. Merging does not perform a "union" of data between branches. Instead, Git merge reconciles differences (diffs) between the branches. When you merge, Git compares the changes made in the new branch with the main branch and applies these changes directly. For instance, if a branch is created and all existing data is deleted before new content is added, Git interprets this as a replacement. When the branch is merged back into the main branch, those deletions will also be applied removing the original data. This behaviour can be surprising to those expecting Git to automatically preserve all content from both branches. Learn more about [**Merging**](#merging). To avoid accidental data loss, ensure that your branch workflow involves incremental and intentional changes rather than deleting and replacing all existing content unless that's specifically your goal. ::: ## Creating a New Branch To create a new branch from the current branch, simply go to the **Branching Options** button next to current branch in the **Branching menu.**

:::tip You can create a new branch from any existing branch, however it's most common to create new branches from `main` ::: ## Commits A commit is essentially a saved snapshot of your project at a particular point in time. When you make changes to your project (such as adding new widgets, modifying actions, or configuring integrations), you can create a commit to save these changes. Each commit stores a record of what has been modified and serves as a version history for your branch, making it easy to see what has changed and roll back to previous versions if needed. ### Create Commits To create a commit, follow these steps:

:::tip[Best Practices for Commits] - **Commit Frequently:** Save your work often to ensure that changes are tracked, and you have a detailed version history. You can use the keyboard shortcut (cmd + enter) for faster iteration! - **Use Clear Messages:** Always provide meaningful commit messages that explain what was done. - **Test Before Committing:** Ensure that the project works as expected before committing significant changes. ::: ### View Commit Changes Once the commit is created, you can see the list of all commits under the **Branch History** section. Here, each commit is displayed with a timestamp, the user who made the changes, and a commit message. You can also search and filter through commits by specific users and date range. To see the commit changes, simply click on the commit. You’ll then land on a **Commit View** page where you can: - **Review Changed Files**: In the left panel, files that have been modified are marked with a gray dot, making it easy to spot which parts of your project have updates. - **Compare Before and After**: The center pane provides a side-by-side diff of the YAML for each changed file. Lines highlighted in red indicate removed or altered content, while lines in green show newly added or updated content. - **See Commit Statistics**: At the top of the page, you’ll see a quick summary of how many files were changed and the total lines added (+) or removed (-).

### Commit Options The options provided for each commit are as follows: - **View Commit:** This option lets you view the details of a particular commit. - **Restore Branch to Commit:** This option allows you to revert your branch to a previous commit. It creates a new commit that resets the branch to the state of the selected commit. This is particularly useful if a recent commit introduced issues, and you need to return to a stable point in the project's history. - **Copy Commit ID:** Every commit is assigned a unique ID. This option allows you to copy the commit ID, which can be useful for referencing specific commits in collaboration with team members. ### Commits vs. Snapshots and Versions FlutterFlow Studio offers multiple ways to save the state of your project at specific points in time. - **Snapshots** are automatically created as you edit your project. Think of them as automatic backups that you can revert to whenever needed. - **Versions and commits**, on the other hand, are manually created checkpoints. While both serve a similar purpose, commits offer more flexibility by allowing you to view the specific changes made in each commit. If you're using a plan that supports branching, it's recommended to use commits for better tracking and version control. You can learn more about [snapshots and versions here](https://docs.flutterflow.io/collaboration/saving-versioning). ## Merging Merging allows you to push the changes you've made in one branch into another. For example, you may want to push your changes from a feature branch, or a branch where you are developing a new feature, back into the `main` branch once it's ready to be deployed to your users. Say your feature branch has two commits: `Commit 1` and `Commit 3` (which are your changes), and `Commit 2` (made by a colleague in the main branch). The merge would look like the below image: ![after-merging](https://docs.flutterflow.io/assets/images/after-merging-bb3a6676d00f240174f0d6d2c7ec13c5.png) You can also merge changes from the parent branch, into the current branch. For example, say you want to pull the latest commits on `main` into your feature branch. This merge would look like the below image: ![after-merging-2](https://docs.flutterflow.io/assets/images/after-merging-2-0e2dd391925885e88d24733e9c17265a.png) During a merge, Git compares the changes made in both branches, if the changes don't overlap or conflict then the branches are automatically combined. If there are conflicts (for example, both branches modified the same widget property) you'll need to resolve these before the merge can be completed. :::note[Few things to note here] - At the moment, FlutterFlow Studio only supports merging into the parent branch, or the branch that the current branch was created from. - Only the user who initiated the merge can access both the branches during an ongoing merge. - Merges result in a merge [commit](#commits), which means you can undo a merge by restoring the branch to a prior commit - If you leave the project during the merge and come back, the progress you have made on the merge will be preserved. ::: Merging in FlutterFlow Studio uses Git under the hood to calculate differences between project files. Each project is backed by a repository of YAML files (except for custom code, which appears as Dart files). These YAML files map directly to various project properties, and Git calculates differences among these files to identify merge conflicts. :::note[Future Plans] - **Hover-Based Documentation**: Display helpful tooltips for YAML fields (scheduled before production release). - **Inline YAML Errors**: Show errors directly in the file for quicker fixes (scheduled before production release). - **Simplified YAML**: Make YAML files and errors more user-friendly and understandable. - **Enhanced Visual Diff Tools**: Provide more intuitive views for comparing changes. - **User Experience Improvements**: Continuously refine merging workflows and UI elements. - **Performance Optimizations**: Improve speed when initiating merges. ::: ### Initiating a Merge To initiate the Merge, navigate to **Toolbar >** select **Branching > Branching options >** select **Merge**.

When performing a merge in FlutterFlow Studio, you’ll see a screen with multiple panels and info sections. Here are the details of it. ![merging-window](https://docs.flutterflow.io/assets/images/merging-window-5801e73a0c51551eab1cbad7aed64101.avif) **Top Panel** - **Branch Information**: At the top of the merge interface, you’ll see exactly which branches are being merged. You have two options for merging directions: - **Parent → Child**: Pulls changes down from the parent into the child branch, often used to keep a feature branch in sync with the parent branch. parent-child - **Child → Parent**: Pushes features (or other changes) from the child branch back up to the parent, commonly done once a feature is ready to go into the parent branch. child-parent - **YAML Validation Errors**: These occur when the resulting data is not in a “FlutterFlow Studio-friendly” format—whether that’s due to manual edits or merges that generate incompatible YAML. For example, imagine you have two pages in your project, and each branch independently deletes a different one. After merging, there are zero pages left. Even though no lines of code are edited or directly have a conflict, this results in a YAML Validation Error. Clicking on these errors should redirect you to the specific file. Invalid lines will be underlined in red within the file, and, you cannot complete the merge while YAML errors exist. ![yaml-validation-error](https://docs.flutterflow.io/assets/images/yaml-validation-error-191b32eac7c334bdb481a34ece669a4d.avif) - **Project Errors**: Project errors occur when the result of a merge creates a problem in your project. For example, this might happen if the merge results in two data types having the same name. These errors need to be resolved to ensure your project works as expected. You have several options to deal with project errors: - **Fix Errors During the Merge**: This approach ensures that the merged project is error-free right from the start. Here’s how you can do it: - **Edit the YAML files:** Update the project YAML files (in the Right Lower Panel) to fix issues, such as renaming a data type that causes a conflict.

- **Edit the Project Directly while Merging:** While still in the merge process, open the project, make the necessary changes (like renaming the conflicting data type), and then continue. - **Fix Errors After the Merge**: If you prefer, you can complete the merge first and address the errors later. For example, finish the merge process as it is. After merging, go back to the project and resolve any issues. - **Cancel**: Abandons the merge process and discards any conflict resolutions you’ve already applied during this merge session. - **Merge**: Finalizes the merge once all merge conflicts and YAML validation errors are cleared. Project errors can remain if you choose to resolve them later. - **Bulk Accept Changes**: Accessible via the **arrow** next to **Merge** button. This option lets you accept all changes from one branch at once—handy if you already know which branch’s changes take precedence. ![bulk-accept](https://docs.flutterflow.io/assets/images/bulk-accept-dd67d3857d7e5b5ff873c4e53f05cddb.avif) **Left Panel** The left-hand side panel displays all the project files in YAML format. YAML (Yet Another Markup Language) files use a simple, human-readable format to define configuration data. They are particularly useful during a merge because they allow you to directly review, understand, and resolve any changes or conflicts in your project’s file. - **Filter Files:** You can use filters to narrow down the list of YAML files based on specific criteria: - **All Files (Unchanged Files)**: Shows every YAML file in the project that has no changes. - **Files with Changes**: Displays only files where a change has been made on either branch. - **Files with Conflicts**: Shows only files that have merge conflicts, where the changes in one branch directly contradict the changes in the other. :::note - A **change** refers to any update, addition, or deletion made in one of the branches. For example, modifying a field name or changing the properties of a widget. ![change](https://docs.flutterflow.io/assets/images/change-7047276948eae556fafbf757de879206.avif) - A **conflict** occurs when the same part of a file has been changed in both branches, making it unclear which version to keep. For instance, if one branch changes the color of the Container to blue and the other changes it to red, this creates a conflict. ![conflict](https://docs.flutterflow.io/assets/images/conflict-e8856491422d4b03fa8dc2bffdf9efda.avif) ::: - **Search File:** If you’re looking for a particular file, you can use the search bar to locate it quickly. This is especially useful in larger projects with many files. Clicking on a file in the panel opens it in the editor, allowing you to view, edit, and resolve issues directly. **Right Upper Panel** The Upper Right Panel offers a quick, side-by-side comparison of file changes from both branches, along with easy one-click accept buttons and previews. This panel makes it simple to decide which changes to keep or discard. :::note The edits are highlighted using green and red (Git) color coding: - **Green** indicates lines or values **added** (or unique) in one branch. - **Red** indicates lines or values **removed** (or replaced) by that branch. ::: - **Accept Change Button**: Quickly accept changes from one branch if you know it has the correct edits. - **Eye (Preview) Icon**: Open or view the file in the FlutterFlow Studio builder to see how the changes look. For example, you can preview a theme color change visually rather than just reading its name in the file. **Right Lower Panel** The **Lower Panel** displays the final merged files after Git applies its merging logic. It gives you a chance to manually inspect and edit the outcome—whether or not a conflict occurs. Git attempts to combine changes from both branches automatically. If Git can’t reconcile certain lines, it flags a **merge conflict** in the file. Conflicts appear with special markers like `<<<<<<<`, `=======`, and `>>>>>>>`. - `<<<<<<<`: Marks the beginning of other branch’s changes - `=======`: Separates your current branch’s changes from the other branch’s changes. - `>>>>>>>`: Marks the end of the conflict, indicating your current branch’s changes. :::tip You might decide to keep certain lines from `<<<<<<<` (from the other branch) or `>>>>>>>` (from your branch) or combine them manually. ::: You can modify files or edit the project directly from the lower panel at any time—even if there’s no conflict. After editing, click **Save Changes** to confirm your changes. A red reset button appears if you want to undo your changes and restore the file to its initial state before you began editing. For more information, check out the video below.

### Resolve Merge Conflicts A merge conflict occurs when multiple team members make changes to the same part of the project. For example, imagine two developers, Alice and Bob, are working on the same FlutterFlow Studio project and both decide to update the same button widget. | **Developer** | **Branch Name** | **Changes** | |---------------------|---------------------|----------------------------------------------------| | Alice | `feature-alice` | - Changes the button text to "Submit Form" | | | | - Changes the button color to blue | | Bob | `feature-bob` | - Changes the button text to "Send" | | | | - Changes the button color to green | When Alice's changes are merged into the main project first, her updates will be integrated without any issues. However, when Bob tries to merge his changes afterward, a merge conflict will occur because the changes to the button text and color have already been modified by Alice. When you initiate a merge using Git, the system attempts to automatically reconcile your project files. Any conflicts that cannot be automatically resolved are flagged for your attention. You can review each file with merge conflicts and choose to: - Accept all changes from one branch. ![accept-all-from-one-branch](https://docs.flutterflow.io/assets/images/accept-all-from-one-branch-dc23fea9853ea19f885cea8a473716eb.avif) - Pick specific changes from any branch. ![accept-specific-change-from-file](https://docs.flutterflow.io/assets/images/accept-specific-change-from-file-3123c05847bd438e8ce69ad336f7bc5c.avif) - Manually edit the YAML files. **Note that** it’s essential to correct any YAML validation errors that arise from manual edits.

Finally, complete the merge by clicking **Merge**. :::tip - If you merged a child branch into its parent and are confident everything looks correct, you may delete the child branch. - If you find any issues after the merge, you can revert the branch to an earlier commit. However, be aware that any changes made after that commit will be lost. ::: ## Branch-level Permissions In your project, you have the ability to assign specific roles such as **Editors** and **Mergers** to project members for each branch. To configure these permissions, navigate to **Settings & Integrations > Project Setup > Collaboration > Branch-Level Access**. ![branch-permission](https://docs.flutterflow.io/assets/images/branch-permission-9bf4148afe3cc265ffdb3ee474c17766.png) - **Editors** assigned to a branch have the authority to make direct modifications to the project while working within that branch. - **Mergers** on the other hand, are only allowed to merge other branches into that branch. This is especially useful for protected branches where you don't want any users to make direct modifications. Instead, users should only merge other branches into that branch. ## Closing Branch Closing a branch is a common practice after the branch has served its purpose, typically once its changes have been merged into another branch (like the `main` or `development` branch). By regularly closing inactive or merged branches, you help maintain a clean, efficient, and well-organized project. :::note[When to Close a Branch] - **After a Merge:** Once the branch’s changes have been merged into the `main` branch (or another target branch), it’s safe to close the branch. This often happens after a feature is complete or a bug is fixed. - **Unused Branch:** If a branch is no longer needed (e.g., a feature was abandoned or changes were made in another branch), it’s a good idea to close it. ::: Here’s how you can close a branch:

:::tip[Best Practices] - **Review before deletion:** Before closing a branch, ensure that all necessary changes have been merged or no longer need to be kept. - **Coordinate with your team:** If you’re working in a team, ensure that no one is actively using the branch before you close it, to avoid disrupting ongoing work. ::: Once a branch is closed, it will no longer appear in the list of active branches. However, you can restore a closed branch within **30 days** of its closure. ### Restore Branch To restore a branch, open the **Branch Filter** menu and enable **Show Closed Branches**. Search for or select the branch you want to restore, and it will open in a new browser tab. Then, within the closed branch, open the **Branching Options** menu and select **Restore Branch** to reactivate it.

## FAQs
How YAML files are helpful during a merge?

YAML files play a key role in managing and resolving conflicts during the merge process because: - YAML files hold important configuration data, such as settings, resource definitions, and project properties. During a merge, changes in these files reflect modifications to the structure or behavior of the project. - The simple and hierarchical nature of YAML makes it easy to spot changes or conflicts, even in complex files. - YAML files allow you to manually edit and resolve conflicts during the merge process. - Since YAML files are text-based, they are version-controlled effectively, enabling multiple team members to make changes and merge their work.

Why didn’t all my changes appear after merging two branches?

Merging in Git is not like copying everything from one branch into another. It’s more like combining changes from two versions of a document based on a common starting point. Let’s say you and your friend both made changes to the same project: - You both started with the same original version (this is called the common ancestor). - You made your changes in `Branch A`. - Your friend made changes in `Branch B`. When you merge `Branch B` into `Branch A`, Git compares: - What changed in `Branch A` since the common starting point. - What changed in `Branch B` since the common starting point. If both of you changed different parts, Git can merge them easily. But if you both changed the same part in different ways, Git won’t know which one to keep, that's called a conflict, and you'll need to resolve it manually. ![git-merging-behavior](https://docs.flutterflow.io/assets/images/git-merging-behavior-086d608f27fae6843bcd054db6a244b0.avif)

Here are a few other things to know:

  • No conflicts ≠ no changes: “No conflicts” doesn’t mean “no changes” and it definitely doesn’t mean the project is error-free.
  • Project errors are not bugs: Project errors let you know that you are making mistakes when merging data. Even if changes are successfully merged, project errors indicate areas you should double-check to ensure everything merged as expected.
  • If a change was previously accepted or rejected during a merge, it won’t appear as a diff the next time you merge the same branches. That’s expected behavior.

For example, you merge `Branch B` into `Branch A`, and `change C` (which exists in `Branch B`) gets copied over to `Branch A`. Later, you decide to undo `change C` directly on `Branch A`. Now, if you merge `Branch B` into `Branch A` again, Git will not re-flag `change C` as a difference. This is because Git considers it already merged and no longer a diff.

Best Practice: Keep your branch histories short and simple. After each merge, delete the merged branch to avoid unnecessary complexity. For example, if you merge `Branch B` into `Branch A`, and later want to undo or revise those changes, don’t go back and modify `Branch B`. Instead, create a new branch (e.g., `Branch C`) from `Branch A` to make your updates. This approach prevents intertwining branch histories, avoids confusing merge behavior, and ensures clean, trackable diffs. Keeping branches focused and temporary makes merging more predictable and manageable.

# Saving and Versioning > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/collaboration/saving-versioning Learn about versioning in your FlutterFlow Studio. In this section, we discuss the important concepts of saving and versioning in your project. Understanding how to use versions, snapshots and commits can be crucial in preventing loss of work and maintaining progress. ## Versions :::caution[Project Versions are now deprecated] You can no longer create new versions in FlutterFlow Studio. However, any previously created versions will remain accessible. Moving forward, we recommend using [**Commits**](#commits), which provides a more robust way to track changes and manage your project history. ::: ### Restoring a version Restoring the previous version will preserve the current version, then load the changes from the version you're restoring. Before restoration, you may want to view the changes in the previous version. To do this, select the **Peek** option, which opens the previous version in a new tab. ![restore-version](https://docs.flutterflow.io/assets/images/restore-version-801604fdeba89500669a9e66822f191e.avif) ## Commits Commits are similar to versions in that you can save the state of your project at a point in time. Commits are saved to a specific branch's history. With commits you can view the specific changes made in that commit and restore a branch to the state of a specific commit. For more details see this page on [Branching and Commits](https://docs.flutterflow.io/collaboration/branching#commits). ## Snapshots Snapshots are automatic saves of your project's state as you build it. They allow you to **Peek** or **Revert** to a previous state of the project if needed. ![snapshots](https://docs.flutterflow.io/assets/images/snapshots-4bb79f7b55a02f7d11d2dfe7001a8da2.avif) :::note - Users on the **Free** plan can access automated snapshot backups from **up to 1 hour prior**. - The **Basic** plan allows access to backups from **up to 1 day prior**. - The **Growth** plan provides access to backups from **up to 3 days prior**. - The **Business** plan extends this to **up to 7 days prior**. - For **Enterprise** users, snapshot retention is **customized**. ::: # Development Environments > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/testing/dev-environments Learn how to create and leverage development environments in FlutterFlow Studio. Development Environments in FlutterFlow Studio allow you to set up multiple environments for your apps, such as `Development`, `Staging`, and `Production`. For each environment, you can create environment-specific values and databases. This allows you to easily point to different backends depending on where you are in your development lifecycle. :::note By default, every FlutterFlow Studio project starts with a `Production` environment. ::: :::note[When to Use Dev vs. Staging Environments] - **Dev Environment**: Use for testing and developing new features without affecting production data. - **Staging Environment**: Use to simulate the production environment before launching, and is isolated from the actual production data. *This is a common best practice, but you can create custom environments with different names for your own workflow.* ::: ### Create and Switch Development Environments You can create and switch environments in the **Dev Environments** page in **App Settings**. You can always see the current environment that is selected by looking in the top left hand corner of the project.

The selected environment is used to generate the proper app code when you run, test, deploy or export your app. The only things that change between environment are the [Firebase Project](#configuring-firebase-or-supabase-for-each-environment) or variables that are tied to [Environment Values](#environment-values) ### Environment Values Environment Values can be used to dynamically change parts of your app's code based on the environment that is being used. For example, in an e-commerce app, you might define an `apiUrl` Environment Value that points to different API URLs for Development, Staging, and Production. This allows you to test new features without affecting the live production environment, where real customer orders are processed. #### Use Environment Value Let's see an example of creating and using `apiUrl`:

:::tip[Generated Code] When you switch to an environment, FlutterFlow Studio generates code specific to that environment, for any of the following interactions: - Test / Run mode sessions - Local Run - Code export - Deployment You may also encounter different project errors depending on the selected environment. In the generated code, FlutterFlow Studio creates two files: - `environment.json` – Stores the environment values defined by the user in FlutterFlow Studio. - `FFDevEnvironmentValues` class – A singleton class that holds a single instance of the `FFDevEnvironmentValues` object. It includes initialization logic and getters for accessing these environment values. They can also be referenced in your custom code resources. See **[Common Custom Code Examples](https://docs.flutterflow.io/concepts/custom-code/common-examples#get-dev-environment-values-in-custom-code)**. ::: #### Private Environment Values You can mark environment values as private when they contain sensitive information that should not be exposed in the client-side code. :::caution Private environment values are not included in the compiled application code and are never exposed to end users. However, if a private environment value is used in a private API call that runs through a generated cloud function, the value may appear in the cloud function’s code. When exporting or pushing your project to GitHub, you must review and manage these cloud function files—for example, excluding them with `.gitignore` if they contain sensitive information. ::: Currently, the only way to use a private environment value is as a variable in a private API call. Since private API calls are routed through a Cloud Function, the variable value remains hidden from any client-side requests made by the app. :::tip[Generated Code] For private environment values, the generated code does not include these values in the `environment.json` file, and no getter logic is created in the `FFDevEnvironmentValues` class. ::: ### Configuring Firebase or Supabase for each Environment A single FlutterFlow Studio project can have **multiple environments**, each mapped to its **own Firebase or Supabase project**. This ensures that environments like `Development`, `Staging`, and `Production` remain independent, giving you better control over your app's data and behavior throughout different stages of development. ![flutterflow-environment](https://docs.flutterflow.io/assets/images/flutterflow-environment-update-ebd402503ef403cb632e068bfe98d81f.avif) You must complete the Firebase or Supabase setup for an environment before you can test your app using that environment. However, this doesn't stop you from continuing to run and test your app in other environments. Just switch back to Production, and you can keep testing while finishing the setup for the new environment. #### Configuring Firebase If your project uses Firebase, you'll need to create a separate Firebase project in the Firebase Console for each environment. Then, you can change the selected environment in the Firebase settings page (see below), and follow the steps to [**manually configure the Firebase project**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#connect-an-existing-firebase-project-manually) for each one. ![firebase-dev-env-config.png](https://docs.flutterflow.io/assets/images/firebase-dev-env-config-e6341ee4a2459cbd8b1dd84cea224c07.png) Additionally, you must manually set up [**Firestore rules**](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules) and [**collections**](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections) for the new environment. :::note The data that you add to Firebase through the Content Manager is specific to the Firebase project, and environment, that you have selected. ::: #### Configuring Supabase If your project uses Supabase, you'll need to [**set up a new Supabase project**](https://docs.flutterflow.io/integrations/supabase/setup) for each environment. Create environment-specific values like `SupabaseAPIURL` and `SupabaseAnonKey`, and then configure the Supabase properties to point to these newly created values. Below is an example of how it would look like.

:::note It's recommended that you keep schemas consistent between the different Supabase environments. It's also recommended that you **Get Schema** from the Production environment and build from there. ::: ### FAQ
How can you push code from one environment to another?

It’s important to note that the **Development Environments** feature in FlutterFlow Studio is primarily designed to configure different backends for testing If you are building new features, you should consider using [**Branching**](https://docs.flutterflow.io/collaboration/branching). You can develop and test new features on a new branch by selecting a development environment. Once tested, you can merge the branch into `main` and switch to the `Production` Environment to go live.

Are you using Flutter flavors under the hood?

No, FlutterFlow Studio does not use Flutter flavors. Instead, it generates code based on the environment selected in FlutterFlow Studio. The environment-specific code is generated and applied for the following actions: - Test / Run mode sessions - Local Run - Code export - Deployment

How to deploy apps for different environments?

You can configure deployment settings for each environment using the dropdown interface on the deployment page. For mobile, set a new package name, and for web, set a new site URL. Once done, deploy your app as usual. See how to do it in [**detail here**](https://docs.flutterflow.io/deployment/deploy-for-environments).

# Run your App > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/testing/run-your-app Discover the essentials of running and testing your FlutterFlow Studio app with this comprehensive guide. Running and testing your app is a crucial part of the app development process. This page provides a comprehensive guide on how to run and test your FlutterFlow Studio app. It covers various modes of testing, including [Preview](#preview-mode), [Test](#test-mode), [Run](#run-mode), and [Local Run](#local-run) modes, with detailed steps and indications of when to use each mode. :::note You can access various modes of running your app from the [**Toolbar**](https://docs.flutterflow.io/flutterflow-ui/toolbar). ::: ![run your app](https://docs.flutterflow.io/assets/images/run-your-app-61003863bd89e585f73f68fc26c93b83.avif) ## Preview Mode You can use the Preview Mode to quickly try out your app on a virtual device without waiting for it to build. This is helpful primarily for navigation and animations. You can also preview your app in the Dark/Light mode and visualize it on various mobile, tablet, and desktop devices. ### When to use Preview Mode The primary benefit of **Preview Mode** is that it allows your app to load instantly, making it ideal for UI testing. However, most business logic is not included in this mode. As a result, this mode is used less frequently than other testing modes, which provide a more comprehensive evaluation of the app's functionality. :::caution[Preview Mode Limitations] - Actions may not trigger or work properly. - FontAwesome icons jump around when mouse hovers over certain material widgets. - Firestore data is not loaded from Firebase. - Firebase auth flow can't be tested. We always allow log in. - API Calls can't be run or tested here. - Refresh if animation actions are not working. - Refresh if Clear TextFields actions are not working. - RevenueCat data is not loaded. - Paywall actions execute as if the entitlement is active. - Hero Animation may not work on dynamically generated widgets. - Dropdown disabling does not work in Preview Mode. - Tooltip does not work for some screen sizes in Preview Mode. ::: ## Test Mode The **Test Mode** runs a web version of your FlutterFlow Studio app and uses Flutter's Hot Reload feature, which lets you immediately see any changes made to code in an emulator or on-device. Running your app in Test Mode helps you experiment, test UIs, and fix bugs faster. To run your app in Test Mode: 1. Select **Test Mode** from the left-side menu. The test environment will launch and be ready to use within a few minutes. 2. Once Test Mode is running, make changes in the FlutterFlow Studio builder, such as updating colors, layouts, or widgets. 3. In Test Mode, **Sync changes automatically** is enabled by default, so changes made in FlutterFlow Studio are automatically synced to the running app. 4. If you disable auto-sync, click **Hot Reload** or press `Cmd/Ctrl + J` whenever you want to manually sync and preview the latest changes. 5. Use **Hot Restart** when changes require a full restart, such as dependency updates or certain state model changes.

:::note **For users on a paid plan**, Test Mode sessions do not expire and can remain active indefinitely until manually stopped. **For users on the Free plan**, Test Mode sessions expire after 20 minutes. Once a session expires, you can start a new one by clicking the **New Session** button. ![new-session](https://docs.flutterflow.io/assets/images/new-session-586a87a3ac25f5881e09126311c15b86.avif) ::: ### Floating Window A Floating Window displays the running app on top of the builder, allowing you to design and test at the same time without switching between tabs. The Floating Window makes iteration much faster because you can immediately see the impact of your changes while working in the builder. It makes it easier to fine-tune layouts, styling, and interactions. To open the Floating Window, start a Test Mode session and click the **Floating Window** icon in the Test Mode toolbar. A movable preview of your app will appear over the builder, allowing you to keep the live app and editor visible at the same time. You can drag the window anywhere on the screen and resize it as needed while continuing to edit your app.

### Inspect Mode Inspect Mode helps you quickly locate widgets in the FlutterFlow Studio builder while testing your app. This is especially useful when working with large pages or deeply nested layouts. Instead of manually searching through the Widget Tree to find a specific button, image, text, or container, you can simply click it in the running app and jump directly to its location in the builder. To use Inspect Mode, click the **Inspect Mode** icon in the Test Mode toolbar. Once enabled, select any widget in the running app preview. FlutterFlow Studio will automatically navigate to and highlight the corresponding widget in the builder, allowing you to inspect or edit it immediately. When you're finished, click the Inspect Mode icon again to exit inspection mode and continue interacting with the app normally. ### Widget Tree in Test Mode The **Widget Tree** tab shows the widget hierarchy for the current page in the running app. Use it to locate and highlight widgets without leaving Test Mode. To locate a widget and open it for editing: 1. In Test Mode, select the **Widget Tree** tab. 2. Hover over or select a row to outline the corresponding widget in the running app. 3. Right-click the row and select **Open in UI Builder** to switch to the UI Builder with the widget selected. :::note The tree updates as you navigate between pages. When it includes multiple pages or components, use the buttons at the top of the tree to switch between them. The tree is read-only: you can't drag widgets or add child widgets. Make those changes in the UI Builder. ::: #### Right-Click a Widget Right-click a row in the Widget Tree or a widget in the running app to open it in the UI Builder or send it to the AI Agent. The menu includes these options: - **Open in UI Builder:** Switches to the UI Builder with the widget selected. - **Add to Agent Chat:** Attaches the widget to the current [AI Agent](https://docs.flutterflow.io/concepts/ai-agent) chat. - **Ask Agent:** Starts a new AI Agent chat about the widget.

### Test Mode on Mobile You can open the current Test Mode session directly on a physical mobile device. This allows you to test your app on actual hardware and verify touch interactions, layouts, scrolling behavior, and overall user experience. To open the session on your phone, click the **QR Code** icon in the Test Mode toolbar. FlutterFlow Studio will generate a QR code and a unique session link. Scan the QR code using your phone's camera or open the generated link on your mobile device. The app will load the same active Test Mode session that is running in your browser. :::caution The generated link is tied to the current Test Mode session and will stop working when the session ends. ::: ![test-mode-in-phone](https://docs.flutterflow.io/assets/images/test-mode-in-phone-2c85818cfd1323b0164376ca0ffc0c19.avif) ### Debug info Test mode also includes a **Debug Info** panel, which provides a real-time view of all variables with their current values. It includes search and filter options, allowing you to find variables based on type or nullability. This is particularly useful for developers who need to track the state of the app and diagnose issues efficiently. ![deubg-info](https://docs.flutterflow.io/assets/images/deubg-info-f3da771189b805d1e3c99110a4dbccbd.avif) ### Fix Errors with AI In the FlutterFlow Studio desktop app, when Test Mode reports a runtime error, select **Fix with AI** to open the [AI Agent](https://docs.flutterflow.io/concepts/ai-agent) panel with the error text. Add context about what you were doing when the error occurred, or send the error as is. Review the agent's suggested changes, then retry Test Mode to check the result.

:::caution[Test Mode Limitations] **Test Mode** has certain limitations because some packages are not supported on the web and because of the way FlutterFlow Studio configures your project to run in the cloud. - If you see a grey "broken" screen with a sad face, it may be a DNS server issue with your network provider. We recommend using CloudFlare's 1.1.1.1 DNS server. [**Click here**](https://developers.cloudflare.com/1.1.1.1/setup/) to see instructions. - Lottie animation may not load if you provide a variable path. - Cookies need to be enabled for Test Mode to function properly. They are only used for functional purposes. - If you see a progress bar where the phone outline should be that lasts longer than 15 seconds, try refreshing the page. - The device screen can not be wider than the page's width. - Copy to Clipboard Action is not supported in Test Mode. Use [**Run Mode**](#run-mode) to avoid this issue. - Widgets with Shimmer or Tint animation might not appear properly. - Assets used within Custom Code might not appear properly. - Audio Recording actions do not work in Test Mode; use web publishing in Settings to test recording audio or test it on emulator via Local Run. ::: ## Run Mode You can test a fully functional version of your app using the **Run Mode**, including live data. It will build the app, which typically requires around 2-4 minutes - but can be longer for larger projects. You can then interact with your app through your web browser. This is a web version of the app, identical to the version that is run on _Test Mode_. To run the app in Run Mode, click on the **dropdown** next to the Test Mode button and click the play button or press **Cmd/Ctrl + E** (keyboard shortcut). This will run your app in a new browser window. ### When to use Run Mode The main benefit of Run Mode is the ability to share a running app within your team via a link. Please note that, **Run Mode links are not public**; they are only accessible to project members. Even if the project is made public (allowing others to view and clone the project), the visibility of Run Mode links remains restricted to project members. All Run Mode sessions will persist and can be accessed from the dropdown menu next to the lightning bolt icon in the upper right of the FlutterFlow Studio builder. ![run-project-versions](https://docs.flutterflow.io/assets/images/run-project-versions-4a8611a8a0971f33edc403b661e723e8.avif) :::caution[Run Mode Limitations] Run Mode does not support Hot Reloading, so any changes you make to your app will not be reflected in the Run Mode. In order to see the changes, you would have to create another Run Mode. ::: ## Local Run Local Run downloads the code locally and gives you the option to use [Flutter's Hot Reload](https://docs.flutter.dev/tools/hot-reload) or Hot Restart to see your changes instantly on a device. See how to setup Local Run [here](https://docs.flutterflow.io/testing/local-run). :::note Please note that Local Run is currently available only on the [**Paid Plans**](https://flutterflow.io/pricing). ::: ## FAQ
I don't see the new Test Mode option in the left sidebar.

If the new Test Mode option is not visible in the left sidebar, open the test menu and enable the Use new test mode option. Once enabled, the new Test Mode option will appear in the navigation menu.

# Local Run > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/testing/local-run Local Run downloads the code locally and gives you the option to use Flutter's Hot Reload to see your changes instantly on a device. You can test your app on a real device using the Local Run feature, which is available in the FlutterFlow Studio Desktop App. Local Run automatically tracks changes in your FlutterFlow Studio project, downloads the code locally, and gives you the option to use Flutter's Hot Reload or Hot Restart to see your changes instantly on a device. :::note[**Prerequisites**] Testing on mobile devices requires downloading code, for which you must be on [**paid plans**](https://flutterflow.io/pricing). ### iOS Setup For iOS app testing on a device or simulator, you need a Mac with Xcode. Apps that use Firebase require Xcode 26.2 or newer. Follow [**these instructions**](https://docs.flutter.dev/get-started/install/macos/mobile-ios?tab=download#configure-ios-development) to set up your Mac, which includes [**setting up your device for testing**](https://docs.flutter.dev/get-started/install/macos/mobile-ios?tab=download#configure-your-target-ios-device). ### Android Setup For Android app testing on a device or emulator, configure your machine ([**Windows**](https://docs.flutter.dev/get-started/install/windows/mobile?tab=virtual), [**Mac**](https://docs.flutter.dev/get-started/install/macos/mobile-android?tab=virtual), [**Linux**](https://docs.flutter.dev/get-started/install/linux#android-setup)) by following [**these instructions**](https://docs.flutter.dev/get-started/install/macos/mobile-android?tab=virtual#configure-android-development), which include [**setting up your device for testing**](https://docs.flutter.dev/get-started/install/macos/mobile-android?tab=virtual#configure-your-target-android-device). ::: ## Using Local Run Here are the steps to use local run: 1. Download the [desktop](https://flutterflow.io/desktop) app and open your project. 2. In the [Toolbar](https://docs.flutterflow.io/flutterflow-ui/toolbar), click on the **dropdown** next to the *Test Mode* button and click **Setup Local Run**. This will open the setup wizard. ![setup-local-run](https://docs.flutterflow.io/assets/images/setup-local-run-ccd7811b7cb820f9f949185b93e1ca53.avif) 3. To run the app locally, you'll need the Flutter SDK. Click the **Download** button to download it. **Note** that for iOS, ensure you have *Xcode* and *CocoaPods* installed, select the checkmark, and then click **Download**. ![download-flutter-sdk](https://docs.flutterflow.io/assets/images/download-flutter-sdk-5dcbdc286c65082b012c91321e36e39f.avif) 4. Once it's ready to use, click the **Continue** button. This will run the **`Flutter Doctor`** command to check your environment for any issues that might prevent you from running the applications. It performs a series of checks to verify that the necessary tools and dependencies are correctly installed and configured on your system. ![doctor-output](https://docs.flutterflow.io/assets/images/doctor-output-da2d64e4465ae9aefe070cea216c5f32.avif) 5. Optional: You can set up your preferred IDE to open the project code directly from the local run. To do this, select your IDE, **Select Path**, and click **Save**. This feature is useful for debugging and understanding your project code. For this step, ensure you have setup [Flutter SDK](#2-setup-flutter-sdk) and [IDE](#3-installing-ide-and-plugins). :::note - The local run uses its own isolated Flutter SDK to ensure consistency and compatibility. The SDK is stored separately from any existing Flutter installations on your system and is automatically used to run your app and open projects in VS Code. For other IDEs like Android Studio, you need to set the SDK path to FlutterFlow Studio's version manually. - **Please note** that any changes made in the IDE will not sync with the FlutterFlow Studio project and will be overwritten when you hot reload or restart the app. - The path is the location of the IDE on your computer. On macOS, it's typically in "Applications," and on Windows, it's usually in "Program Files." - Also, see how to [**access the project code**](#access-project-code). ::: ![config-IDE](https://docs.flutterflow.io/assets/images/config-IDE-3cd6d998b47f2e689b71921d080a1806.avif) 6. In the **Code Export** section, you can configure how Local Run exports and updates your FlutterFlow Studio project code. - **Experimental Speed Up**: Uses an optimized export pipeline to significantly reduce export times. When enabled, Local Run can also work offline for faster iteration. If you experience export-related issues, you can disable this option. - **Format Exported Code**: Controls whether the exported code should be automatically formatted. Disabling formatting improves export speed, which helps during rapid iteration. However, if you plan to inspect or modify the generated code, it’s recommended to keep this enabled. - **Enable Debug Logging**: Includes logging support in the exported app. Keeping this enabled allows you to use the FlutterFlow Studio Debug Panel inside DevTools for debugging and inspection. - **Auto Hot Reload**: Automatically triggers a hot reload whenever changes are made in FlutterFlow Studio. This removes the need to manually trigger hot reload after every update. - **Auto Hot Restart**: Automatically performs a full app restart when changes require more than a hot reload, such as new dependencies or state model updates. This is disabled by default because full restarts are slower than hot reloads. - **Inspect mode**: Available in the new builder only. Enabled by default. Lets you turn on Inspect Mode while the app is running and tap a widget on the device to select it on the canvas. This adds small comments to the exported code that map each widget back to the canvas. If you disable it, the inspect button is hidden, and the change takes effect from the next code export. ![local-run-code-export](https://docs.flutterflow.io/assets/images/local-run-code-export-6b12621e787e585534fcd0ba8f76b6a6.avif) 7. From the test menu, click on the **Get Devices** button. This will list devices connected to your system. You can add or remove devices from the list by clicking on the **+** and **-** buttons, respectively. Once you've finalized your selection, simply click on the **Test** button to see your app running on selected devices. **Tip**: In the Mac OS desktop app, you can directly open the simulator by clicking on the **Launch iOS Simulator** text. To test app on a real device, see how to [setup a physical device](#setup-physical-device).

8. After you make a change in your app, open the test menu to access options like **hot reload**, **hot restart**, and **stopping** your app. You'll notice that the test mode button has now changed to the **Hot Reload** button, which you can click anytime to instantly see your changes reflected on your device. **Hot Reload** updates UI instantly without losing its state, while **Hot Restart** recompiles and reloads the entire app, resetting its state. For more info, you can visit [Flutter's Hot Reload documentation](https://docs.flutter.dev/tools/hot-reload). ![run-controls](https://docs.flutterflow.io/assets/images/run-controls-af8bd39b1b2838b4f99b6d9c8e2caa41.avif) ### Select a Widget from the Device with Inspect Mode Inspect Mode is available in the new builder. To switch, see [Classic and New Builder](https://docs.flutterflow.io/flutterflow-ui/builder#classic-and-new-builder). While your app is running, you can tap a widget on the device and have FlutterFlow Studio select it on the canvas. This requires **Inspect mode** to be turned on in the **Code export** settings. 1. Run your app with Local Run. 2. In the test menu, click the inspect button (tooltip **Switch to Inspect Mode**). The same button appears in the controls that replace the test mode button while the app runs. 3. Tap a widget on the device. FlutterFlow Studio opens the UI builder and selects the matching widget. 4. To turn it off, click the button again (tooltip **Exit Inspect Mode**), or exit select mode from the device's own inspector button.

:::note - If you hot restart the app, Inspect Mode stays on. - Tapping a widget that comes from a package or from Flutter itself selects the nearest widget from your project that contains it. ::: ## Setup Physical Device Testing your app on physical devices is essential to ensure it performs as expected in real-world scenarios. To set up a physical device, first, launch the project in **Android Studio** or **Xcode**, depending on the platform you are targeting. You can easily access these options by clicking on the **code icon** in the **Local Run** menu. ![access-project-code.avif](https://docs.flutterflow.io/assets/images/access-project-code-b77d440078de6a10c3cf93798c5eb5f5.avif) ### Setup Android Device To setup Android physical device, first enable Developer Options and USB Debugging in your Android device. Navigate to **Settings > About phone**, tap **Build number** seven times to activate Developer Options, then go to **Settings > System > Developer options** and enable **USB debugging**. Connect your device to your computer via USB, authorizing the connection if prompted. Verify the setup by running `flutter devices` in Android Studio’s terminal; your device should appear in the list of connected devices. :::note For more detailed guidance, refer to the [**Android Flutter documentation**](https://docs.flutter.dev/get-started/install/macos/mobile-android#configure-your-target-android-device). ::: ### Setup iOS Device To setup iOS physical device, you must configure your **Apple Developer account** and set up **code signing** in Xcode. First, add your **Apple ID** by opening **Xcode > Preferences > Accounts**, clicking **"+"**, selecting **Apple ID**, and signing in. Next, assign your project to a development team. Open your project in Xcode, select the **Runner** project, go to **Signing & Capabilities**, and choose your **Apple Developer team** in the **Team** dropdown. If your team is not listed, ensure that your Apple ID has been properly added to Xcode. Finally, configure code signing to allow your app to run on a real device. Ensure **"Automatically manage signing"** is enabled. Xcode will attempt to create and download a **provisioning profile** for your project. If issues arise, you may need to manually create a provisioning profile in the **Apple Developer Certificates, Identifiers & Profiles** section. Once created, download and double-click the provisioning profile to install it in Xcode. :::note For more detailed guidance, refer to the [**iOS Flutter documentation**](https://docs.flutter.dev/get-started/install/macos/mobile-ios#configure-your-target-ios-device). ::: ## Access Device Logs in Local Run Device logs provide a way to access and view the logs generated by your app while it's running on a device or simulator. They are invaluable for understanding the inner workings of your app. If something isn't functioning as expected, the device logs can reveal the reasons behind it. To access the device logs, first run your app using the local run. Then, open the test menu and click on **Logs** icon. This will display a floating window with detailed logs of the app while it's running. ![access-device-logs](https://docs.flutterflow.io/assets/images/access-device-logs-2-409187df261c87da7bcf5c2122b13008.avif) ### Console Input The console input in local run is particularly useful for performing hot reload and hot restart directly from the device logs. To initiate a hot reload, press `r` followed by `Enter`, and for a hot restart, press `R` followed by `Enter`. Additionally, any terminal commands commonly used with Flutter while running an app should work with the console input.

### Checking Errors Any errors displayed in the red box on your screen are also recorded in the Device logs, where you can find detailed information about the app's state and the events leading up to the issue. ## Reconfigure Local Run Setup If you need to update the Flutter SDK version, run Flutter Doctor, or start the simulator again, simply open the test menu and click **Configure**. ![reconfigure-local-run.avif](https://docs.flutterflow.io/assets/images/reconfigure-local-run-2-73aba54c54ec4217e046f342cd5a0491.avif) ## Access Project Code To access the project code, open the test menu and ensure the project is not running. Click on the **code icon**, and you'll be presented with options to either open the project folder, project in your preferred IDE or directly launch the project in Xcode (for macOS users). ![access-project-code.avif](https://docs.flutterflow.io/assets/images/access-project-code-b77d440078de6a10c3cf93798c5eb5f5.avif) ## Manually Download Code and Run There may be certain situations where you, as a developer, may prefer not to have local runs overwrite any changes that have been made in the code. In such cases, you can manually download the code onto your local system and then make any modifications as needed. Here’s how you do it: 1. [Download code](#1-download-code) 2. [Setup Flutter SDK](#2-setup-flutter-sdk) 3. [Installing IDE and Plugins](#3-installing-ide-and-plugins) 4. [Running app on device](#4-running-app-on-device) ### 1. Download Code :::caution - Project code download is available only on the paid plans. - Make sure to address any project issues before downloading the code. ::: To download your app code, you have two options: - Use the [FlutterFlow CLI](https://docs.flutterflow.io/flutterflow-cli/exporting). (Recommended) - Alternatively, from the **Toolbar**, click on the **Developer Menu** > **Download Code**. This will download the *.zip* file. Extract the *.zip* file to view the contents of the project. ### 2. Setup Flutter SDK You can download the latest Flutter SDK from [here](https://docs.flutter.dev/get-started/install). However, we recommend using the Flutter SDK downloaded by the [local run](#using-local-run), whether you have already downloaded the Flutter SDK or not. This approach ensures compatibility with FlutterFlow Studio projects and helps you avoid issues arising from version differences. To do this, copy the Flutter SDK path (click 'this path' button) from the local run and [add it to your system path](#troubleshooting). ![setup-flutter-SDK](https://docs.flutterflow.io/assets/images/setup-flutter-SDK-57c8c80b82e6d2998cc36b930153bc01.avif) If you prefer to use your existing Flutter SDK, you can follow the steps below to avoid any versioning issues: 1. Take note of your FlutterFlow Studio project version. ![check-flutter-version.avif](https://docs.flutterflow.io/assets/images/check-flutter-version-2-ae7065141a80cc79c9eec976e7dfc296.avif) 1. Check your current Flutter SDK version by entering the following command in the terminal. `flutter --version` 2. If that is different from what FlutterFlow Studio uses, you may need to switch to the supported version. 3. To install a specific version of Flutter, use the following command: 1. To **downgrade** flutter version: ``` flutter downgrade ``` 2. To **upgrade** flutter version: ``` flutter upgrade --force ``` Replace `` with the version supported by FlutterFlow Studio. ### 3. Installing IDE and Plugins You can choose to install either [Visual Studio Code](https://code.visualstudio.com/) or [Android Studio](https://developer.android.com/studio) as the IDE for your project. With either IDE, you also need the official Flutter and Dart plugins that provide you with code completion, syntax highlighting, widget editing assistance, run & debug support, and more. - To install Visual Code with Flutter and Dart plugins, check out [this link](https://flutter.dev/docs/get-started/editor?tab=vscode). - To install Android Studio with Flutter and Dart plugins, check out [this link](https://flutter.dev/docs/get-started/editor?tab=androidstudio). ### 4. Running App on Device You can choose to run your app on a real device or an emulator. :::tip To test app on a real device, see how to [**setup a physical device**](#setup-physical-device). ::: To run your app on a device: 1. First open the downloaded project in your preferred IDE. 2. For **VS Code**: 1. Go to the "View" menu -> select "Terminal" from the dropdown. 2. Run the command `flutter pub get`. 3. Now, enter the command `flutter run`. VS Code will build and run your app. You'll see the output in the terminal, and the app should launch in the selected emulator or physical device. 3. For **Android Studio**: 1. Open the terminal within Android Studio by clicking **"View" -> "Tool Windows" -> "Terminal"**. 2. Run the command `flutter pub get`. 3. Click the green "Run" button (a right-facing triangle) located in the top toolbar. Choose the target device (emulator or physical device) where you want to run the app. Android Studio will build and run your app. You'll see the output in the "Run" panel at the bottom, and the app should launch in the selected emulator or device. :::note - If your device is not listed in the **Flutter Device Selection** dropdown, make sure you have properly completed the Android and iOS setup. - If you encounter a version compatibility issue with Flutter, you can resolve it by upgrading to the latest version. Simply execute the `flutter upgrade` command in your terminal. To verify your current Flutter version, use the `flutter --version` command. ::: ## Run on Desktop Running your app on a Desktop involves: 1. **Adding platforms**: Navigate to **Setting and Integrations** from the Navigation Menu > **Project Setup** > **Platforms** and enable your desired platform. 2. **Make design adjustments (optional)**: If you plan to target both mobile and desktop users, some design adjustments may be necessary to ensure that the UI is optimized for both platforms. You can create separate widgets for different platforms and control their visibility using [Responsive Visibility](https://docs.flutterflow.io/concepts/layouts/responsive#responsive-visibility). 3. **Run the app on a desktop**: Use the Local Run feature in the FlutterFlow Studio Desktop app or manually download and run the code, choosing your target device (e.g., macOS) before running. ## Video Guide If you prefer watching a video tutorial, here's the one for you:
--- ## Troubleshooting
Command not found: flutter (add Flutter to system's path)

If you downloaded Flutter via local run, it might not be added to your system's path. You'll need to get the Flutter SDK directory and add it to your path manually. **For Mac** 1. From the [local run](#using-local-run) wizard, open the **Configure IDE** step and click on **this path** to get the Flutter SDK path. ![get path](https://docs.flutterflow.io/assets/images/get-path-5180adef7967b16994e39ff537e3fb09.avif) 2. Open the Terminal and run the following command to open your `.zshrc` file (or `.bash_profile` if you're using Bash): ``` open -e ~/.zshrc ``` 3. Add path at the end of the file. It should look something like this: ``` export PATH="$PATH:$HOME/Library/Application Support/io.flutterflow.prod.mac/flutter/bin" ``` 4. Save and close the file. 5. Run the following command to apply the changes: ``` source ~/.zshrc ``` 6. Restart your terminal and try running the `flutter` command again. **For Windows** 1. From the [local run](#using-local-run) wizard, open the **Configure IDE** step and click on **this path** to get the Flutter SDK path. ![get path](https://docs.flutterflow.io/assets/images/get-path-5180adef7967b16994e39ff537e3fb09.avif) 2. Right-click on the Start menu and select "System". 3. Click on "Advanced system settings" and then "Environment Variables". 4. Under "System variables", find the "Path" variable and click "Edit". 5. Click "New" and add the path to your Flutter SDK. 6. Click "OK" to save your changes. 7. Restart your command prompt and try running the `flutter` command again.

Device not showing in the list

If you don't see your device in the list after refreshing, follow these steps: 1. Ensure you have added Flutter to your path. 2. Open the Terminal and run the following command: ``` flutter devices ``` This will list all connected devices that the Local Run recognizes. 3. If you still don't see your device, try restarting it. 1. **For iOS**: Open Xcode, go to the "Window" menu, select "Devices and Simulators," choose your simulator, and click "Restart." 2. **For Android**: Open the Android Studio > Device Manager, choose your emulator, and click the "Play" button. 3. You can also restart the emulator directly from the command line using Flutter: ``` flutter emulators --launch ``` **Note** that replace `` with the ID of your emulator. You can find the ID by running `flutter emulators`. 4. Try running `flutter devices` again.

Xcode warning "Runner.xcworkspace modified"

If you encounter a warning from Xcode stating: > "The file 'Runner.xcworkspace' has been modified by another application." This warning can usually be safely ignored. It typically occurs when multiple tools or processes (such as FlutterFlow Studio local run and Xcode) modify the project files simultaneously. Here's what you can do: 1. **Save Your Work**: Ensure that you've saved any changes you've made in Xcode. 2. **Close and Reopen**: Close the warning prompt and, if necessary, close and reopen Xcode to refresh the project files. 3. **Clean the Build**: If the warning persists, try cleaning the build folder in Xcode by going to "Product" > "Clean Build Folder." 4. **Flutter Clean**: You can also run `flutter clean` in your terminal to clean the build cache for your project, which can sometimes resolve issues related to outdated or conflicting files.

--- ## FAQs
Can I export the project as a Flutter Module?

Yes, you can export your project as a Flutter module. Here's how: 1. Activate the FlutterFlow CLI by entering `dart pub global activate flutterflow_cli` in your terminal. 2. Use the command below to export your project and substitute ``, ``, and `` with your specific project details: ``` flutterflow export-code --project --dest --include-assets --token --as-module ``` If you wish to exclude assets from the export, use `--no-include-assets` in your command. This will export the project code without the assets. For example: `flutterflow export-code --project your_project_id --dest path_to_output_folder --no-include-assets --token your_token --as-module` You can then follow the instructions for [Android](https://docs.flutter.dev/add-to-app/android/project-setup) and [iOS](https://docs.flutter.dev/add-to-app/ios/project-setup) to add the module to your main app.

# Test Pilot > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/testing/test-pilot Learn how to create and run AI-powered QA tests for your FlutterFlow Studio app using Test Pilot. Test Pilot in FlutterFlow Studio allows you to run AI-powered tests for your app. Instead of building step-by-step integration tests manually, you create natural-language tests, group related tests together, and ask Test Pilot to interact with your app like a QA tester. This is useful when you want to validate important user journeys before publishing or sharing a new build. For example, you can ask Test Pilot to sign in with test credentials, add an item to a cart, open the profile page, or confirm that a checkout flow lands on the expected success screen. At a high level, Test Pilot creates a web build snapshot of your project, launches the app in a browser-based QA environment, and uses an AI agent to follow each test's instructions. After the run completes, you can review pass or fail status, per-test summaries, screenshots, playback, actions taken, and credit usage. ## Create Test To get started, first create a **Test Group**. Use test groups to organize related tests, such as authentication, checkout, profile settings, or onboarding. After you create or select a test group, add tests that describe the exact journey Test Pilot should perform. Each test has: - **Test Name**: The label shown in the test group and run results. - **Entry Page**: Optional initial route for the test. Use **App default** when the app should start from its default entry page. - **Enabled or Disabled state**: A toggle to enable or disable a test. Only enabled tests are included when the group runs. - **Instructions**: Natural-language steps for the AI agent to follow. - **Expected Outcome**: Optional success criteria that Test Pilot should verify after completing the instructions. - **Restart before test**: Optional behavior that starts the app fresh before that test. This is **turned off by default, so tests are executed sequentially** one by one and can continue from the state left by the previous test. Turn it on when a test should start from a clean app state and not depend on earlier tests. Write instructions the way you would brief a QA teammate. Mention the screen, the UI element, the action to take, and the expected result. For example, a login test might use: - **Instructions**: `Wait for the screen to load, then enter $email and $password into the text fields and click the continue button.` - **Expected Outcome**: `The app should land on the home page.` :::tip `$email` and `$password` are [**Test Parameters**](#test-parameters). After you create a parameter, you can reference it directly in test instructions by adding `$` before the parameter name. ::: Here's how to create tests:

### Test Parameters Test Parameters let you store reusable values that Test Pilot can substitute into test instructions. This is especially helpful for credentials, environment-specific values, or other data that you do not want to type into every test. Test Parameters are managed per [FlutterFlow Studio Environment](https://docs.flutterflow.io/testing/dev-environments). Use the **Environment** dropdown to switch between environments, then add the parameter values for the selected environment. Each parameter includes: - **Name**: The variable name used in instructions. - **Value**: The value Test Pilot substitutes when running the test. - **Description**: A clear note describing what the value is used for. - **Encryption toggle**: Marks sensitive values so they are encrypted. To use a parameter, create it from **Test Parameters**, then reference it in instructions with a dollar sign, such as `$email` or `$password`.

:::caution For login tests, use a separate test account instead of a real user account. Secret parameters help hide sensitive values, but you should avoid using production credentials in Test Pilot runs. ::: ## Run Test To run a test group, select the test group you want to run, click **Run Test Group**, choose the run configuration, and then click **Run Tests**. Run configuration options include: - **Device Sizes**: Uses the current canvas size by default. You can add predefined devices or custom width and height values. The run dialog supports up to 3 selected devices. - **Brightness**: Choose light or dark mode. Dark mode is available only when dark mode is enabled in the project design system. :::note Before starting a run, make sure the selected group has at least one enabled test, the project has no blocking errors, the selected environment is valid, and no other Test Pilot run is active for the same project or group. :::

## Review Test Results The **Run History** section shows the previous and active Test Pilot runs for the selected group. Click **View Results** to open the run details page. From there, you can review every test in the run and inspect the AI agent's explanation for each result. Each test result can include: - **View Test Playback**: Opens a step-by-step playback of the agent's interaction with the app. When you open Test Playback, you can use **Previous** and **Next** to move through each step, select a screenshot from the thumbnail strip, and review the agent's reasoning for that step. The playback side panel includes: - **Goal**: What the agent was trying to do in the selected step. - **Observation**: What the agent saw on the screen. - **Actions**: The action taken in that step and whether it succeeded. - **Config**: Displays the test run duration, screen size, and options to show or hide the device frame and overlay. It also includes a **View JSON** option to inspect the raw step data. - **Screenshots**: Captured screens from the run. Use these to quickly see what the agent saw at key moments. - **Actions Taken**: The actions the agent performed while executing the test, including clicks, text entry, key presses, completion steps, and whether each action succeeded. - **Open Snapshot**: Opens the build snapshot used for the run.

## Best Practices - Keep each test focused on one user journey, such as login, checkout, or opening profile settings. - Start instructions with any setup the agent needs, such as waiting for the screen to load. - Use clear UI descriptions, such as "click the profile icon on the top left side" instead of "click the icon." - Add an expected outcome when the result matters, such as "the app should land on the home page." - Store separate parameter values for each environment. - Review screenshots, playback, and actions taken when a test fails, because the summary may point to a build, startup, UI, or instruction issue. - Turn on **Restart before test** when a test should start from a clean app state. Leave it off when tests are intentionally designed to run sequentially. ## Test Pilot Credits Test Pilot uses Test Pilot credits. Each project gets **5 free credits**, which equals **5 single-test runs**. After the free credits are used, runs use credits from an assigned Test Pilot Credits Pass. A Test Pilot Credits Pass is a paid add-on. Passes start at **$5/month for 100 credits**. One credit represents one single test being run. Credit usage is based on the number of tests, devices, and brightness modes included in the run. For example, if a test run includes **3 tests**, runs on **2 devices**, and uses both **light and dark mode**, it uses `3 * 2 * 2 = 12` credits. Before you start a run, FlutterFlow Studio shows how many credits the run will use. This lets you review the cost of running the selected test group before you click **Run Tests**. Pricing: - **USD**: `$5/month` per pass unit. Each unit grants `100` credits per reset cycle. You can buy multiple units. For example, `10` units cost `$50/month` and grants `1000` credits. - **INR**: The same pricing applies. - **Regional discounts**: None. - **Annual discount**: Approximately 25%. Pass types: - **Personal pass**: Purchased from Account billing and assignable to one personal project owned by that user. - **Team pass**: Purchased from Teams billing and assignable to one project belonging to the same team. Pass assignment is permanent. You cannot manually clear, update or transfer the pass while the project still exists. If the assigned project is deleted, the pass becomes unassigned. If a project changes owner or team scope and the assigned pass no longer matches that scope, the pass should be unassigned automatically. For example, if a team project with an assigned team pass is moved to become a personal project, the team pass will be unassigned. Deleting or canceling a purchased pass is a billing action. Like other subscriptions and add-ons, when you delete a Test Pilot pass, you can continue to use it until the end of your current billing cycle. ## FAQs
Why can't I run tests?

Check that the project has available Test Pilot credits or free runs, at least one enabled test, editor access, no active Test Pilot run, a valid environment, and no blocking project errors.

Why do I see 0 credits?

This can happen when no Test Pilot Credits Pass is assigned to the project, the assigned pass has used all credits for the cycle, the assigned pass no longer matches the project scope, or credit status failed to load.

Why can't I assign my pass?

A pass may already be assigned, the project may already have a pass, the pass may not match the project scope, or you may not have the required billing permissions. Personal passes can only be assigned to matching personal projects, and team passes can only be assigned to matching team projects.

Can support move my pass?

Pass assignment is intended to be permanent. Contact support if you suspect a data issue, such as a stale assignment after a project was deleted or moved.

How many free credits do projects get?

Each project gets 5 free Test Pilot credits. Since 1 credit equals 1 single test run, this gives each project 5 free tests. After those credits are used, the project needs an assigned Test Pilot Credits Pass.

Why doesn't my pass have a regional discount?

Test Pilot Credits Passes do not use regional discounts. The billing page shows the price that applies to your account.

Do I get free credits if I have an educational account?

Educational accounts get 5 free tests per project, and are able to purchase Test Pilot passes for further credits.

# Automated Tests > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/testing/automated-tests Discover how to effectively utilize automated testing in FlutterFlow Studio to ensure your app performs as intended. Automated Tests allow you to test the behavior and appearance of your app to ensure all features are working as expected. It’s essentially like testing a real application without human intervention. Internally, when you write tests, FlutterFlow Studio generates code for the [Flutter integration testing framework](https://docs.flutter.dev/testing/integration-tests), which you can download and test locally or through services like [Firebase Test Lab](https://firebase.google.com/docs/test-lab). :::caution[Legacy testing] Automated Tests are now considered a legacy testing option in FlutterFlow Studio. For new testing workflows, we recommend using [**Test Pilot**](https://docs.flutterflow.io/testing/test-pilot), which lets you create and run AI-powered QA tests using natural-language instructions. ::: :::note[Pricing Details] - **Free and Basic plans:** Automated testing is not available. - **Growth plan:** Includes **1 test per project**. - **Business plan:** Allows **up to 3 tests per project**. - **Enterprise plan:** Supports **unlimited automated tests**. ::: ## Basics Before you add and run any tests, it's crucial to understand the workflow. When creating a test, you essentially map out a series of steps that dictate how the test will engage with the app. Each step can serve a distinct purpose and can be categorized as: ### Step Type 1. [Interact with Widget](#1-interact-with-widget) 2. [Wait to Load (Pump & Settle)](#2-wait-to-load-pump--settle) 3. [Expect Result](#3-expect-result) #### 1. Interact with Widget This step simulates user interactions with your app, such as tapping on a button or entering text into a field. When you add this step, you can specify what kind of [action type](#action-type) you would like to simulate and on [which widget](#selection-method). ##### Action Type - **Tap**: Acts like a single tap or click. - **Double Tap**: Imitates tapping twice quickly. - **Long Press:** Imitates pressing and holding for a moment. - **Enter** **Text**: Input the exact text you want to simulate entering. - **Scroll Until Visible**: When this is selected, you can specify the **Delta** 'number of pixels' you want to repeatedly scroll until the widget is visible. If you have more than one scrollable widget, select which one you want to scroll using the **Scrollable** property. #### 2. Wait to Load (Pump & Settle): After an interaction, your test might need to pause momentarily, allowing the app to process the interaction, load something, or update its state. This is where the 'Wait to Load' mechanism comes into play, ensuring the app has had enough time to reflect any changes. When this is selected, you have options to adjust: - **Duration**: How long do you want to wait? The default value is 100ms. - **Timeouts**: Maximum amount of time to wait, after which the test will fail. :::tip[Best practices] - Start your test with this step for about 3 seconds (i.e., 3000ms). - After every "Interact with Widget" step, it's usually wise to add another "Wait to Load". ::: #### 3. Expect Result After performing an action in your app, it's important to verify that the result matches your expectations. This is the verification step where you confirm that the app behaves as expected after the interaction. Here, you confirm whether a particular widget is present on the screen. When this is selected, you have to [locate a widget](#selection-method) that you want to verify and set what you expect to find using any of the below options: - **Find Nothing:** Ensures that the specified widget is not present on the screen. - **Finds Num Widgets:** Expect a certain number of widgets to be present. - **Finds One Widget:** Confirms that exactly one widget is present. - **Finds Widgets:** Expect multiple widgets to be found. - **Is Enabled**: Verifies that the widget is not only visible but also functional. - **Is Disabled**: Verifies that the widget is in a disabled state, meaning it is inactive and will not respond to user interactions. - **Has State**: Confirms that a widget is in a specific state, such as _True_ or _False_. For example, verify whether a checkbox is checked. ### Selection Method This is the method by which you locate the widget you want to select or verify. FlutterFlow Studio offers the following ways to identify widgets: - **Select from UI Builder:** Use the UI Builder's interface to visually select the widget you want to verify. - **Find By ValueKey:** Locates the widget by its unique ValueKey. **Tip**: To add a ValueKey to a widget, use the 'Value Key' property located under the 'Testing' section on the widget properties panel. - **Find By Type:** Search for a widget based on its type, like `Text` or `Button`. - **Find By Semantics Label:** Useful for locating widgets that have a specific semantics label. - **Find By Text:** Locate a widget that displays specific text. - **Find By Descendent:** Search for a widget that has a specific child or ancestor. ## Add Tests Let's see how to add tests with an example that will ensure that users can add and remove items from their favorites list. Here are the step-by-step instructions on adding tests: 1. Create a test to verify if the page is visible on the screen.

2. Next, find and simulate on tap event on the favorite button with the 'ValueKey' as the product id. **Important**: By using the 'ValueKey', we precisely target the favorite button for a specific product. Without this specificity, the test will encounter multiple favorite buttons and become uncertain about which one to tap, leading to a failed test.

3. Similarly, you can now duplicate the test and make changes for the 'RemoveFromFavorites' test. **Tip**: While doing so, ensure that in the last step (i.e., **Expect Result**), you set the **Expectations** to **Finds Nothing**. This ensures that the removed item is not visible on the favorites list. ![remove-from-favorites](https://docs.flutterflow.io/assets/images/remove-from-favorites-40571fef2eabad43eb41466b20bbfdb9.avif) ## Run Tests You can run tests on local devices or use the services like [Firebase Test Lab](https://firebase.google.com/docs/test-lab). To run the tests locally: 1. [Download the project code](https://docs.flutterflow.io/flutterflow-cli/exporting). 2. Go to `your_project/integration_test/test.dart`. 3. To run a specific test, click the play button next to it. To execute all tests at once, double-click the play button next to `void main`. 4. Alternatively, you can use the terminal and enter the command: `flutter test integration_test/test.dart`." :::note To run the tests on Firebase Test Lab, you can follow the instructions [**here**](https://docs.flutter.dev/testing/integration-tests#test-using-the-firebase-test-lab). ::: # Push to GitHub Repo > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/exporting/push-to-github Learn how to connect your FlutterFlow Studio project to a GitHub repository and manage custom code. This guide provides instructions on how to connect your FlutterFlow Studio project to a GitHub repository and manage custom code. ## Connect a GitHub repo In this section, we'll learn how to connect your FlutterFlow Studio project to a GitHub repository. This includes creating a new repository, installing the FlutterFlow Studio GitHub App, and pushing your code to the repository. Here’s how you do it: 1. First, go to your GitHub account and create a new repository.

2. Once the repository is created, install the [FlutterFlow Studio GitHub App](https://github.com/apps/flutterflow-github-app) in your GitHub account.

3. You can now push your code to the repository.

:::tip - FlutterFlow Studio always pushes changes to a branch named `flutterflow`. Avoid making direct changes to this branch, as your changes will be overwritten by the next push from FlutterFlow Studio. - If you need to modify the code, make changes in a separate branch. Learn more about managing custom code. ::: ## Manage Custom Code on GitHub Writing custom code allows you to add features that are not supported by FlutterFlow Studio's current functionality. This section outlines how you can manage custom code using GitHub to prevent FlutterFlow Studio from overriding it. ![manage-custom-code](https://docs.flutterflow.io/assets/images/manage-custom-code-b95630fd004549dd5a784f05337c1c79.avif) The diagram illustrates the flow or process of managing code in GitHub. This process allows you to leverage all the features from FlutterFlow Studio and deploy your app with a custom code. Here's a step-by-step explanation: ### 1. Connect FlutterFlow Studio to GitHub First, set up the connection between your FlutterFlow Studio project and GitHub repository. [Follow these steps](#connect-a-github-repo) if you haven’t already done so. ### 2. Establish a custom code branch After pushing your FlutterFlow Studio code to GitHub, it lands in the `flutterflow` branch. To safeguard your custom modifications from being overwritten by future pushes, create a `develop` branch. 1. Navigate to your GitHub repository. 2. Switch from `main` to `flutterflow` in the branch dropdown. 3. In the branch creation field, enter `develop` and create the branch from `flutterflow`. ### 3. Add custom code Once your `develop` branch is ready, [clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) to your local machine. Open the project in your IDE, switch to the `develop` branch, and add your custom code. After making changes, commit and push them back to the `develop` branch. ### 4. Merge changes from FlutterFlow Studio To integrate the latest updates of your FlutterFlow Studio project into your custom code: 1. Create a pull request on GitHub from `flutterflow` to `develop`. 2. Review and merge the changes, resolving any conflicts if necessary. ### 5. Final testing and deployment After testing the changes in `develop`: 1. Merge `develop` into `main` via a new pull request on GitHub. 2. Once reviewed and merged, deploy your application from the `main` branch using FlutterFlow Studio’s deployment features. :::tip Also, see how you can download the code using [**FlutterFlow CLI**](https://docs.flutterflow.io/flutterflow-cli) and [**Local Run**](https://docs.flutterflow.io/testing/local-run). ::: # Pre-checks Before Publishing > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/deployment/pre-checks-before-publishing Ensure your app is ready for launch with this detailed guide on essential pre-publishing checks. This page outlines the important steps and checks to be made before publishing your app. These steps are crucial to ensure that your app works as expected, meets platform guidelines, and to gather preliminary feedback. Here’s a comprehensive list of these prechecks: 1. **Functionality Testing**: Test the app manually across devices. You can also implement integration tests using FlutterFlow Studio’s [**Automated Tests**](https://docs.flutterflow.io/testing/automated-tests) framework to cover various scenarios. 2. **Get Feedback**: Run your app in Run Mode to generate a shareable link to the session. You can share these links to gather feedback from users and testers, providing valuable insights and potential areas of improvement before the public release. 3. **Optimizations & Enhancements**: Improve performance by implementing [optimization and enhancement](https://docs.flutterflow.io/flutterflow-ui/toolbar#project-suggestions) suggestions. Ensure that images are properly sized, consider using higher compression for assets, and remove unused assets and custom widgets. These will help improve your app's speed and size. 4. **User Interface:** Check UI consistency across different screen sizes and resolutions using the [Canvas Size](https://docs.flutterflow.io/flutterflow-ui/canvas) option. 5. **Accessibility Checks**: Add semantic labels to make the app more accessible to users with disabilities by providing meaningful descriptions. 6. **Security Measures**: Make sure all data handling practices comply with legal standards, including GDPR if applicable. Use HTTPS for all network connections and ensure that sensitive data is encrypted. 7. **Compliance with Store Guidelines**: Review the submission guidelines for [Apple’s App Store](https://developer.apple.com/app-store/review/guidelines/) and [Google Play Store](https://play.google/developer-content-policy/). Check for any specific requirements such as app metadata, privacy policies, and minimum functionality. 8. **Localization and Internationalization**: If your app targets users in multiple countries, consider [adding multi-language](https://docs.flutterflow.io/concepts/localization) support. 9. **License and Third-Party Attributions**: Adhere to licenses and include necessary attributions for third-party libraries and assets. 10. **Prepare Marketing Assets**: Prepare all the necessary marketing assets, such as screenshots, app icons, and promotional text. You can easily [generate screenshots](https://docs.flutterflow.io/deployment/pre-checks-before-publishing#generate-screenshots) right within FlutterFlow Studio. --- ## Generate Screenshots Alongside crafting beautiful apps, you can also generate screenshots for your mobile app right within the builder. Screenshots are captured in all the recommended device sizes required for publishing to the App Store and Play Store. :::note If pages are rendered using a **WebView** widget, the generated screenshots will appear blank. ::: Let's explore how to generate screenshots for your app:
# Web Publishing > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/deployment/web-publishing Discover how to effortlessly publish your applications on the web with FlutterFlow Studio. This guide covers everything from enabling web support to deploying your app and adding custom domains. FlutterFlow Studio supports web publishing, allowing you to build and publish web applications in addition to your mobile apps. This guide provides details on how to use FlutterFlow Studio for web publishing. From enabling web support and making design adjustments to deploying your app and adding custom domains. :::note - You can ship your existing mobile app as a web app with little or no change to the current setup. - We offer free hosting and custom subdomains for all users. - We've rebuilt some of the components to work better on the web. ::: ## Publish to Web Publishing to the Web comprises of the following steps: 1. [Enabling web support](#1-enabling-web-support) 2. [Make design adjustments (optional)](#2-make-design-adjustments-optional) 3. [Resolving errors](#3-resolving-web-compatibility-warnings) 4. [Adding general information](#4-adding-general-information) 5. [Deploy](#5-deploy) 6. [View live web app](#6-view-live-web-app) ### 1. Enabling web support By default, FlutterFlow Studio allows you to run your app on *Android* and *iOS* without any additional effort. But, to run and deploy your app on the *Web*, you need to add platform support for the Web. To add platform support, navigate to the **Setting and Integrations > Project Setup > Platform >** turn on the **Web** toggle. ![enable-web](https://docs.flutterflow.io/assets/images/enable-web-643a2696a52194f7129f78a65175e7dc.avif) :::note Enabling web support automatically enables [**deep linking**](https://docs.flutterflow.io/concepts/navigation/deep-dynamic-linking) for your project. This helps in creating URLs for every page of your app. ::: #### Advanced Web Settings 1. **Use CanvasKit**: Enabling this option can provide high-quality graphics and text rendering on web platforms. 2. **CORS Proxy for Images (Optional)**: When using CanvasKit, some images can be blocked from loading if the server is not configured to allow loading them from other websites. This happens because Flutter web uses WebGL for rendering, which requires access to raw image data and is subject to browser security restrictions called [Cross-Origin Resource Sharing (CORS)](https://docs.flutter.dev/platform-integration/web/web-images#cross-origin-resource-sharing-cors). Choose the appropriate option based on where your images are hosted: - **None**: If you are only loading images from your Firebase Storage, select this option and configure Firebase Storage for web access. FlutterFlow Studio automatically excludes Firebase Storage images from CORS proxy requirements. - **Deploy with Firebase**: If images are hosted on external servers (not Firebase Storage) *but you use Firebase for your app*, choose this option. FlutterFlow Studio will automatically deploy a regional CORS proxy function to your Firebase project for optimal performance. Simply click the **Deploy** button that appears below this option. - **Custom Proxy URL**: If you're not using Firebase or prefer to manage your own CORS proxy, specify your custom proxy URL here. If you don't have one, you can create one using services like [cors-anywhere](https://github.com/Rob--W/cors-anywhere) or CloudFlare Workers. :::caution **Performance Note**: Using a CORS proxy adds a network hop for external images, which may slightly increase loading times. For best performance, host images on Firebase Storage or a CORS-enabled CDN when possible. ::: 3. **Import Emoji Library**: Importing the Emoji library is necessary if your app may use emojis anywhere in any text widget. However, this will increase the size of your app on web. 4. **Use Wasm (Beta)**: Enabling this option will build your app using Flutter’s **Wasm (WebAssembly) web renderer**. For more details, see the [Flutter Documentation on Wasm](https://docs.flutter.dev/platform-integration/web/wasm). :::caution - This feature is currently in *Beta*, so it should be used with caution. - Wasm is not supported in *Test Mode*. ::: #### Troubleshooting CORS Issues If you're experiencing image loading issues on web: 1. **Check browser console**: Look for CORS-related error messages 2. **Verify image sources**: Ensure external image servers allow cross-origin requests 3. **Test proxy configuration**: Verify your custom proxy URL is accessible and functioning 4. **Firebase Storage setup**: Confirm Firebase Storage rules allow public read access for web ### 2. Make design adjustments (optional) If you're creating a web-only application, setting the canvas size to desktop and building pages accordingly can work well. However, if you plan to target both mobile and web users, some design adjustments may be necessary to ensure that the UI is optimized for both platforms. You can create separate widgets for different platforms and control their visibility using [Responsive Visibility](https://docs.flutterflow.io/concepts/layouts/responsive#responsive-visibility). ### 3. Resolving web compatibility warnings If you have previously built a mobile app and have recently enabled web support, you may encounter warnings regarding web compatibility. Due to the distinct nature of mobile and web platforms, some of the widgets and actions in FlutterFlow Studio, including [AdMob](https://docs.flutterflow.io/integrations/ads/admob), [RevenueCat](https://docs.flutterflow.io/integrations/payments/revenuecat), [Share](https://docs.flutterflow.io/concepts/navigation/share-action) action, and [Launch Map](#) action, or your custom widgets may not function as expected because they are not yet supported on the web. Any known *Web Support* Issues will be displayed as a **Platform Support Warning**. This won't stop you from deploying your app to the web, but it can result in poor user experience and unexpected app behavior. ![platform-warnings](https://docs.flutterflow.io/assets/images/platform-warnings-ab76fa005365e723233d93bc4bb2337b.avif) In such a situation, you can try to find a replacement package on [pub.dev](https://pub.dev/) (considering it meets your requirements and has a good score). :::caution **Important**: Make sure to double-check any *pub.dev* packages you are using have *Web* Support. ![web-support](https://docs.flutterflow.io/assets/images/web-support-09e3ea561fe01d5c695f7288e073cf8c.avif) ::: ### 4. Adding general information In this step, you must provide general information about your web app by following the steps below: 1. Navigate to the **Setting and Integrations >** **App Settings >** **Web Deployment**. ![web-pub-general-settings](https://docs.flutterflow.io/assets/images/web-pub-general-settings-66306bc810313d0b7ff879d85786f4e4.avif) Inside the **General Information** section, enter the following details: - **Site URL**: You can define the *Site URL* by adding the subdomain, for example, *mywebapp.flutterflow.app*. You can only change the subdomain, i.e., the part before *flutterflow.app*. :::caution - You can remove or change the existing subdomain by simply entering the new one and hitting the publish button. Note that when you change your subdomain, it only takes effect the next time you deploy. - Old addresses can stop working anytime and be given to another user. - There is a limit on the number of subdomains you can register per user. *Paying users can register up to 20 subdomains*. You will receive an in-app warning if you are approaching the limit. ::: - **SEO Title**: This appears in social sharing previews and search results. - **Site Description**: A text that you would like to appear in the social sharing preview card and search results. - **Page Title**: This appears in the browsers tab for all pages of your app. - **Favicon**: An icon that typically appears before the web app name inside the browser's tab. To change it, click on the **Upload Favicon +** and upload the icon. You can generate it for free from [here](https://favicon.io/). - **Status Bar Color**: This is to change the status bar color when viewed on the Safari browser on iOS and installed as a PWA on mobile devices. - **Social Share Image URL**: The image from this URL will be displayed inside the social share preview card (e.g., OpenGraph and Twitter card). - **Individual Page Titles**: Enabling this will display the current page name in the browser tab. If you do so, ensure you provide the **Page Title** under **Page > Properties Panel > Route Settings**. - **Show Watermark**: By default, a button with 'Built in FlutterFlow Studio' text appears as a watermark at the bottom right side of your page. To remove, disable the **Show watermark** toggle. - **Allow Showcasing**: If enabled, we may feature your project on our website. - **Allows Search Engine Indexing**: This is to let people discover your site via search engines. - **Enabling PWA**: Enabling this can provide an app-like experience right in the browser. PWA app can be installed on the device, supports offline functionality, sends push notifications, and can be accessed without the need to go through an app store. - **Use CanvasKit**: Enabling this can provide high-quality graphics and text rendering on web platforms. CanvasKit can be used as an alternative to the default HTML renderer when higher graphical fidelity is needed in Flutter web apps. - **Use Original Engine Initialization**: This uses original Flutter web engine initialization, which sometimes helps in better loading time in the deployed web app. :::note Tip: Only users on the paid plans can remove the FlutterFlow Studio watermark. ::: ### 5. Deploy When you are ready to deploy, click **Publish.** This will take approximately 2-3 minutes. ![publish-button](https://docs.flutterflow.io/assets/images/publish-button-69cee7cd9d757ee661957d2b9ca6c0f9.avif) By default, you will publish to a subdomain based on your project id. These default subdomain addresses do not count toward the subdomain quota, and you can deploy as many projects as you'd like. The URL would look like this: `your-project-id-1234.flutterflow.app` You can also modify the address by specifying a custom subdomain address, in the **Settings > Web Publishing** tab's **Site URL** field, as long as it's available. You can have up to **2** custom subdomain URLs on the Free plan, up to **20** on any of our Paid plans, and **unlimited** custom subdomain URLs on the Enterprise plan. :::note Once it is published, you can make any changes live to your users by clicking the **Publish** button again. ::: If you try to publish to a domain that is already taken, you will receive a warning like ‘*Error reserving subdomain: Subdomain `your-domain-name` is already used by another project.*’ To overcome this, enter a different subdomain inside the **Site URL** and select **Publish** again. :::note In case you want to unroll your web app, hit the **Unpublish** button at the bottom. ::: ### 6. View live web app To view the live version of your app, click the **eye icon** next to the 'Publish' button. ![view-published-site.avif](https://docs.flutterflow.io/assets/images/view-published-site-fb67b90e4b5a97af7a7c101aeea1061d.avif) --- ## Adding custom domain Connect a domain you own to your published web app. FlutterFlow Studio shows the DNS records to add at your domain provider, based on whether you also want to serve the app on the www subdomain. :::note[Important] - Paid plans include one custom domain, with the option to purchase more. - A custom domain slot applies to one domain or subdomain. - Connecting a root domain doesn't connect all its subdomains. Use **Also www** to include the www subdomain. ::: To add a custom domain: 1. In your project's **Web Publishing** settings, enter the domain in **Custom Domain URL**, without a protocol or the www prefix. For example, enter `ecommerceflow.shop`. 2. Choose whether to enable **Also www**. The label includes your domain, such as **Also www.ecommerceflow.shop**. 3. In your domain provider's DNS manager, add the records shown under **Set up DNS**. See [Domain ownership verification](#domain-ownership-verification) for the records required in each case. Use the copy icons to copy the values from your own project, not from these example screenshots. 4. Return to FlutterFlow Studio and click **Connect**. Once the domain is connected, click **Publish** again. ### Domain ownership verification The **Also www** setting changes the records shown under **Set up DNS**. Add all the records shown for the option you choose. #### With www enabled Turn on **Also www** to serve your app on both the entered domain and its www subdomain. The DNS table shows: - **A**: Points the entered domain to the IP address shown in **Value**. - **CNAME**: Points the www subdomain to the hostname shown in **Value**. Also www.ecommerceflow.shop enabled, with A and CNAME records in the Set up DNS table. #### With www disabled Turn off **Also www** if you don't want to include the www subdomain. The DNS table shows: - **A**: Points the entered domain to the IP address shown in **Value**. - **TXT**: Verifies that you own the domain. Its value is your project ID. For a root domain, the TXT record name is `_flutterflow`. For a subdomain such as `beta.myapp.com`, the name is `_flutterflow.beta`. Use the name and value shown in your project's DNS table. Also www.ecommerceflow.shop disabled, with A and TXT records in the Set up DNS table. The TXT name is _flutterflow and its value is the project ID. When www is disabled, connecting fails until DNS returns the TXT record. If an error names the record, wait a few minutes after adding it and click **Connect** again. You don't need to add this TXT record to reconnect or renew a domain that's already connected. :::caution[Existing DNS records] Make sure there are no other A or AAAA records for the names shown in **Set up DNS**. Check the record names before removing anything; records for other subdomains or services aren't part of this setup. ::: --- ## Add custom headers If you are familiar with HTML, you may set any additional headers (e.g., [style](https://www.w3schools.com/tags/tag_style.asp) and [script](https://www.w3schools.com/tags/tag_script.asp)) that you would like to be used in your published web app. For example, adding inline or external javascript. This will appear inside the head tag of your published app. :::caution These headers are used directly in the `index.html` of your site, so malformed headers may cause unexpected behavior (just as directly editing `index.html` would). ::: To add a custom header, enter your tag inside the *Custom Headers* input box and publish the web app again. :::note You can verify the added custom header by opening the inspect element window (**Command+Option+i** on **Mac** or **F12** on **PC**) and finding your tag inside the head tag. ::: ![custom-header.avif](https://docs.flutterflow.io/assets/images/custom-header-530514e7514209099851f8a6c95f6777.avif) --- ## Changing Firebase dynamic link If you do web deployment and utilize Firebase dynamic links in your app, it's recommended that you update your Firebase Dynamic Links URL scheme. This adjustment is necessary to ensure shared links open correctly on the web. By doing so, your dynamic links will function properly for users across all platforms. ![update-firebase-dynamic-link.avif](https://docs.flutterflow.io/assets/images/update-firebase-dynamic-link-4237c8bcd04bc639c96bcc9368428f0d.avif) --- ## Adding subdomain as Authorized domain (Firebase) If you are using *Firebase Authentication*, you must add your custom subdomain as an authorized domain in the [Firebase console](https://console.firebase.google.com/). Otherwise, social and phone sign-in will not work. To enable your subdomain as an authorized domain:
--- ## See deployment history Deployment history is essential for maintaining transparency, accountability, and a clear understanding of how a web application has evolved over time. Each deployment entry in the history includes a timestamp indicating when the deployment occurred. It also display the status of each deployment (e.g., successful, failed). This helps in quickly identifying whether a deployment was completed without issues. Click **View Full History** to review the previous successful version. ![view-deploy-history.avif](https://docs.flutterflow.io/assets/images/view-deploy-history-f47685e0faae99366d95363c2472065d.avif) # Google Play Store Deployment > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/deployment/google-playstore-deployment Learn how to seamlessly deploy your apps to the Google Play Store using FlutterFlow Studio. FlutterFlow Studio allows you to seamlessly deploy your apps directly to the Google Play Store, all from within the builder. This guide provides comprehensive instructions on prerequisites, step-by-step process for deployment, advanced settings, and troubleshooting common issues. :::note[Prerequisites] 1. Register for a [**Google Play Developer account**](https://play.google.com/console/u/0/signup). 2. [**Test your application**](https://docs.flutterflow.io/testing/local-run) on a real device. 3. Confirm the [**app details**](https://docs.flutterflow.io/resources/projects/settings/general-settings#app-details). Especially the package name, which can't be changed after your app is deployed. 4. Set an [**App Launcher Icon**](https://docs.flutterflow.io/resources/projects/settings/general-settings#launcher-icon). The App Launcher icon can't be transparent or contain an alpha channel. ::: ## Deploy to Google Play Store Deploying to Google Play Store comprises of the following steps: 1. [Creating an app on Google Play Store](#1-creating-an-app-on-google-play-store) 2. [Set up your app](#2-set-up-your-app) 3. [Adding service account credentials](#3-adding-service-account-credentials) 4. [Deploy to Google Play Store](#4-deploy-to-google-play-store) ### 1. Creating an app on Google Play Store Follow the steps below to create an app on Google Play Store: 1. Open the [Google Play Console](https://play.google.com/console). 2. Click on the **Create app** button at the top right side of your screen. 3. Enter the **App name**, select the app type, and choose whether the app is **Free** or **Paid**. 4. Accept the **Declarations**. 5. Click **Create app** at the bottom.

### 2. Set up your app To successfully deploy the app, you must fill in all the app details required by the Google Play Store. To proceed, navigate to the **Set up your app** section within the newly created app. Expand the **View tasks** section. Then, click on each task and fill in the necessary app information. ![setup-your-app](https://docs.flutterflow.io/assets/images/setup-your-app-5e3b2b145f130052273944cdbfc5b97d.avif) ### 3. Adding service account credentials Adding Service Account Credentials to FlutterFlow Studio helps you publish your apps on Google Play. #### 3.1 Creating a Service Account To create the Service Account, you can follow the instructions from [here](https://developers.google.com/android-publisher/getting_started). To help you get started quickly, here are the exact steps you need to follow: 1. If you haven't set up Firebase in your app, you'll need to [create a Google Cloud Project](https://developers.google.com/android-publisher/getting_started#creating). 2. Then, head over to the [Google Play Developer API page](https://console.developers.google.com/apis/api/androidpublisher.googleapis.com/) in Google Cloud Console and click **Enable**. ![enable-play-api](https://docs.flutterflow.io/assets/images/enable-play-api-58a30239911273105a4d83c27e046b2f.avif) 3. In Google Cloud Console, go to [Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts), click + **CREATE SERVICE ACCOUNT,** and follow the steps as per in the visual below.

4. On the right side of the newly created service account, click the action menu (three dots) icon and select **Manage keys**. Then, click **ADD Key > Create new key > select JSON > CREATE**. Keep the downloaded file at a safe place.

5. Now, return to the Google Play Console and follow the steps below: 1. Go to the [Users & Permissions](https://play.google.com/console/users-and-permissions) page. 2. Click **Invite new users**. 3. Put the email address for your service account in the email address field and grant the necessary rights to perform actions: - "Edit and delete draft apps" - "Release to production..." - "Release apps to testing tracks" - "Manage testing tracks and edit tester lists" 4. Click **Invite user**.

#### 3.2 Uploading service account credentials to FlutterFlow Studio To upload the service account credentials on FlutterFlow Studio: 1. Return to FlutterFlow Studio, navigate to **Settings & Integrations > App Settings >** **Mobile** **Deployment,** and scroll down to the **Google Play Store** section. 2. Under the **Service Account Credentials**, Click on **Upload Credentials** and select the downloaded credential, i.e., the `.json` file in the previous step no.4.

### 4. Deploy to Google Play Store To enable FlutterFlow Studio to deploy your app to the Google Play Store on your behalf for the first time, you have to download the [`.AAB`](https://chat.openai.com/share/6f5714c1-eb13-428b-b9ee-9772f2810284) file from FlutterFlow Studio and upload it to the [Internal Testing](https://play.google.com/console/about/internal-testing/) Track on the Google Play Store. Once the Internal Testing track is ready (with `.AAB` file), FlutterFlow Studio can handle the subsequent releases. #### 4.1 Getting the AAB (App Bundle) file To get the AAB file: 1. Set the **Google Play Track** to **Internal** and hit **Deloy to Play Store**. 2. Wait for a couple of minutes and then click **Check Build Status**. If you don't see the **AAB APK** options yet, wait for some time. 3. Click on the **AAB** to download the `.aab` file. :::note You need to perform this step only for fresh deployment (i.e., first-time setup). :::
#### 4.2 Creating a testing track :::note While you can certainly release your app directly to the Production Track, it's advisable to first release it within your team using the Internal Testing Track. ::: Inside the [Google Play Console](https://play.google.com/console), create a testing track as per in the steps below:
#### 4.3 Deploy You can now deploy directly from FlutterFlow Studio or from your GitHub repository. :::note - Every time you deploy, we'll auto increment the **Build Number** (i.e., version code in Android) to ensure that each release is identifiable. If needed, you can update the *App Version* and *Build Number* yourself. - We'll [**auto-generate**](https://developer.android.com/studio/publish/app-signing#generate-key) and [**sign**](https://developer.android.com/studio/publish/app-signing#sign_release) your app for the release with the Keystore (i.e., upload key). If you wish to download the keystore, click the orange key button. ::: Ensure the **Google Play Track** is set to **Internal** and hit the **Deloy to Play Store** again. On successful deployment, you will see the status as 'finished'. ![deploy-flutterflow](https://docs.flutterflow.io/assets/images/deploy-flutterflow-cf0c6a4c693f61019a33c88d9766fd35.avif) :::tip If you prefer to manage your deployment process outside of FlutterFlow Studio, such as integrating with your own CI/CD pipeline, or if you want more control over versioning and custom code management directly on GitHub. You also have the option to [**Deploy apps from your GitHub repository**](https://docs.flutterflow.io/deployment/deploy-from-github). ::: #### 4.4 Verify deployment To verify that the app is deployed to Play Console: 1. Open the **Internal testing** in [Google Play Console](https://play.google.com/console). 2. Under the **Releases** section, find your release and click on the **Show Summary** button. 3. See the **Version Codes** number is increased. ![verify-deployment](https://docs.flutterflow.io/assets/images/verify-deployment-1fd5e667065c7ab8011980cadaec5aa2.avif) #### 4.5 Deploy to production To deploy your app to production: 1. Inside the **Internal testing** in [Google Play Console](https://play.google.com/console). 2. Under the **Releases** section, find and click on the **Promote Release** dropdown. 3. Select the **Production**. This will create the Production track and you can continue to release your app from there onwards. 4. Next time onwards in FlutterFlow Studio, you can publish directly to the Production track by setting the **Google Play Track** to **Production**. **Google Play Console: Promote to production** ![play-console-deploy-prod](https://docs.flutterflow.io/assets/images/play-console-deploy-prod-3cadf567d429b6586aa9a04b5bd74208.avif) **FlutterFlow Studio: Set Google Play Track to Production** ![play-console-deploy-prod](https://docs.flutterflow.io/assets/images/ff-deploy-prod-393c02301c78bd8fcee7a5aff9fa9325.avif) --- ## Advanced Settings ### Upload Keystore If you've previously deployed an app to the Play Store using your own keystore file, you must enable this option. Once enabled, proceed to **Upload Keystore** file and provide the **Keystore Alias**. upload-keystore ### Changes not sent for review If you face an error that says '*Changes cannot be sent for review automatically*', enable this option and retry deployment. ### Submit as draft While deploying, if your app is still in draft mode, meaning it is not available on the Play Store yet, you may encounter an error message stating, 'Only releases with the status draft may be created on a draft app.' To resolve this, enable this option, and you'll see that the release will be created as a draft. You'll then need to manually roll out the app. --- ## Video guide Watch this video if you prefer watching a video tutorial.
# Apple App Store Deployment > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/deployment/apple-app-store-deployment Learn how to seamlessly deploy your apps to the Apple App Store using FlutterFlow Studio. FlutterFlow Studio allows you to deploy your apps directly to the App Store from within the platform. This guide covers all the necessary prerequisites, a step-by-step deployment process, and common troubleshooting tips. :::note[Prerequisites] - Create an [**Apple account**](https://appleid.apple.com/account?appId=632&returnUrl=https%3A//developer.apple.com/account/). - [**Purchase an Apple Developer membership**](https://developer.apple.com/programs/enroll/). Learn more about the program and enrollment process [here](https://developer.apple.com/programs/). - Set an App Launcher Icon for your app under **Settings & Integrations > General > App Assets**. **Note**: The launcher icon cannot be transparent or contain an alpha channel. - It's recommended to test your app on a real device before deployment. Follow [**these instructions**](https://docs.flutterflow.io/testing/local-run) to test your app locally. ::: ## Deploy to App Store The App Store deployment involves the following steps: ### 1. Create a Bundle Identifier A **Bundle Identifier (ID)** is a **unique string** that identifies your app within the Apple ecosystem, typically formatted in reverse domain name notation like `com.example.myapp`. To create a Bundle ID, visit the [**Certificates, IDs & Profiles**](https://developer.apple.com/account/resources/identifiers/list) page, add a new **App ID**, and provide these details: 1. **Bundle ID:** Copy the **Package Name** from FlutterFlow Studio. 2. **Description:** Add a brief description of your app. 3. **Capabilities:** Select the necessary app capabilities. Ensure you select **Push Notifications** if your app uses them, and **Sign In with Apple** if your app includes that feature.

### 2. Add New App [App Store Connect](https://developer.apple.com/help/app-store-connect/get-started/app-store-connect-homepage) is the platform used for submitting apps, managing app metadata, and much more. To add a new app, open the [App Store Connect](https://appstoreconnect.apple.com/) and then follow the official steps outlined [here](https://developer.apple.com/help/app-store-connect/create-an-app-record/add-a-new-app).

### 3. Add Apple App ID to FlutterFlow Studio An App ID is used by Apple to identify your app and associate it with your development team. To add your App ID to FlutterFlow Studio, go to **[App Store Connect](https://appstoreconnect.apple.com/) > My Apps**, copy your **Apple ID** from **App Information**, and paste it into the **App ID** field in **FlutterFlow Studio > Settings & Integrations > Mobile Deployment > App Store**.

### 4. Generate API key and add to FlutterFlow Studio To generate your API Key, go to [**App Store Connect**](https://appstoreconnect.apple.com/) > **Users and Access** > **Integrations > [Team Keys](https://appstoreconnect.apple.com/access/integrations/api)**. If you haven't added a key before, you will see a **Request Access** button. For further details, watch a [demo](https://youtu.be/L2BpgVog4so?si=yS9r_PBeORgd6Uhp&t=240) here. Generate a new API key by selecting **Add (+)**, entering a name, and assigning the **App Manager** role. Once the key is generated, download it and upload it to **FlutterFlow Studio** under **Settings & Integrations > App Settings > Mobile Deployment > App Store > Private Key**.

### 5. Add issuer ID to FlutterFlow Studio Copy the **Issuer ID** from [**App Store Connect**](https://appstoreconnect.apple.com/) by navigating to **Users and Access** > **Integrations > [Team Keys](https://appstoreconnect.apple.com/access/integrations/api)**, and then paste it into the **Issuer ID** field under **App Store settings** in FlutterFlow Studio.

### 6. Add Key ID to FlutterFlow Studio Return to **[App Store Connect](https://appstoreconnect.apple.com/) >** **Users and Access** > **Integrations > [Team Keys](https://appstoreconnect.apple.com/access/integrations/api).** Find the row for the API Key you generated [here](#4-generate-api-key-and-add-to-flutterflow-studio), select **Copy Key ID,** and then paste it into the **Key ID** field under **App Store settings** in FlutterFlow Studio.

### 7. Deploy To deploy your app from FlutterFlow Studio, go to **Settings & Integrations > App Settings > Mobile Deployment > App Store** and click **Deploy To App Store**. Once deployed, you will receive an email from App Store Connect that a new build has been added to your app. ![deploy-to-appstore.avif](https://docs.flutterflow.io/assets/images/deploy-to-appstore-5aa199888f377af25dcdcfb05c5c4102.avif) :::note - Every time you deploy, we'll auto increment the **Build Number** (i.e., version code in Android) to ensure that each release is identifiable. If needed, you can update the *App Version* and *Build Number* yourself. - If another deployment is already in progress, deploying a new build will cancel the previous one. - It may take a few minutes for the request to process. Once completed, the status will be updated to **Submitted**. ::: :::tip If you prefer to manage your deployment process outside of FlutterFlow Studio, such as integrating with your own CI/CD pipeline, or if you want more control over versioning and custom code management directly on GitHub. You also have the option to [**Deploy apps from your GitHub repository**](https://docs.flutterflow.io/deployment/deploy-from-github). ::: ### 8. Submit your app for App Store approval From [**App Store Connect**](https://appstoreconnect.apple.com/), select **My Apps** and choose your app. Select **Prepare for Submission**, add the app assets and metadata, and then click **Add for Review**. ![add-for-review.avif](https://docs.flutterflow.io/assets/images/add-for-review-e313a116a9022d701e69edc01833f304.avif) Your app will now be reviewed by Apple. For additional information on Apple's review guidelines, please see [this link](https://developer.apple.com/app-store/review/guidelines/). --- ## Video guide Watch this video if you prefer watching a video tutorial.
--- ## FAQs
Invalid App Store Icon. The App Store Icon in the asset catalog in 'Runner.app' can't be transparent nor contain an alpha channel.

You need to update your App Launcher Icon (under Settings & Integrations --> General) with an image that isn't transparent and/or doesn't contain an alpha channel.

After submitting my iOS app to the App Store, I am getting an 'ITMS-91053: Missing API declaration' issue. What should I do?

Apple requires that apps using certain APIs have a Privacy Manifest file that declares the [**reason for using the API**](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api). Apple will begin requiring this file for App Store approval on May 1, 2024. Most packages that FlutterFlow Studio uses already have a Privacy Manifest created by the package author or FlutterFlow team. However, there may be some cases where packages don't have the necessary privacy manifest needed. Similarly, if you have written custom code that calls these APIs directly or uses a package that calls the APIs, you must ensure that your app has the required manifest file. Here are the steps you can take to resolve this issue: 1. See if the custom package you use is listed [here](https://developer.apple.com/support/third-party-SDK-requirements/); ensure to use the latest version if you are using any of these. 2. If unsure which package is using protected APIs, you may be able to use a tool like [this](https://github.com/crasowas/app_store_required_privacy_manifest_analyser) to identify them. Once identified, update to the latest versions, as the package author may have addressed compliance issues. 1. To verify, look into the package's changelog or source code for a `PrivacyInfo.privacy` file, which indicates compliance (examples [here](https://github.com/fluttercommunity/plus_plugins/blob/main/packages/share_plus/share_plus/ios/PrivacyInfo.xcprivacy) and [here](https://github.com/flutter/packages/blob/main/packages/url_launcher/url_launcher_ios/ios/Resources/PrivacyInfo.xcprivacy)). 2. If the current package hasn’t resolved the issue, consider using an alternative package that complies, or contact the package's maintainer for a fix. 3. If you have written a custom iOS code that is accessing the APIs: 1. In FlutterFlow Studio, navigate to **Settings & Integrations > App Settings > Privacy Manifest Configuration**. 2. Activate the necessary API reasons and select the appropriate reasons from the dropdown. A detailed explanation of each API reason can be found [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api). ![privacy-manifest-configuration](https://docs.flutterflow.io/assets/images/privacy-manifest-configuration-519c68fd856e18c19a57e7c2e76147ab.avif)

# Deploy from GitHub > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/deployment/deploy-from-github Learn how to deploy your apps directly from GitHub branch. If your FlutterFlow Studio project is connected to a GitHub repository, the generated code can be pushed to GitHub, giving you full control over your project’s code. Then, you can deploy your app directly from the same repository, rather than deploying through FlutterFlow Studio. Deploying from GitHub is particularly beneficial when: - You have written custom code that cannot be managed directly in FlutterFlow Studio, such as features that require advanced Flutter functionality. - You want to manage the source code in an external GitHub repository for better version control. - You want to automate the process of deploying your app directly from GitHub to the Play Store or App Store after modifying the code. - You want to deploy from a specific branch of your GitHub repository. ## Steps to Deploy To deploy from a GitHub repository: 1. If you haven't already added your project to the GitHub repository, follow the instructions provided [here](https://docs.flutterflow.io/exporting/push-to-github#connect-a-github-repo). 2. In FlutterFlow Studio, go to **Settings & Integrations > App Settings > Mobile Deployment.** 3. Locate the **Deployment Source** section and click the arrow icon on the right to expand it. 4. Turn on the toggle for **Use GitHub repo: [your repo URL]**. 5. Enter the branch name of your repository that contains the code you want to deploy. Ensure the branch name is correct. 6. Click the **Deploy to App Store** or **Deploy to Play Store** button, depending on your desired platform for deployment. ![deploy-from-github](https://docs.flutterflow.io/assets/images/deploy-from-github-9e0534ff4e93223c90e2332a4c195c6f.png) :::note[important] When deploying from your GitHub branch, you will need to manage the app versioning manually. This is done through the `pubspec.yaml` file. For example, to set the version to **1.1.0** and the build number to **2**, you can use the format: `version: 1.1.0+2`. ![update-version.avif](https://docs.flutterflow.io/assets/images/update-version-02789a60b90d0089cf1b990c1d858a68.avif) ::: ## FAQs
I am having an issue while Deploying from a GitHub branch. Error: *You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode.*

If you are experiencing problems deploying or uploading to the Google Play Store from a Github branch, check to make sure your `build.gradle` file is correct. 1. Open your `android/app/build.gradle` file. 2. Ensure your file has these lines of code: ``` def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null storePassword keystoreProperties['storePassword'] } } ``` 3. Newer Flutterflow code will automatically have these lines added. If yours doesn't, you can push it to your `flutterflow` branch on GitHub and merge in the changes or add them like so: ![deploy-github-issue](https://docs.flutterflow.io/assets/images/deploy-github-issue-3dec70eb9ae21fab4f205ab76c8fedc1.avif) 4. Lastly, change `debug` (shown in the red box above) to `release` before deploying.

# Deploy for Development Environments > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/deployment/deploy-for-environments Learn how to deploy your apps for development environments. FlutterFlow Studio provides flexibility in configuring deployment settings for different [environments](https://docs.flutterflow.io/testing/dev-environments), allowing you to manage your app builds for both mobile and web apps. With deployment settings tailored to each environment, you can test, isolate app functionality, and optimize for various use cases without impacting production builds. ## Mobile Deployment You can configure and publish environment-specific builds of your app for both iOS and Android platforms, allowing each build to coexist and function independently for different environments. To set up deployment for different environments, go to **Settings & Integrations > App Settings > Mobile Deployment**, and select the desired environment from the **Current Environment** dropdown on the right side. Now, to submit an environment-specific build to the App Store and Play Store, you must have unique package names representing each environment. To set this up, go to **Settings & Integrations > General > App Details > Package Name**, select the **Current Environment** from the dropdown (on the right), and specify the package name for that environment. This ensures that when you switch environments, the package name changes and you can submit separate builds to the App Store and Play Store. For example, in an ecommerce app, you can set package names such as `io.flutterflow.ecommerceflow.dev` for the development environment and `io.flutterflow.ecommerceflow.staging` for the staging environment.

Once this setup is complete, you can deploy to [App Store](https://docs.flutterflow.io/deployment/apple-app-store-deployment) and [Play Store](https://docs.flutterflow.io/deployment/google-playstore-deployment) as usual. :::tip[For iOS] - You can publish your apps as unlisted on the App Store to allow different builds without public exposure. - You must configure provisioning profiles, certificates, and App IDs unique to each environment to ensure secure and streamlined publishing. ::: ## Web Deployment Web deployment in FlutterFlow Studio provides you with the ability to configure the entire web deployment for each environment, including custom URLs, page titles, metadata, and deployment history. To set up deployment for different environments, navigate to **Settings & Integrations > App Settings > Web Deployment**, and select the desired environment from the **Current Environment** dropdown on the right side. Then, set a new **Site URL** for the selected environment and [publish](https://docs.flutterflow.io/deployment/web-publishing) your app as usual. ![deploy-web-app-for-environments.avif](https://docs.flutterflow.io/assets/images/deploy-web-app-for-environments-65e46cce24b61a07d205e9e703aa5b87.avif) # Third Party Integrations > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations Learn about the various third-party integrations available in FlutterFlow Studio! - [AI](https://docs.flutterflow.io/integrations/ai-agents): 2 items - [Ads](https://docs.flutterflow.io/integrations/ads/admob): 1 item - [Analytics](https://docs.flutterflow.io/integrations/google-analytics): 1 item - [Authentication](https://docs.flutterflow.io/integrations/authentication-methods): 6 items - [Database](https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started): 4 items - [Designer](https://docs.flutterflow.io/integrations/designer/import-from-ff-designer): 1 item - [Firebase](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase): 5 items - [Google Cloud](https://docs.flutterflow.io/best-practices/secure-api-keys): 1 item - [Maps](https://docs.flutterflow.io/integrations/google-maps/generate-maps-keys): 3 items - [Payments](https://docs.flutterflow.io/integrations/payments/braintree): 4 items - [Search](https://docs.flutterflow.io/integrations/search/simple-search): 2 items - [Storage](https://docs.flutterflow.io/integrations/firebase-storage/storage-rules): 1 item - [Streaming](https://docs.flutterflow.io/integrations/mux): 1 item - [Supabase](https://docs.flutterflow.io/integrations/supabase/setup): 1 item # AI Agents > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/ai-agents Learn how to add AI Agents for chat, image generation, video generation, text-to-speech, and speech-to-text in your FlutterFlow Studio app. AI Agents in FlutterFlow Studio enable you to integrate AI-powered chat, image generation, video generation, text-to-speech, and speech-to-text directly into your app. An AI Agent is a configurable AI service that you define in FlutterFlow Studio and then call from your app actions. You can build agents powered by providers such as **OpenAI**, **Google**, **Anthropic**, and **ElevenLabs**. Depending on the agent kind, you can create a conversational assistant, convert text into speech, transcribe audio into text, generate images from prompts, or generate video using the latest supported models. Here are some examples of AI Agents: - **AI Stylist:** In an e-commerce fashion app, an AI agent analyzes photos of clothing items users upload from their wardrobes and provides styling tips based on color combinations, styles, seasons, and individual preferences. - **Smart Recipe Assistant:** An AI agent in a cooking app that suggests recipes based on ingredients users have, dietary restrictions, or meal preferences, and offers interactive cooking guidance. - **Marketing Image Generator:** An image generation agent that creates product thumbnails, social posts, or campaign visuals from a prompt. - **Language Learning App:** A text-to-speech agent reads practice sentences aloud so learners can hear pronunciation in a natural voice. - **Meeting Notes App:** A speech-to-text agent transcribes uploaded meeting recordings or voice notes into searchable text. - **Social Media Campaign Builder:** A video generation agent creates short promotional clips from prompts for product launches, announcements, or ads. :::note[Prerequisite] Before you begin setting up AI Agents, make sure you: 1. Complete all the steps in [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). Note that, while setting up, make sure to follow step number 5 and 8 carefully from [**Allow FlutterFlow Studio to Access Your Project**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#allow-flutterflow-studio-to-access-your-project) section to properly add the **Cloud Functions Admin** role to **firebase@flutterflow.io** user. 2. Upgrade your Firebase project to the [**Blaze Plan**](https://firebase.google.com/pricing), as we rely on [**Firebase Cloud Functions**](https://firebase.google.com/docs/functions) to handle AI-related communication securely. 3. Get an API key for the provider you want to use, such as [**OpenAI**](https://platform.openai.com/api-keys), [**Anthropic**](https://platform.claude.com/settings/keys), [**Google AI Studio**](https://aistudio.google.com/app/apikey), or [**ElevenLabs**](https://elevenlabs.io/docs/api-reference/authentication). ::: ## Create AI Agent To create an AI agent, select the **Agents** tab from the left-side navigation menu, then click the **(+)** button. Provide a descriptive **Agent Name** (e.g., "ShoppingAssistant") and click **Create**. :::note You can create one AI Agent on the Basic plan and unlimited AI Agents on the Growth plan and higher. ::: After creating the agent, start with the common agent settings: - **Agent Kind**: Select what the agent should do. Supported kinds include **Chat**, **Image Generation**, **Text-to-Speech**, **Speech-to-Text**, and **Video Generation**. - **Internal Description**: Add a short note describing what the agent is for. This is for your own reference and is not sent to the AI model.

:::note The selected agent kind determines which model settings and app actions are available. For example, a **Chat** agent is used with the **Send Message** action, while an **Image Generation** agent is used with the **Generate Image** action. ::: ## Chat Use a **Chat** agent when your app needs a conversational assistant that can respond to users with text, markdown, or structured JSON. Chat agents are useful for support bots, tutors, product recommenders, content assistants, and agents that analyze user-provided text, images, PDFs, audio, or video. The chat settings are as follows: **System Message** Defines the AI’s role and how it should behave when responding to users. For instance, “You are an AI fashion stylist…” tells the agent to respond like a professional stylist, focusing on outfits, colors, and suggested combinations. **Preloaded Messages** Preloaded messages allow you to set predefined interactions between the AI and users. It is useful for training the agent with example responses to ensure it understands the expected format of answers. - **Role**: Specifies whether the message is from the **User** or the **Assistant**. - **Message**: The actual text input that either the user or assistant might send. - **Example:** - **Role = User:** "What outfit suits my medium skin tone for a sunny day?" - **Role = Assistant:** "For your medium skin tone on a sunny day, a pastel-colored top with white chinos would look fantastic! Consider adding sunglasses and comfortable footwear." :::tip It is always recommended to include at least one sample conversation with both a user message and an assistant response. ::: **Model Settings** - **Provider**: Allows you to select the AI vendor for this agent. Supported chat providers include **OpenAI**, **Google**, and **Anthropic**. - **OpenAI & Anthropic**: If you choose OpenAI or Anthropic, FlutterFlow Studio will create a [Cloud Function](https://firebase.google.com/docs/functions) in Firebase to relay requests to the AI API securely. Hence, your Firebase project must be on a [Blaze](https://firebase.google.com/pricing) plan (paid) to deploy the necessary cloud function. **Note that** the deployed cloud function will only be accessible to authenticated users. - **Google**: When selecting Google as your provider for chat agents, you need to enable the following in your Firebase project. - [**Firebase Authentication**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup): This ensures secure interactions between users and your AI agents. - [**Vertex AI**](https://firebase.google.com/docs/vertex-ai): Vertex AI is Google's comprehensive AI platform used to manage and deploy machine learning models. FlutterFlow Studio internally uses the [`firebase_vertexai`](https://pub.dev/packages/firebase_vertexai) package to integrate Google's AI models within your Firebase-connected project. - **Model**: Choose from the list of available models for the given provider. Models differ in capabilities, supported parameters, and cost structure. - **API Key:** Enter your provider’s API key when the selected provider or model requires one. FlutterFlow Studio securely stores this key within the deployed cloud function to ensure it remains hidden from end-users and network requests. **Request Options** Define the types of inputs users can send to the AI agent. You can enable one or more of the following options: - **Text**: Allows users to send written messages, questions, or prompts. - **Image**: Enables users to upload photos for the AI to analyze visual content, such as objects, styles, or scenes. - **PDF** (Anthropic and Google Agent only): Lets users submit PDF documents, allowing the AI to extract and interpret information from files like resumes, reports, or forms. - **Audio** (Google Agent only): Supports voice input, enabling users to record or upload audio clips for transcription, sentiment analysis, or voice-based commands. - **Video** (Google Agent only): Allows users to submit video files, enabling the AI to analyze visual elements. Selecting multiple input types makes it easier for users to clearly communicate what they need. Instead of relying only on text descriptions, users can combine inputs. For instance, in an AI Stylist agent, enabling both Text and Image allows users to either describe their outfits in words or upload clothing photos for personalized analysis. **Response Options** Defines the type of output you want from the agent. You can select from the following options: - **Text**: Returns plain text responses. - **Markdown**: Allows richer formatting (headings, lists, links) if you display content as markdown. For example, an FAQ chatbot can use formatted bullet points, bold text, or italic text to highlight key information. - **JSON**: Returns structured data, which can be parsed programmatically. For example, a restaurant finder app might need structured data, e.g., `{ name: 'Pizza Palace', distance: '2.4 miles' }` to display a dynamic map. **Model Parameters** Here, you can fine-tune how the agent generates responses. - **Temperature**: Controls how creative or random the AI’s responses can be on a scale of 0 to 1. A lower value (e.g., 0.1) makes responses more factual and consistent. A higher value (e.g., 1.0) makes responses more creative and varied (e.g., brainstorming ideas). - **Max Tokens**: Limits the total number of tokens used, including both the user's request and the agent's response. Adjusting this helps manage costs and ensures concise interactions. - **Top P**: Another technique for controlling the variety of words the AI considers. Typically kept at default unless you want fine-tuned sampling control. For example, in a **Blog-Writing Assistant**, you might set a moderate to high temperature for creative phrasing and a high max tokens limit for detailed paragraphs. Conversely, a **Financial Chatbot** would benefit from a lower temperature to deliver consistent, accurate, and stable responses without unnecessary creativity. ### Send Message [Action] The **Send Message** action allows your app to pass user input (such as text or images) to a selected AI Agent and receive a response based on its system instructions, preloaded messages, and model settings. For example, you can add this action when a user taps a “Send” button after typing in a text field. The AI Agent can then reply based on its system instructions, preloaded messages, and model settings. You can configure the following options for this action: - **Select Agent**: Here, you select the specific AI Agent you previously configured. - **Conversation ID**: The Conversation ID is a unique identifier you assign to maintain context and continuity across multiple interactions within the same conversation. Using a consistent ID (e.g., `user123_AIStylist_202503181200`) allows the AI to remember past interactions and keep conversations coherent and contextual. - **Text Input**: This is where you specify the user's message or input text that the AI agent will process. Typically, this input comes from a widget state (e.g., TextField). - **Image Input**: If your agent supports image processing, you can provide an image. - **Audio Input**: If your agent supports audio processing, you can pass audio files. - **Video Input**: If your agent can analyze video content, provide a video file. :::note - You can send media files either from [**network URL**](https://docs.flutterflow.io/concepts/file-handling/displaying-media#network) or a [**local device**](https://docs.flutterflow.io/concepts/file-handling/displaying-media#uploaded-file) storage. - For non-Google agents, we only support network URLs for now. To pass media files from your device, [**upload it first to cloud storage**](https://docs.flutterflow.io/concepts/file-handling/uploading-files#upload-or-save-media-action) and then provide its generated URL. ::: - **Action Output Variable Name**: This field stores the AI agent's response to let you display the response to users or process it further. ![ai-agent-send-message-action.avif](https://docs.flutterflow.io/assets/images/ai-agent-send-message-action-6da8af9808becbc25e86f651e78cbf36.avif) ### Clear Chat History [Action] The **Clear Chat History** action allows you to clear the remembered context for a Chat agent. It takes the **Conversation ID** and stops referencing the existing thread ID when you next send a message. ![ai-agent-reset-action.avif](https://docs.flutterflow.io/assets/images/ai-agent-reset-action-8cce58c7726c2cb53e5ce5db6adcbdea.avif) ## Text-to-Speech Use a **Text-to-Speech** agent when your app needs to convert text into spoken audio. This is useful for reading messages aloud, generating narration, creating voiceovers, or helping users hear content in a selected voice. Text-to-speech settings include: - **Provider**: The text-to-speech provider, such as ElevenLabs. - **Model**: The speech generation model, such as Eleven Flash v2.5. - **API Key**: The provider API key used by the deployed agent function. - **Voice ID**: The default voice used to generate speech. Actions can override this per call. - **Output Format**: The audio output format, such as MP3. - **Stability**: Controls how consistent the voice output should be. - **Similarity Boost**: Controls how closely the generated speech should match the selected voice. - **Speed**: Controls the speaking speed. ![AI Agent text-to-speech settings](https://docs.flutterflow.io/assets/images/ai-agent-tts-15504ccad9953eed64be954eaf9bd4db.avif) ### Generate Speech [Action] The **Generate Speech** action allows your app to send text to a Text-to-Speech agent and receive generated audio. You can configure the following options for this action: - **Select TTS Agent**: Select the Text-to-Speech agent you previously configured. - **Text Input**: The text to convert into speech. - **Voice ID Override (optional)**: Optionally override the agent's default voice ID for this call. - **Action Output Variable Name**: Stores the generated speech result so you can play it or use it in later actions. ![AI Agent generate speech action](https://docs.flutterflow.io/assets/images/ai-agent-tts-action-61ebd60b29bdc583d9daea5c3d63ee5b.avif) ## Speech-to-Text Use a **Speech-to-Text** agent when your app needs to convert audio into text. This is useful for transcribing voice notes, meeting recordings, support messages, uploaded audio files, or audio from a URL. Speech-to-text settings include: - **Provider**: The transcription provider, such as ElevenLabs. - **Model**: The transcription model, such as Scribe v2. - **API Key**: The provider API key used by the deployed agent function. ![AI Agent speech-to-text settings](https://docs.flutterflow.io/assets/images/ai-agent-stt-d3e0ac06cd0860241d9ec9e9170e99aa.avif) ### Transcribe Audio [Action] The **Transcribe Audio** action allows your app to send audio to a Speech-to-Text agent and receive the transcribed text. You can configure the following options for this action: - **Select STT Agent**: Select the Speech-to-Text agent you previously configured. - **Audio Source**: Choose where the audio comes from. Supported sources include **Audio URL** and **Uploaded Audio File**. - **Language Code (optional)**: Provide a language code, such as `en`, to guide transcription. - **Action Output Variable Name**: Stores the transcribed text so you can display it or use it in later actions. ![AI Agent transcribe audio action](https://docs.flutterflow.io/assets/images/ai-agent-stt-action-cf19eac005869f09005de4169fe54f6c.avif) ## Image Generation Use an **Image Generation** agent when your app needs to create images from a text prompt. This is useful for generating product thumbnails, profile artwork, backgrounds, campaign visuals, or other app-specific images. You can configure image generation with supported providers such as **Google** or **OpenAI**, choose the model, add the API key, and set a default image size. Image settings include: - **Provider**: The provider used to generate images, such as Google or OpenAI. - **Model**: The image generation model, such as Gemini image models or GPT Image models. - **API Key**: The provider API key used by the deployed agent function. - **Image Size**: The default image size for Generate Image calls. Actions can override this per call. ![AI Agent image generation settings](https://docs.flutterflow.io/assets/images/ai-agent-image-gen-467092e7d216240586d252a2bb8d9262.avif) ### Generate Image [Action] The **Generate Image** action allows your app to send a prompt to an Image Generation agent and receive a generated image. You can configure the following options for this action: - **Select Image Generation Agent**: Select the Image Generation agent you previously configured. - **Prompt**: The text prompt that describes the image to generate. - **Size Override**: Optionally override the agent's default image size for this call. You can select **Use Agent Default** or choose a supported size such as **Square (1024 x 1024)**, **Portrait (1024 x 1536)**, or **Landscape (1536 x 1024)**. - **Action Output Variable Name**: Stores the generated image result so you can display it or use it in later actions. ![AI Agent generate image action](https://docs.flutterflow.io/assets/images/ai-agent-image-gen-action-ac750333f6ba958387b3344a18c3c3de.avif) ## Video Generation Use a **Video Generation** agent when your app needs to generate video from a text prompt. This is useful for creating short clips, campaign visuals, animated concepts, visual storyboards, or social media assets. Video generation settings include: - **Provider**: The video generation provider, such as Google. - **Model**: The video generation model, such as Veo 3.1. - **API Key**: The provider API key used by the deployed agent function. - **Aspect Ratio**: The default video aspect ratio for Generate Video calls. Actions can override this per call. - **Duration**: The target video duration. ![AI Agent video generation settings](https://docs.flutterflow.io/assets/images/ai-agent-video-gen-8b8cdeb1a67fcb3be18b72776bc28612.avif) :::note Video generation can take 30 seconds to several minutes. The cloud function keeps the connection open while the provider job runs. ::: ### Generate Video [Action] The **Generate Video** action allows your app to send a prompt to a Video Generation agent and receive a generated video. You can configure the following options for this action: - **Select Video Generation Agent**: Select the Video Generation agent you previously configured. - **Prompt**: The text prompt that describes the video to generate. - **Aspect Ratio Override**: Optionally override the agent's default aspect ratio for this call. You can select **Use Agent Default** or choose a supported aspect ratio such as **Landscape (16:9)**, **Portrait (9:16)**, or **Square (1:1)**. - **Action Output Variable Name**: Stores the generated video result so you can display it or use it in later actions. ![AI Agent generate video action](https://docs.flutterflow.io/assets/images/ai-agent-video-gen-action-3d97b3cfcebd8f28675e578436697c0d.avif) ## Deployment Settings Here, you can fine-tune how your AI Agent is executed. These settings help balance performance, security, and cost for your use case. - **Require Authentication**: By default, this is set to ON to restrict access to only authenticated Firebase users. When set to OFF, anyone can call your agent, which may pose a security risk. - **Timeout (seconds)**: Defines how long the agent function can run before being terminated. For example, a value of `60` allows the function up to 60 seconds to complete. Increase if your agent performs long-running operations or processes complex logic. - **Memory**: Allocates memory for your agent. Higher memory improves performance for heavy workloads but may cost more. For example, choose `256MB` for standard tasks or `512MB+` for agents handling large data or complex logic. - **Min Instances**: The number of instances kept warm and ready at all times. Set to `0` to minimize costs. For example, setting `Min Instances` > 0 can improve response speed by avoiding cold starts, but this incurs additional cost. Set to `0` for development or low-traffic environments. - **Max Instances**: The maximum number of instances that can run simultaneously. Helps scale under load and avoid throttling. For example, setting `Max Instances = 10` limits concurrency to 10 requests. Once configured, click the **Publish** button to make it live. :::note[For non-Google Agents] After you successfully deploy the agent, changes to its configuration, such as modifying the system message, model, or temperature, require you to redeploy the agent. For Google chat agents, the configuration is stored on the client side, so redeployment isn't necessary. ::: # Gemini > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/gemini Learn how to get started with the Gemini action in your FlutterFlow Studio app to generate text, process text-and-image inputs, and count tokens. With the Gemini action, you can generate text, process text-and-image inputs, and effortlessly count tokens. :::caution[Deprecation Notice] The Gemini action will eventually be deprecated. We recommend transitioning to the newer and more powerful [**AI Agent**](https://docs.flutterflow.io/integrations/ai-agents) actions. :::
## Setup Integrating [Gemini AI](https://gemini.google.com/app) into FlutterFlow Studio unlocks Google's advanced AI capabilities right within your app. Follow this guide to integrate Gemini AI: 1. Visit [**Google AI Studio**.](https://aistudio.google.com/) and click on **Get API Key** > **Create API key**. You can create an API key within a new Google Cloud project by selecting *Create API key in new project*, or choose an existing Google Cloud project. 2. Once the API key is generated, copy it. :::tip To secure your API keys, refer to the Best Practices guide: [Secure API Keys](https://docs.flutterflow.io/best-practices/secure-api-keys) ::: 1. Go back to FlutterFlow Studio and navigate to **Settings and Integrations > Integrations > Gemini**. 2. Toggle on the **Enable Gemini** option and paste the copied **API key** into the designated field. 3. Now, you can add [Gemini actions](#gemini-action) at appropriate events within your app. With these steps, you’re all set to enhance your FlutterFlow Studio app with powerful AI features. ## Gemini [Action] To add a Gemini Action, follow these steps: 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. 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 the **+ Add Action**. 3. On the right side, search and select the **Gemini** (under *Integrations*) action. 4. Set the [**Action Type**](#types-of-gemini-action). **Note** that If you set this type to *Text from Image*, you must provide the image as well. 5. Provide the **Text prompt** that will be used to generate the result from the Gemini AI model. For this example, we use this prompt: `When users upload a photo, you analyze the food in the photo and tell if it is healthy to eat`. 6. Provide the **Action Output Variable Name** where the result of the generation will be stored. Later, you can access this variable from anywhere on the page.
## Types of Gemini action Following are the types of Gemini actions you can add: ### Generate Text This action allows you to create natural language text based on the text prompts you provide. **Example**: * **Input**: *Text prompt* - "Write a brief summary of the benefits of exercise." * **Output**: *Action Output Variable Name* - "Exercise can improve mental health, increase lifespan, enhance physical fitness, and reduce the risk of chronic diseases." ### Count Tokens With this action, you can analyze the number of tokens in a given text prompt. This is particularly useful for applications that need to monitor or restrict the length of text inputs, ensuring that content stays within desired limits or quotas. A token can be a word, but it can also be a part of a word or even punctuation. The division of text into tokens depends on the tokenization algorithm being used. For Gemini models, a token is equivalent to about 4 characters. 100 tokens are about 60-80 English words. **Example**: * **Input**: *Text prompt* - "Gemini is fun!" * **Output**: *Action Output Variable Name* - 5 ### Text from Image This action enables your app to analyze images and generate descriptive text about them. It can interpret the content of an image, such as identifying objects, scenery, or activities, and then provide a textual description. **Example**: * **Input**: *Text prompt* - "Identify the object in the image?" * **Input**: *Image Type* - There are two ways you can provide an image. + **Image Network URL**: You can provide the URL of the image hosted on the internet. If you upload an image to **Firebase** or **Supabase**, you can provide the image via ***Widget State > Uploaded File URL****.* + **Uploaded Image File**: You can also provide an image file directly [from your device](#) via ***Widget State > Uploaded Local File****.* * **Output**: *Action Output Variable Name* - "This is a pipe organ. It is a large musical instrument that is used in churches, concert halls, and other large buildings. The sound of a pipe organ is very powerful and can be used to create a wide variety of music." # AdMob > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/ads/admob Learn how to add AdMob in your FlutterFlow Studio app. Adding ads to your FlutterFlow Studio project can be a powerful way to monetize your app. FlutterFlow Studio supports the integration of popular advertising platforms like [Google AdMob](https://admob.google.com/home/), making it easy for you to add [Banner](https://developers.google.com/admob/android/banner) and [Interstitial](https://developers.google.com/admob/android/interstitial) ads to your projects. This guide provides a step-by-step walkthrough for integrating ads within your FlutterFlow Studio project. ## Setup AdMob Setting up an AdMob involves creating AdMob apps for both Android and iOS, obtaining the app keys, and configuring some optional settings. ### 1. Creating AdMob app Visit the AdMob homepage and [sign up](https://admob.google.com/home/) using your Google account. Once logged in, create an Android and iOS app with the necessary details, such as platform and app name. :::note You should create two AdMob apps to display ads in both Android and iOS versions. :::

### 2. Adding keys to FlutterFlow Studio You must add the App keys to your FlutterFlow Studio project that will allow your app to communicate with the AdMob server. To do so, get the app key from the AdMob App Settings, navigate to **Settings and Integrations** in FlutterFlow Studio, and add the Android and iOS app keys under **AdMob** integration settings.

### 3. Configure optional settings Below are some AdMob settings (under **Settings and Integrations** menu) that you might need to configure based on your app and target audience. ![admob-settings](https://docs.flutterflow.io/assets/images/admob-settings-78d7d353740075c5d389a7af51222ae3.avif) - **Show Test Ads**: Test ads are placeholders provided by AdMob that simulate real ads. To enable test ads during development, enable this option. This allows you to click on ads without charging Google advertisers and prevents your account from being flagged for invalid activity. Once your app is ready for production, you can disable this setting to serve real ads. - **Show GDPR Consent Dialog at App Launch**: To display the GDPR consent dialog for users in the European Union (EU), enable this option. **Note that** the dialog will only appear if the user is from the EU and you created a [European regulations message](https://support.google.com/admob/answer/10113207). - **Child-Directed Settings**: To indicate that your content is directed towards children, enable this option. This will ensure that Google treats your content as child-directed when making ad requests. - **Users Under the Age of Consent**: This setting allows you to comply with privacy regulations for users in the European Economic Area (EEA) who are under the age of consent. It ensures that ad requests are appropriately handled, limiting data collection and targeting to meet legal requirements. This is important to protect user privacy and to avoid penalties for non-compliance. - **Ad Content Filtering**: To filter the type of ads displayed, select the appropriate content rating. AdMob will ensure that ads returned for these requests have a content rating at or below the level selected. These are the levels you can set: - **G (General Audience)**: Suitable for all audiences, with no adult content or explicit themes. - **PG (Parental Guidance)**: Ads may contain mild content, suitable for children with parental supervision. - **T (Teen)**: Ads with content appropriate for teenagers; may include some mature topics. - **MA (Mature Audience)**: Ads intended for adults, which may include strong themes or explicit content. Once the setup is completed, you can start to display [AdBanner](#adbanner) or [Interstitial ads](#interstitial-ad) in your app. ## AdBanner The **AdBanner** widget displays advertisement banners within your app. It can feature text, images, and rich media, including video ads. Here's an example for AdBanner widget with a test ad: ![adbanner-widget-with-test-ad](https://docs.flutterflow.io/assets/images/adbanner-widget-with-test-ad-3e70c55ef47b3ef473610ead643a2be6.avif) To display an **AdBanner** from AdMob, follow these steps: ### Adding AdBanner widget First, add the **AdBanner** widget from the **Base Elements**. Next, create a new Banner Ad unit in AdMob, then copy and paste its **unit ID** into FlutterFlow Studio. The Ad unit ID is a unique identifier assigned to each ad created in AdMob. :::note By default, ad banners are set to a dimension of 100 (width) x 50 (height). :::

:::tip While building your app, clicking on too many ads may cause your AdMob account to be flagged for invalid activity. To avoid this, it's recommended to enable **Test Ads** during development. ::: ### Testing AdBanner Ads cannot be tested in Test or Run Mode. They can only be tested on a real device or emulator. To do this, you can use [Local run](https://docs.flutterflow.io/testing/local-run) or [download the code](https://docs.flutterflow.io/flutterflow-cli/exporting) and run it in your IDE. ## Interstitial Ad An **Interstitial Ad** is a type of full-screen ad that appears at natural transitions or pauses in an app, such as when switching between pages. Unlike banner ads, which stay on-screen while users interact with the app, interstitial ads are shown at key moments and are designed to be closed before the user can continue. They typically support multiple formats, including: - **Image ads** - **Video ads** - **Rich media (interactive ads)** To display an interstitial ad in FlutterFlow Studio, you need to use the **Load Interstitial Ad** and **Show Interstitial Ad** actions together. Here's how it works: ![interstitial_ad_flow](https://docs.flutterflow.io/assets/images/interstitial_ad_flow-37b9a4643342b96a27d51145de51744a.png) First, load the ad using the **Load Interstitial Ad** action, then display it with the **Show Interstitial Ad** action. Once the ad is shown, users can choose to either interact with it or dismiss it. After the ad is dismissed, it cannot be displayed again, so you'll need to load a new ad. The newly loaded ad will then be ready for display the next time you trigger the **Show Interstitial Ad** action. :::caution ***Allow sufficient time between calling Load Interstitial Ad and Show Interstitial Ad to ensure the ad has fully loaded.*** Since loading may take some time, it's recommended to load the ad well in advance to avoid display issues. For example, if you want to show an ad when a widget is tapped, you should load the ad as soon as the page loads. If the ad isn’t loaded in time, it won’t be displayed. ::: Let's see an example displaying the interstitial ad when you navigate to the next page: ![interstitial-ad-flow-2](https://docs.flutterflow.io/assets/images/interstitial-ad-flow-2-8f38970216bede167890e5f3434036c9.avif) On the first page, trigger the **Load Interstitial Ad** action as soon as the page loads. Then, on a widget tap, add the **Show Interstitial Ad** action. The result of whether the ad is dismissed will be stored in the `interstitialAdSuccess` variable. If this value is true (the ad was dismissed), you can load a new ad and proceed to navigate to the next page. Here are the step-by-step instructions: ### Getting Ad Unit ID The Ad Unit ID is the unique identifier given to every ad on Admob. You can get this by creating a new Interstitial ad unit from your Admob account. You’ll need this ID when loading the ad. To get the ad unit ID, go to the AdMob dashboard, select your app under **Apps**, and create an **Interstitial** ad unit by following the steps under **Ad units**. Once created, copy the ad unit ID, and repeat the process for the iOS version if needed.

### Loading Ad on Page Load Always load the ad in advance before you intend to display it. This ensures the ad has enough time to fully load its content, whether it's an image or video, before being shown. The best place to do it is the **On Page Load**. To load the ad when the page loads, select the page, add the **On Page Load** action trigger, and set the action to **Load Interstitial Ad**. Enter the iOS and Android **Ad Unit ID**s you obtained in [step 1](#getting-ad-unit-id). :::tip While building your app, clicking on too many ads may cause your AdMob account to be flagged for invalid activity. To avoid this, it's recommended to enable **Test Ads** during development. :::

### Display Interstitial Ad Now, you can display the ad using the **Show Interstitial Ad** action. This action returns `interstitialAdSuccess` (as an action output variable), which can be used to check if the user has dismissed the ad. If the ad is dismissed, load a new one and then proceed to navigate to the next page.

## Best Practices To maximize the effectiveness of AdMob ads in your app while maintaining a positive user experience and complying with AdMob policies, follow these overall best practices: - **Use Test Ads During Development**: Always enable Test Ads during development to avoid invalid traffic and protect your AdMob account from being flagged or banned. - **Comply with AdMob Policies**: Adhere strictly to AdMob’s guidelines regarding ad placement, frequency, and user interaction. This includes avoiding accidental clicks and ensuring that ads are not too intrusive. Learn more about [AdMob Policies & Restrictions](https://support.google.com/admob/answer/6128543?hl=en). - **Respect User Privacy**: Follow data privacy regulations (e.g., GDPR, CCPA) and give users control over their ad preferences by integrating privacy options. Learn more about [AdMob Privacy & Consent](https://support.google.com/admob/answer/7676680?hl=en) ### AdBanner Best Practices - **Strategic Placement**: Position AdBanner widgets in non-intrusive areas of the app, such as at the bottom or top of the screen, so they don’t interfere with the user’s interaction with the app’s core content. Learn more about [Banner Ad Placement Guide](https://support.google.com/admob/answer/6128877?hl=en). - **Avoid Clickbait**: Make sure the banner ad does not blend too much with the app content. Users should easily differentiate between the ad and the app’s content to avoid accidental clicks. ### Interstitial Ad Best Practices - **Loading Ads in Advance**: Interstitial ads should be loaded before they are needed, typically in the background, to avoid delays when it’s time to display the ad. - **Displaying at the Right Time**: Ensure ads are shown at natural transition points. Showing ads in the middle of an activity can disrupt the user experience. - **Monitoring Frequency**: Overuse of interstitial ads can lead to a negative user experience. It's recommended to show them sparingly and at appropriate times. - **Test Before Production**: Use test ads during development to ensure that your implementation is correct and that you don’t accidentally trigger invalid ad interactions, which could lead to an AdMob account suspension. # Google Analytics > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/google-analytics Learn how to setup Google Analytics in FluterFlow Integrating Google Analytics into your FlutterFlow Studio project enables you to monitor user interactions, track app performance, and gain valuable insights to enhance user experience. Here's a comprehensive guide on setting up and utilizing Google Analytics within FlutterFlow Studio. :::tip Google Analytics is integrated into Firebase. This means you must [**set up Firebase**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) to enable analytics tracking and log events from your FlutterFlow Studio app. ::: ## Enable Google Analytics in Firebase To enable Google Analytics in Firebase, open the [Firebase Console](https://console.firebase.google.com/) and select your project. From the left-side menu, navigate to **Analytics > Dashboard** and click **Enable Google Analytics**. Choose an existing Google Analytics account or create a new one, then **Finish** the setup.

## Enable Google Analytics in FlutterFlow Studio To begin collecting analytics data, navigate to **Settings and Integrations > Integrations > Google Analytics** within your FlutterFlow Studio project and toggle on the **Enable Google Analytics** option. Once enabled, you can set the [Predefined Events](#predefined-events). You can selectively toggle these options to log specific user interactions automatically. ![enable-google-analytics](https://docs.flutterflow.io/assets/images/enable-google-analytics-5d5b07e4f1dee8359e314b1148ef398c.avif) ### Predefined Events You can enable automatic logging for the following events: - **On Page Load**: Logs an event when a user opens a page, recorded with the Firebase-recommended name `screen_view`. The actual screen name is accessible within the `screen_name` parameter. - **On Action Start**: Captures events when users interact with widgets that trigger actions. Events are logged in the format `{WIDGET_NAME}_{TRIGGER_TYPE}`. For instance, if a user taps a button that navigates to another page, the event is logged as `Button_navigate_to`. - **On Each Individual Action**: This logs an event for every individual action or action chain for a given widget. It will be logged as `{WIDGET_NAME}_{TRIGGER_TYPE}` For example, when the user taps on a button and adds the *Upload Media* action followed by the *Update App State* action, the event will be logged as `Button_upload_media` and `Button_update_local_state`. - **On Authentication**: Logs events for authentication-related actions such as sign-up, login, logout, password reset, or account deletion. Events are logged using the action type, e.g., `sign_up` or `login`. :::tip To easily identify widgets in the analytics dashboard, consider giving them recognizable names, such as `BuyButton` instead of just `Button`. ::: ## Google Analytics Event [Action] In addition to predefined events, you can track specific user actions relevant to your app’s goals. This action allows you to log custom events and record additional information through parameters. For example, in an e-commerce app, you might log product purchases with parameters such as `product_category: electronics` to track item categories and `user_role: premium` vs. `user_role: guest` to differentiate user types. To log a custom event, add the **Google Analytics Event** action and enter a clear, descriptive **Event Name**. You can add parameters for extra context by clicking **+ Add Parameter** and providing **Key**-**Value** pairs (e.g., `product_category` as the Key and `electronics` as the Value). ![google-analytics-action](https://docs.flutterflow.io/assets/images/google-analytics-action-be22e990c2948c5b13eb97c716ff0b22.avif) ## Viewing Analytics Data To see all tracked events, both automatic and custom, open the [Firebase Console](https://console.firebase.google.com/) and select your project. From the left-side menu, navigate to **Analytics > Dashboard** to access detailed event reports. Use this data to gain insights into app screens, which funnels convert best, and where churn or drop-offs occur. In the long run, these metrics help you make data-driven improvements that enhance the user experience and maximize the impact of your FlutterFlow Studio app. ## FAQs
Why don’t I see any Analytics data yet?

Event data may not appear instantly, which can be frustrating during development. Firebase may take up to **24 hours** to display event data in the main dashboards. Ensure your device has internet access and you’ve used the app at least once since enabling Analytics.

# Authentication Methods Overview > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication-methods Authentication enables users to create accounts and log into your app, establishing a secure, Authentication enables users to create accounts and log into your app, establishing a secure, verified connection. In the dynamic world of applications, users can authenticate using various methods, including **Email Login**, **OAuth**, and **phone authentication**, among others. While each method has its unique features and advantages, they all share a common goal: enhancing security and verifying the identity of users to provide a safe and personalized user experience. ## Email Login Authentication The Email Login method involves users registering with an email address and password. Security in this approach is enhanced through **Email Verification**, where a link or code is sent to the user's email to confirm ownership. This step prevents unauthorized account creation and ensures that the user can recover their account and receive important communications. ![email-login.png](https://docs.flutterflow.io/assets/images/email-login-3b784eac7a0f93e27a53e54d7bdb9bdb.png) ## OAuth (Open Authorization) **OAuth** is a popular authentication protocol that enables users to authorize one application to interact with another on their behalf without revealing their password. This method is commonly used to allow applications to access service features or user information from other services, such as logging into a third-party app using Google or Facebook credentials. By using OAuth, the user's login credentials stay secure with the original service provider, and only specific permissions are granted to third-party apps via access tokens. This approach minimizes the risk of exposing sensitive user data and streamlines the login process across various platforms. ## Phone Authentication Another method is phone authentication, where a user's phone number is used as a form of identity verification. Upon registering or logging in, the user receives a text message with a verification code that must be entered to proceed. This method leverages the security of mobile networks and the uniqueness of phone numbers to ensure that the person attempting access is the legitimate owner of the account. ![phone-login.png](https://docs.flutterflow.io/assets/images/phone-login-2eb5b670e54ed779af7155996897dc7b.png) ## Anonymous Authentication Anonymous Authentication allows users to interact with your application without signing in with permanent credentials, by creating temporary anonymous accounts. This method is beneficial for users who want to test services before committing to creating an account. If a user decides to sign up later, their anonymous account can be upgraded to a regular account, preserving their data and interactions. Each anonymous session is typically isolated, with strict permissions to prevent access to sensitive features or user data. When upgrading to a full account, secure practices are used to link the anonymous data to the new authenticated profile, ensuring that no data leakage or unauthorized access occurs during the transition. Each authentication method aims to balance user convenience with high security, ensuring that personal and sensitive data remains protected while providing a seamless user experience. ![anon-user.png](https://docs.flutterflow.io/assets/images/anon-user-14e3fb5dbb8951bf1fbb1c8e7ad29b20.png) # Overview > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication-types Learn about integrating various authentication services like Firebase, Supabase, and Custom Authentication in FlutterFlow Studio. FlutterFlow Studio provides native support for a variety of Authentication Services, including **Firebase**, **Supabase**, and **Custom Authentication** options. To integrate these services into your app, simply navigate to 'App Settings,' select 'Authentication,' and then choose your preferred service. From there, you can set up initial pages for both entry and logged-in states. Follow any additional steps as necessary to complete the setup. ## Firebase Authentication In FlutterFlow Studio, you can seamlessly connect with **Firebase** and utilize the available authentication methods. Firebase Authentication integrates tightly with other Firebase services, leveraging industry standards like OAuth 2.0 and OpenID Connect. This makes it highly adaptable for use with your custom backend, ensuring a secure and scalable solution. :::note Learn how to enable [**Firebase Authentication**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) and integrate popular auth providers in your FlutterFlow Studio app. ::: ## Supabase Authentication In FlutterFlow Studio, you can also integrate Supabase to manage authentication efficiently. Supabase provides a powerful and flexible authentication solution, similar to Firebase but with some unique advantages like support for PostgreSQL. :::note Discover how to set up [**Supabase Authentication**](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup) and link it with available auth providers within your FlutterFlow Studio app. ::: ## Custom Authentication In FlutterFlow Studio, you have the flexibility to implement custom authentication solutions tailored to your specific needs. This allows for a highly personalized approach to security, enabling you to design and integrate authentication mechanisms that perfectly fit the unique requirements of your application. Whether you need to work with legacy systems or have specific security protocols, custom authentication provides the necessary control. :::note Explore how to implement [custom authentication](https://docs.flutterflow.io/integrations/authentication/custom-authentication) strategies in your FlutterFlow Studio app, ensuring your authentication flow aligns with your business requirements. ::: # Enabling Firebase Auth in FlutterFlow Studio > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup Learn how to perform the initial setup for Firebase authentication in your FlutterFlow Studio app. :::tip[Skip if...] You have already enabled authentication while creating a [**new project with Firebase setup.**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) ::: To enable authentication in FlutterFlow Studio: 1. Open your FlutterFlow Studio project where you are planning to use Firebase Authentication. 2. Open **Setting and Integrations > App Settings > Authentication**. 3. Turn on the Enable Authentication toggle and select **Authentication Type** to **Firebase**. 4. To ensure that your users are directed to the appropriate pages based on their login status, you must set the **Initial Page**. ![enable-auth-fr.png](https://docs.flutterflow.io/assets/images/enable-auth-fr-ae82ed0ec3ad5d152c5fbb0c1d1a2852.png) ### Setting Initial Pages for Authentication You can specify your app's **Entry Page** and **Logged In Page** from this section. - **Entry Page** : This page will be displayed if the user is not logged in. This is typically used to display the onboarding flow or to provide the login/sign-up page. - **Logged In Page**: This page will be displayed if the user is already logged in to your app. Users are automatically navigated to the page you specify here on a successful sign-in attempt. ## Creating the 'users' collection :::note[Prerequisities] To allow FlutterFlow Studio to create user documents during authentication steps, it is important to enable Firestore Access in Firebase. Follow this section to enable it first. ::: The 'users' collection stores the information for authenticated users. :::tip[Skip if...] You have already enabled 'Create User Collection' while creating a new project with [Firebase Setup](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). ::: 1. Click on the Firestore tab from the [**Navigation Menu**](https://docs.flutterflow.io/flutterflow-ui/builder#navigation-menu). 2. Click on the **+ Create Collection** button. If you have any other collection already added, you can click on the Plus button. 3. Enter a collection_name (this can be anything, but we recommend 'users') and click on Create button. 4. If you enter 'users' a popup will open which asks you to populate this collection with default fields. You can click Yes, and we will add all the fields. Follow the quicklink to see the steps

:::tip[Add Default Fields if skipped previously] 1. Click on the Settings icon in the Firestore tab. 2. Find the **Users Collection** switch and enable it. 3. Find the **Collection** dropdown below, click on the **Unset**, and select the name of the collection you just created. 4. Now switch to the **Collection** tab. Now you should see all the default fields. ::: To store and collect additional information or modify the default fields list, see how to add fields. :::caution[ WARNING] You do not need to create a password field. This is handled internally by Firebase. ::: ## Setup for Google or Phone sign-in setup for Android Apps :::tip[OPTIONAL] If you aren't planning to use **Google** or **Phone Sign-In**, you can skip these steps. ::: ### Generate the SHA-1 key An SHA-1 key (aka the 'Secure Hash Algorithm') is required if you want to use Google Sign-in and Phone Sign-in. To learn more about the SHA-1 key, see this [link](https://developers.google.com/android/guides/client-auth). :::caution[Release Guidelines] While releasing the app, make sure to [**get the key from Play Console**](#getting-sha-keys-for-release-mode). ::: 1. Open a terminal window: - **Mac**: Use the Launchpad or press (⌘ + Spacebar) for Spotlight search, type 'Terminal', and open it. - **Windows**: Click the Windows icon, navigate to the 'Windows System' folder, and open 'Command Prompt' either by clicking or right-clicking it. 2. Copy the following command (based on your operating system) and select Enter.
Windows
```keytool -list -v -keystore C:\Users\leon\.android\debug.keystore -alias androiddebugkey``` If you get the following error while trying the above command: ```ERROR:'keytool' is not recognized as an internal or external command``` You might not have JAVA installed on your machine. [Here](https://codewithandrea.com/articles/keytool-command-not-found-how-to-fix-windows-macos/) is the helpful link to install JAVA and remove the above issue.
Mac/Linux
```keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore```
3. After being prompted for the key password, type 'android' and press 'Enter'. Note: For security reasons, you won't see the password as you type it. 4. Copy the SHA1 key. #### Add the SHA-1 key in the Firebase Console 1. Open the **Firebase console > Project Overview > Project Settings** and scroll down to Your App section. 2. Select your Android App from the left side menu. 3. Find the SHA certificate fingerprints section and click on the Add fingerprint. 4. Enter the copied SHA-1 into the input box and click on Save. #### Getting SHA keys for release mode If you're releasing your app to the Play Store, you must add the SHA certificate fingerprints from the Play Console. To get the keys for the release app, navigate to **Play Store Console > Your project > Release Setup > App Signing** and copy the **SHA-1** and **SHA-256** keys. ![release-sha1-key](https://docs.flutterflow.io/assets/images/release-sha1-key-1cfa5eacd6051da6c81cc863811a8c7c.avif) ### Regenerate config files After adding the SHA-1 key you must re-generate the config files in FlutterFlow Studio. To regenerate the config files: 1. Return to FlutterFlow Studio. From the Navigation Menu, select **Settings & Integrations > Project Setup > Firebase**. 2. Click on the Regenerate Config Files. ![regerenate](https://docs.flutterflow.io/assets/images/regerenate-7b29b05d9cfb34aaa2f3b3800999eb91.png) # Common Auth Actions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions Learn how to add Firebase Authentication actions in your FlutterFlow Studio app. Here's a list of common authentication actions: ## Logout [Action] This action enables users to securely log out of their account and clear their session data from the app, which ensures that their account remains safe and secure. Follow the steps below to add this action: 1. Select the widget (e.g., Button) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**. 3. Search and select the **Logout** (under *Backend/Database > Firebase Authentication*) action. ![logout](https://docs.flutterflow.io/assets/images/logout-action-83a4b4ad85e39bbdfd4f272f230f599f.png) ## Reset Password With Firebase Authentication, there are two ways you can allow users to reset their password in your FlutterFlow Studio app: ### In-App Password Change This option allows users to change their password while they are logged into the app. This is useful when a user is authenticated but wants to update their password for security reasons. To implement this, create a new page in your app, such as a **ChangePassword** page. This page should include two **TextFields** for the user to enter a new password and confirm it, along with a button (e.g., **Update Password**) to submit. On the button's click, add the **Update Password** action (under *Backend/Database > Firebase Authentication*) and bind the **Password Field** and **Confirm Password Field** to their respective input widgets. ![firebase-update-password.avif](https://docs.flutterflow.io/assets/images/firebase-update-password-adcf2e4b82e68e4bc9a690bf398281e9.avif) :::note By default, the **Navigate Automatically** option is enabled. This means that after the password is successfully updated, the user will be redirected to the **Logged In Page** specified in your [**Initial Page**](https://docs.flutterflow.io/resources/projects/settings/general-settings#initial-page) settings. ::: ### Reset Password Link This allows users who are logged out to reset their password. It sends a password reset link to the user's email address. When clicked, the user is directed to a Firebase-hosted webpage where they can set a new password.

To set this up, create a page in your app, such as a **ForgotPassword** page. This page should include a **TextField** for the user to enter their email address and a button (e.g., **Send Reset Link**) to submit the request. On the button's click, add the **Send Reset Password Email** action (under *Backend/Database > Firebase Authentication*) and set the **Email Field** dropdown to the widget that takes user’s email. This action will send a password reset link to the provided email address. ![firebase-send-reset-link.avif](https://docs.flutterflow.io/assets/images/firebase-send-reset-link-017287b02614912f3a5e9e3d90e33e8d.avif) ## Update Email [Action] This action allows users to change their registered email address linked to their user profile, thus ensuring their account details are up-to-date. This is helpful in scenarios where a user may have changed their primary email address or entered an incorrect one during initial registration. Also, if users lose access to their original email or forget their login credentials, being able to update their email addresses can assist in resetting passwords or recovering account access.

Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**. 3. Search and select the **Update Email** (under *Backend/Database > Firebase Authentication*) action. 4. As a best practice, it's also recommended to send the email verification link to the new email (using the [e-mail verification](https://docs.flutterflow.io/integrations/authentication/firebase/email-login#send-email-verification-link-action) action) followed by this action. ![adding-update-email-action](https://docs.flutterflow.io/assets/images/adding-update-email-action-fd7c5ad244258b04db50c45d4e8a50a4.avif) :::note The **Update Email** action sends a verification email to the new address. The user's current email stays unchanged until the user verifies the new address and either you refresh their authenticated user data or they sign in again. After that, the app shows the new email. If a user requests several changes before verifying, only the latest requested address applies. ::: ## Delete User [Action] Using this action, you can delete the user account created using the [Firebase authentication](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup). Additionally, you can also set up to delete all data associated with that user.

Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**. 3. Search and select the **Delete User** (under *Backend/Database > Firebase Authentication*) action. 4. As a best practice, it's also recommended to log out the user (using the [logout](#) action) following this action. ![adding-delete-action](https://docs.flutterflow.io/assets/images/adding-delete-action-caeaca8b26c96db25760f62310cfb042.avif) 5. To delete all records and data associated with that user's account: 1. Navigate to the **Firestore** (from the Navigation Menu) > switch to **Firestore Settings** > **Firestore Rules**. 2. Identify the collection from which you want to delete the user's data and ensure the **Delete** rule is set to **Tagged Users**. This will open the 'Tag Users' popup; here you can select the field that contains the document reference. See how to [setup a rule](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules). 3. Tick the checkbox. 4. See the **Delete User References** section and click on **Preview** to verify the generated rule. 5. Click the **Deploy** button.

## FAQs
While adding Delete User [Action], I can't see or select field in 'Tag Users' popup

If you can't see or select the field containing the user reference, ensure that you have enabled the 'Create User Document' option in the **Create Account** action. Enabling this option ensures that the 'users' collection is properly set up and its reference can be accessed in the 'Tag Users' popup.

# Google Login > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/google-oauth-login Learn how to add Google OAuth login in your FlutterFlow Studio app. Google Sign-In allows users to authenticate using their Google Accounts. :::note[Prerequisites] Before getting started with this section: - Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) - Complete [**Initial Setup**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) - Added **SHA-1 key** and regenerated **Config Keys**. ::: ## Enable Google Sign-in Provider in Firebase Open the **Firebase Console**, click on **Authentication** and then follow the steps below to enable Google Sign in for your Firebase project.

## Add a Login Screen with Google Login Action ### Create a Login Screen To allow users to authenticate, you need a Login or Sign-in Page with a button. You can create your own or use the one from page templates. ### Add Login Action 1. On your Google Login button, select **Actions** from the properties panel (the right menu) and select **Add Action**. 2. Search and select the Log In (under **Backend/Database > Firebase Authentication**) action. 3. Set **Auth Provider** to **Google**. 4. Enable **Create User Document** and set the **Collection** to **users**. After successful login, this will insert the user's details, such as email, name, and photo, into the *users* collection. **Note** that, if a user exists already, it won't add the details again. If you haven’t already, see how to [create *users* collection](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup#creating-the-users-collection).

:::tip To let users log out of your app, you can use the [**Logout**](https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions#logout-action) action. ::: ## Test Google Login ### Running on Device To test during development, you can run your app locally using FlutterFlow Studio’s Local Run. Follow the [Local Run documentation](https://docs.flutterflow.io/testing/local-run) and see [how to set up a physical device](https://docs.flutterflow.io/testing/local-run#setup-physical-device) to start testing. ### Running on Test Mode/Run Mode 1. To test Google sign-in in Test or Run mode, you must add the authorized domain in the Firebase console and Google cloud console. - **For Test mode**, you can open the browser console, try logging in, and get the domain from the browser console. It should look like `ff-debug-service-frontend-ygxkweukma-uc.a.run.app`. For *Pro* users, the above URL will also include `-pro`, such as `ff-debug-service-frontend-pro-ygxkweukma-uc.a.run.app`. - **For Run mode**, you can simply use 'app.flutterflow.io'. 2. To add in Firebase console: 1. Open the Firebase console and click on Authentication and select the Setting tab. 2. Select **Authorized domains** from the left side menu. 3. Click **Add domain**. 3. To add in Google cloud console: 1. Head over to your [Project Credentials](https://console.cloud.google.com/apis/credentials?project=_) page. 2. Ensure you are on the correct project. In our case, we are using the [EcommerceFlow demo project](https://bit.ly/ff-docs-demo-v2), it will be different for you. ![credential-page.png](https://docs.flutterflow.io/assets/images/credential-page-06a701a56039dabdf631d49eb9a63a87.png) 3. Under the '**OAuth 2.0 Client IDs**', select '**Web client** (auto created by Google Service)'. 4. Under the '**Authorized JavaScript origins**', click ADD URI and add both the URL. 5. Similarly, under the '**Authorized redirect URIs**', click ADD URI, add both the URL and append '/__/auth/handler' at the end.
4. If you don't see the Web client created yet, you can create new one by clicking **+ CREATE CREDENTIALS**, selecting OAuth client ID and then select Application type to Web application. ![add-app.gif](https://docs.flutterflow.io/assets/images/add-app-495cc4d69983deb104c266378e8402a1.gif) ### Verify user created in Firebase Dashboard To confirm the successful integration of Google authentication and the creation of users, navigate to your **Firebase project > Authentication > Users** and check the entries. ![verify-google-auth-users.png](https://docs.flutterflow.io/assets/images/verify-google-auth-users-1b112d385f9937e80e9bb28c3ce22893.png) :::note To ensure that your Android release will authenticate to Google, make sure to use Google Play Console's SHA keys - see how to [**Get SHA keys for release mode**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup#getting-sha-keys-for-release-mode). ::: # Apple Login > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/apple Learn how to add Apple login in your FlutterFlow Studio app. Apple Sign-In allows users to authenticate using their Apple Accounts. :::caution[Support] Apple sign-in functionality is only supported for iOS. :::

:::note[Prerequisites] Before getting started with this section: 1. Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). 2. Complete [**Initial setup**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) required for authentication. 3. Created an [**Apple account**](https://appleid.apple.com/account?appId=632&returnUrl=https%3A//developer.apple.com/account/). 4. [**Purchased an Apple Developer membership**](https://developer.apple.com/programs/enroll/). Read more about the [**Apple Developer Program**](https://developer.apple.com/programs/) and how to sign up. 5. Apple sign-In can not be tested in Run Mode. You will need to test it on a real device or emulator. Try with Local Run! ::: ## Adding Apple sign-in Adding Apple sign-in comprises of the following steps: 1. [Configure email communication](#1-configure-email-communication) 2. [Enable Apple sign-in in your App ID](#2-enable-apple-sign-in-in-your-app-id) 3. [Enabling Apple sign-in in Firebase](#3-enabling-apple-sign-in-in-firebase) 4. [Add an Apple sign-in button](#4-add-an-apple-sign-in-button) 5. [Add login action](#5-add-login-action) 6. [Adding logout action](#6-adding-logout-action) 7. [Preparing to test the app](#7-preparing-to-test-the-app) 8. [Verify user creation](#8-verify-user-creation) ### 1. Configure email communication "Apple sign-in" is a privacy-focused authentication system. One of its notable features is the ability to hide a user's real email address when signing up for apps and services. When users choose to hide their email, you get one random email address that forwards to the user's actual Apple ID email. This helps users keep their real email addresses private. ![User opting to hide the email address](https://docs.flutterflow.io/assets/images/opt-to-hide-email-9ce8755a705492a463894be5e304fef7.png) So, in order to contact such users, you must register email sources that your organization will use for communication. :::note Also, If you use any of the Firebase Authentication features that send emails to users, including email link sign-in, email address verification, etc., you must add `noreply@YOUR_FIREBASE_PROJECT_ID.firebaseapp.com` as well. ::: To register email sources: 1. From your Apple developer account, open the [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/certificates/list) page and select [services](https://developer.apple.com/account/resources/services/list). 2. Under the 'Sign in with Apple for Email Communication,' click on the **Configure** button. 3. Click on the **(+)** button on the right side of **Email Sources**. 4. Enter the email in the **Email Addresses** section and click **Next**. 5. Now click on **Register** and then the **Done** button.

### 2. Enable Apple sign-in in your App ID Here's how you do it: 1. From your *Apple developer account*, open the [Identifiers](https://developer.apple.com/account/resources/identifiers/list) section. 2. Open the identifier with your existing APP ID. 3. Select **Sign In with Apple** from the list. 4. Click **Save**.

### 3. Enabling Apple sign-in in Firebase To enable Apple authentication in the Firebase: 1. Open the [Firebase console](https://console.firebase.google.com/) and click on **Authentication**. 2. Click on the **Get started** button (this may not be visible if you have already set up other forms of Authentication). 3. Select the **Sign-in method** tab. 4. Click on **Apple** (Under the 'Additional Providers' section). If you have already added any other provider, click on the **Add new provider** and then click on **Apple**. 5. Find the **Apple** switch and enable it. 6. Click on the **Save** button.

### 4. Add an Apple sign-in button To allow users to authenticate, you need a login page with a button. You can create your own or use the one from the widget template or page template. Here's how you can add the Apple sign-in button from our page template:

### 5. Add login action When you click the Apple sign-in button, it will trigger the 'Log In' action, prompting users to provide their Apple ID credentials. To add login action: 1. Select the widget (e.g., Button) on which you want to add the action. 2. Select **Actions** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu) and select **Add Action**. 3. Search and select the **Log in** (under *Backend/Database > Firebase Authentication*) action. 4. Set **Auth Provider** to **Apple**. 5. Tick the **Create User Document** and set the **Collection** to **users**. After successful login, this will insert the user's email address into the 'users' collection. If a user already exists, it won't add details again.

### 6. Adding logout action To let users log out of your app, you can use the [Logout](https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions#logout-action) action. ### 7. Preparing to test the app For testing your app on a real device, you must configure the project in Xcode. This includes adding a team to your project and setting an appropriate signing certificate. Here's how you configure your project in Xcode: 1. From the Local Run, [open your project in Xcode](https://docs.flutterflow.io/testing/local-run#access-project-code). :::tip If you are using Android Studio, right-click on the **ios** folder, find **Flutter,** and then click on the **Open iOS module in Xcode**. ::: 2. In Xcode, click on **Runner** (left side menu) and then select the **Signing and Capabilities** tab. 3. We recommend choosing the **Automatically manage signing** option. This will auto-create the profiles, app ID, and certificates required to build and run your app. If you don't, you'll have to [manually create a 'provisioning profile'](https://blog.codemagic.io/distributing-native-ios-sdk-with-flutter-module-using-codemagic/) and then add it in the Xcode. 4. Under the **Signing** section, find the **Team** dropdown and select your team. 5. Use [Local Run](https://docs.flutterflow.io/testing/local-run) to test the app on a real device.

### 8. Verify user creation Run and test your app. To confirm the successful integration of Apple authentication and the creation of users, navigate to your **Firebase project > Authentication > Users** and check the user entries. # Email Login using Firebase > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/email-login Learn how to add Email Login in your FlutterFlow Studio app. :::note[Prerequisites] Before getting started with this section: - Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) - Complete [**Initial Setup**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) ::: ## Enable Email Login Provider in Firebase 1. Open the Firebase Console and click on **Authentication** 2. Click on the Get started button (this may not be visible if you have already set up other forms of Authentication). 3. Select the **Sign-in** method tab. 4. Click on Email/Password (Under the 'Native providers' section). If you have already added any other provider, click on Add new provider and then click on Email/Password. 5. Find the Email/Password switch and enable it. 6. Click on the Save button. ## Add a Login Screen with Email/Password Fields In FlutterFlow Studio, you can utilize the Page Templates feature to create a new authentication page that includes both a "Create Account" component and a "Log In" component. This setup aligns with Firebase's authentication process, which requires users to first create an account using their email and then allows them to sign in using the email ID they registered with. ## Create Account Action The Create Account action is the entry point for new users in any application. It's about establishing a user's credentials and granting them access for the first time. This action involves collecting necessary information such as email, password, and potentially other user-specific details like name or phone number. The primary goal is to register and store new user data securely in your backend or authentication service (like Firebase). This process typically includes steps like validating the data format (e.g., email format), checking for unique usernames or email addresses etc. To enable this in FlutterFlow Studio, follow these steps: 1. Create a page using Page Templates or from scratch, and add fields such as Email, Password, and Confirm Password. Based on your requirements, you may add additional fields. 2. Add a "Create Account" or "Sign Up" button and attach an action to it. 3. Search for and select the **Create Account** action under **Backend/Database > Firebase Authentication**. 4. Set the **Auth Provider to Email**. 5. Configure the fields to retrieve values from variables, which are usually found under Widget State > Field Name. 6. The **Create User document** is enabled by default. This means a user document will be created in the 'users' collection after the user is authenticated, if it does not already exist with details like email and UID. - To create a user document in a different collection, adjust the **Created Document > Collection** dropdown to the desired collection. - If additional details such as name, age, and birthday are needed at signup, click on the **+ Add Field** and set its value. Make sure these fields are already created in the 'users' collection. ![create-account-action.png](https://docs.flutterflow.io/assets/images/create-account-action-f8867c7b7b34ca3a6767314b5d86415c.png) ## Send Email Verification Link [Action] :::note To understand why email verification is required when authenticating with an email and password, refer to [**Authentication Methods**](https://docs.flutterflow.io/integrations/authentication-methods) ::: 1. Add a new action immediately after the **Create Account** action. 2. Search for and select the **Send Email Verification Link** (located under **Backend/Database > Firebase Authentication**) action. The user's email is automatically retrieved from Firebase Authentication, and a verification link is sent to the user for confirmation.
The user should receive an email verification link in their inbox. Upon successful verification, they will see a success message. ## Log In [Action] The **Log In** action, on the other hand, is for users who already have an account. It involves verifying the credentials provided by a returning user against stored data to grant access to the system. This action is crucial for maintaining secure access control as it ensures that the entity attempting to gain access is indeed who they claim to be. The process usually requires users to provide their registered email and password, which are then checked for correctness through your authentication system. To enable this in FlutterFlow Studio, follow these steps: 1. Create another Log In page using Page Templates or from scratch, and add fields such as Email, Password. 2. Add a "Log In" button and attach an action to it. 3. Search for and select the **Log In** action under **Backend/Database > Firebase Authentication**. 4. Configure the fields to retrieve values from variables, which are usually found under Widget State > Field Name. ![login-action.png](https://docs.flutterflow.io/assets/images/login-action-a2b64c94132eea7dee3cfaa7eee87893.png) :::note To let users log out of your app, you can use the [**Logout**](https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions#logout-action) action. ::: ### Verify user created in Firebase Dashboard To verify that you have successfully added the email authentication and that users are being created, you can head over to your **Firebase project > Authentication > Users** and verify the user entries. # Facebook Login > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/facebook Learn how to add Facebook login in your FlutterFlow Studio app. Facebook login allows users to authenticate using their Facebook Accounts. :::note[Prerequisites] Before getting started with this section: - Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) - Complete [**Initial Setup**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) ::: ## Adding Facebook sign-in Adding Facebook sign-in comprises the following steps: 1. [Create app on Facebook](#1-create-app-on-facebook) 2. [Configure app on Facebook](#2-configure-app-on-facebook) 3. [Add email permission](#3-add-email-permission) 4. [Enabling Facebook authentication in Firebase](#4-enabling-facebook-authentication-in-firebase) 5. [Enabling Facebook authentication in FlutterFlow Studio](#5-enabling-facebook-authentication-in-flutterflow-studio) 6. [Add a Facebook sign-in button](#6-add-a-facebook-sign-in-button) 7. [Add login action](#7-add-login-action) 8. [Add logout action](#8-add-logout-action) 9. [Prepare to test the app](#9-prepare-to-test-the-app) 10. [Verify user creation](#10-verify-user-creation) ### 1. Create app on Facebook When you create an app on the [Facebook Developer Console](https://developers.facebook.com/), you are given a unique *App ID* and *App secret*, ensuring secure communication between your app and Facebook's servers. Additionally, it lets you define required permissions and user data access and also restricts login origins for enhanced security. Here's is how you create app on Facebook:

### 2. Configure app on Facebook Now, you must add and configure platforms that will support Facebook authentication - For example, Android and iOS. To do so follow the steps below: **Configure Android App**

**Configure iOS App**

### 3. Add email permission When users log in using third-party providers (like Google or Facebook), fetching their email addresses reduces the steps they need to take during sign-up. For Facebook sign-in, to access a user's email, you must add email permission in Firebase developer console. Here's how you do it:

### 4. Enabling Facebook authentication in Firebase Here's how you enable Facebook auth in Firebase:

### 5. Enabling Facebook authentication in FlutterFlow Studio To enable the Facebook authentication in FlutterFlow Studio, follow the steps below:

### 6. Add a Facebook sign-in button To allow users to authenticate, you need a login page with a button. You can create your own or use the one from the widget template or page template. ### 7. Add login action When you click the sign-in button, it will trigger the 'Log In' action, prompting users to provide their Facebook credentials.

:::note Switch on the **Create User Document** and set the **Collection** to **users**. After successful login, this will insert the user's email address into the 'users' collection. If a user already exists, it won't add details again. ::: ### 8. Add logout action To let users log out of your app, you can use the [Logout](https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions#logout-action) action. ### 9. Prepare to test the app Facebook Sign-In functionality does not work in Run or Test Mode. You can test your app on a real device or emulator using FlutterFlow Studio’s Local Run. Follow the [Local Run documentation](https://docs.flutterflow.io/testing/local-run) and see [how to set up a physical device](https://docs.flutterflow.io/testing/local-run#setup-physical-device) to start testing. ### 10. Verify user creation To confirm the successful integration and the creation of users, navigate to your **Firebase project > Authentication > Users** and check the user entries. # Phone Login > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/phone Learn how to add phone login in your FlutterFlow Studio app. Phone login allows a user to sign in by sending an SMS message to the user's phone. The user login in using a one-time code contained in the SMS message.

:::note[Prerequisites] Before getting started with this section: 1. Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). 2. Complete [**Initial setup**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) required for authentication. ::: ## Adding Phone sign-in Adding Phone sign-in comprises the following steps: 1. [Setting up phone sign-in](#1-setting-up-phone-sign-in) 2. [Enabling phone authentication in Firebase](#2-enabling-phone-authentication-in-firebase) 3. [Building phone number page](#3-building-phone-number-page) 4. [Building verify code page](#4-building-verify-code-page) 5. [Adding phone sign-in action](#5-adding-phone-sign-in-action) 6. [Adding verify code action](#6-adding-verify-code-action) 7. [Adding logout action](#7-adding-logout-action) 8. [Testing phone sign-in](#8-testing-phone-sign-in) 9. [Verify user creation](#9-verify-user-creation) ### 1. Setting up phone sign-in To use phone sign-in, you must [get the SHA-1 key](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup#generate-the-sha-1-key) and [regenerate the configuration files](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup#regenerate-config-files). You can find the detailed instructions [here](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup). **Note** that this step is often missed, so ensure you must complete this step before you proceed further. ### 2. Enabling phone authentication in Firebase To enable authentication in the Firebase: 1. Open the [Firebase console](https://console.firebase.google.com/) and click on **Authentication**. 2. Click on the **Get started** button (this may not be visible if you have already set up other forms of Authentication). 3. Select the **Sign-in method** tab. 4. Click on **Phone** (Under the 'Native Providers' section). If you have already added any other provider, click on the **Add new provider** and then click on **Phone**. 5. Find the **Phone** switch and enable it. 6. Click on the **Save** button.

### 3. Building phone number page To allow users to authenticate using their phone number, you need to create a page to accept the user's phone number. We provide a collection of ready-to-use templates. You can use one of our templates or create a page from scratch. Here is the page added from the templates, and after some modification, it looks the below:

### 4. Building verify code page You need to create another page to verify the SMS code. Here's how you build the verify code page using templates.

### 5. Adding phone sign-in action On click the 'sign-in' or 'send code' button, you will add the 'Phone Sign In' action, which redirects users to a page where they can enter the code received on their phone. To add this action: 1. Select the widget (e.g., Button) on which you want to add the action. 2. Select **Actions** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu) and select **Add Action**. 3. Search and select the **Phone Sign In** (under *Backend/Database > Firebase Authentication*) action. 4. Now provide the **Phone Number** via **Widget State > TextField** (that accepts the phone number). 5. Now, **Select Page** that you created to verify code.

### 6. Adding verify code action On click of the 'Verify Code' button, you will add the 'Verify SMS Code' action, which opens the home page if the action is successful. 1. Select the widget (e.g., Button) on which you want to add the action. 2. Select **Actions** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu) and select **Add Action**. 3. Search and select the **Verify SMS Code** (under *Backend/Database > Firebase Authentication*) action. 4. Now provide the **SMS Code** via **Widget State > TextField** (that accepts the code).

### 7. Adding logout action To let users log out of your app, you can use the [Logout](https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions#logout-action) action. ### 8. Testing phone sign-in #### 8.1 Test on Run or Test mode To test phone sign-in in *Test* or *Run* mode, you must add the authorized domain in the Firebase console. Here's how you add the authorized domain: 1. For **Test mode**, you can open the browser console, try logging in, and get the domain from the browser console, and for **Run mode**, you can simply use '*app.flutterflow.io*.' 2. Now open the [Firebase console](https://console.firebase.google.com/) and click on **Authentication**. 3. Select the **Setting** tab. 4. Select **Authorized domains** from the left side menu. 5. Click **Add domain**.

Here's how it should look: ![adding-authorized-domain](https://docs.flutterflow.io/assets/images/adding-authorized-domain-44d8bcb1a06fe163b52139709e7bbacf.png) #### 8.2 Test on a real device Phone Sign In ***does not*** work in an Android emulator. You can only test it on a real device. To test on a real device, add the SHA-256 key in the Firebase console and enable the 'Google Play Integrity API' in Google Cloud. :::note Skip if you find the below steps already completed by our automated Firebase integration. ::: 1. Get the SHA-256 key/fingerprint, add it to your Firebase project, and then regenerate the Firebase config files in FlutterFlow Studio. **Note**: The instructions are similar to generating the SHA-1 key and are explained [here](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup#generate-the-sha-1-key). You will find the SHA-256 key in the terminal just below the SHA-1 key. This is required for the Firebase to verify that the sign-in request is coming from a legitimate device. :::caution While releasing the app, make sure to [**get the key from the Play Console**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup#getting-sha-keys-for-release-mode). ::: ![SHA-256 key](https://docs.flutterflow.io/assets/images/sha-256-key-5cdec65c7cedca46e5b2c6759f268cf1.png) 1. Open the [Google Developers Console](https://console.developers.google.com/) (Make sure your project is selected in the dropdown at the top), Click on the **Library** menu on the left, search for the **Google Play Integrity API,** and enable it. 2. Now, you can test your app on a real device using FlutterFlow Studio’s Local Run. Follow the [Local Run documentation](https://docs.flutterflow.io/testing/local-run) and see [how to set up a physical device](https://docs.flutterflow.io/testing/local-run#setup-physical-device) to start testing.

### 9. Verify user creation To confirm the successful integration and the creation of users, navigate to your **Firebase project > Authentication > Users** and check the user entries. ## FAQs
How do I test with dummy numbers?

To try phone sign-in without any limitations, you can add some fictitious numbers to the Firebase console. To add the fictitious number: 1. Open the [Firebase console](https://console.firebase.google.com/) and click on **Authentication**. 2. Select the **Sign-in method** tab. 3. Click on the **Phone** (Under the Sign-in providers section). 4. Scroll down, find the **Phone numbers for testing** menu, and click on it. 5. Enter any dummy phone number (Make sure it looks unreal). 6. Enter the verification code that you would use on the verify code page. 7. Click on **add**.

Getting this error: "The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth Section."

1. First, ensure you have clicked the "Save" button while [Enabling phone authentication in Firebase](#2-enabling-phone-authentication-in-firebase). ![Enabling phone authentication in Firebase](https://docs.flutterflow.io/assets/images/adding-authorized-domain-44d8bcb1a06fe163b52139709e7bbacf.png) 1. If this is already enabled, head over to **Settings > SMS region policy >** select **Allow > Select regions** you want to support and click **Save**. ![SMS region](https://docs.flutterflow.io/assets/images/sms-region-5f476d85776e01b56251b53af01a767e.webp)

# Anonymous Login > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/anonymous-login Learn how to implement anonymous login in your FlutterFlow Studio app. :::note[Prerequisites] Before getting started with this section: - Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) - Complete [**Initial Setup**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) required for authentication. - Learn more about the concepts of [**Anonymous Authentication**](https://docs.flutterflow.io/integrations/authentication-methods#anonymous-authentication) ::: ## Enable Anonymous Authentication in Firebase To enable Anonymous authentication, first go to your Firebase console and enable the authentication provider:

## Add Anonymous Login Action 1. On the button designated for anonymous authentication, add a new Action. 2. Search for and select the **Log In** action (located under Backend/Database > Firebase Authentication). 3. Set the Auth Provider to **Anonymous**. 4. Enable the **Create User Document** toggle and set the Collection to _users_. This action will create an entry for the user in the database without any details upon successful login. :::note To let users log out of your app, you can use the [**Logout**](https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions#logout-action) action. ::: # JWT Token Authentication > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/jwt-auth Learn how to implement JWT authentication in your FlutterFlow Studio app. [JWT](https://jwt.io/introduction) token sign-in allows you to log in and use the Firebase services such as Firebase Database and push notifications using the account created on your own server/backend. ![JWT-login-flow.avif](https://docs.flutterflow.io/assets/images/JWT-login-flow-261eda3f9f9786766286293886e3609b.avif) In JWT token authentication, you send login credentials, like email and password, to your server through an API endpoint. The server then creates a user account, generates a custom JWT token, and returns it to your app. This JWT token allows you to log in to Firebase and access its services. :::note You can learn more about Firebase and JWT tokens [**here**](https://firebase.google.com/docs/auth/admin/create-custom-tokens). ::: ## Adding JWT token authentication Let's build an example that uses a JWT token to log into the app. Here's how it looks when completed: ![JET-token-authentication.gif](https://docs.flutterflow.io/assets/images/JET-token-authentication-f2de1605e4785a73127e0454ab1a4d27.gif) :::note[Prerequisites] Before getting started with this section: - Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). - Complete [**Initial setup**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) required for authentication. ::: Adding JWT token authentication comprises the following steps: 1. [Add login API](#1-add-login-api) 2. [Adding login page](#2-adding-login-page) 3. [Add login action](#3-add-login-action) 4. [Adding logout action](#4-adding-logout-action) 5. [Verify user creation](#5-verify-user-creation) ### 1. Add login API You must [create an API](https://docs.flutterflow.io/resources/backend-logic/create-test-api) endpoint on your server that accepts email/username and password. If the credentials are valid, it generates the JWT token and passes it back in response. At your server, you can generate the JWT token either using the [Firebase Admin SDK](https://firebase.google.com/docs/auth/admin/create-custom-tokens#create_custom_tokens_using_the_firebase_admin_sdk) or a [third-party JWT library](https://firebase.google.com/docs/auth/admin/create-custom-tokens#create_custom_tokens_using_a_third-party_jwt_library). You can find the detailed instructions [here](https://firebase.google.com/docs/auth/admin/create-custom-tokens). :::note Alternatively, you can integrate Supabase authentication into your app and use the JWT token generated after [**account creation**](https://docs.flutterflow.io/integrations/authentication/supabase/auth-actions#log-in-action). ::: The API endpoint should be similar to the following (Tip: Expand and see the '200 OK' section): #### Login API to be created on your server `POST` `/login` ##### Request Body | Name | Type | Description | | --- | --- | --- | | email* | String | | | password* | String | | ##### 200: OK ``` { "user": { "id": 1, "role_id": 1, "name": "james", "email": "james@yopmail.com" }, "token_type": "Bearer", "expires_in": 3600, "jwt_token": "eyJraWQiOiItSE5TUmtwMWdXcG9QcC1wWVBmU1U4UW1fdng4Q0VwdzRSdTZTQU9WLThRIiwiYWxnIjoiUlMyNTYifQ.eyJ2ZXIiOjEsImp0aSI6IkFULi1PaG5EdWREUG9qWklsZjMtVDRVWHlTWW5ERElHQ3dYTUdQcXk1c1JUbjAub2FydGh3ZmxpbzhZOVZJbHc0eDYiLCJpc3MiOiJodHRwczovL2Rldi00NTc5MzEub2t0YS5jb20vb2F1dGgyL2F1c2hkNGM5NVF0RkhzZld0NHg2IiwiYXVkIjoiYXBpIiwiaWF0IjoxNjU5MDAyOTQ5LCJleHAiOjE2NTkwMDY1NDksImNpZCI6IjBvYWhkaGprdXRhR2NJSzJNNHg2IiwidWlkIjoiMDB1aGVuaDFwVkRNZzJ1ZXg0eDYiLCJzY3AiOlsib2ZmbGluZV9hY2Nlc3MiXSwiYXV0aF90aW1lIjoxNjU5MDAyOTQ5LCJzdWIiOiJhcGktdXNlcjRAaXd0Lm5ldCJ9.g2TyTQECo-HCSjn58Fmazki8DBCtCq2hkG6OGQOJgr0JUq3uHgj8ulojoBI5ckv3e3TcVGFg1x9KknSwgiZo0LxRpbAdbF27hfF8truExjEv7hGKoV_oAOaiD56be5K-HjYkp6j-b5S6gXe4N10T1NtovLI7L6MZvmqCL_26qzXni5hNkCjgRm8Rd6GnJwbjDLpV3snp51bVNYNqhoAhOPBqjmOErFQvO2Wmfkj8DuVXzsvRqm_xfb8-7Oosx5oGVMVR3liXW5NZsRWes4TXXwsEou3qCyVy5fAhzm7rKjIk1zWv9vm0IOWMFwHHYTgEc_LTYWMovWtkuBx4ia546Q", "refresh_token": "dlIOQHHAmweyOrVkDlpNYpi1XM-DwX5Cgx70LoKIbTI" } ``` :::caution In most cases, you would make the app content available right after creating a new account. Hence, you should also generate and return the JWT token on the success of create account API and use it to login into the Firebase. ::: :::note If you want to try the JWT token authentication without creating an API endpoint right now, you can [**generate the JWT token locally**](#create-a-jwt-token-locally) for testing. ::: ### 2. Adding login page Let's add a sign-in page from the templates and choose the **Authenticate Solo Alt** from under the **Auth** tab. Tip: After adding, remove the other social sign-in buttons. ![login-page.avif](https://docs.flutterflow.io/assets/images/login-page-31990c9ba390dc2395477fa4ac808aa0.avif) ### 3. Add login action The login process involves two steps. First, you trigger an API call to your server. Upon successful call completion, you'll use the returned JWT token in the JWT Token action. Here are the step by step instructions: 1. Select the **Widget** (e.g., Sign In) on which you want to define the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Add the login api and provide the **Action Output Variable Name**. If the call succeeds, this will be used to retrieve the token. 4. Inside the **TRUE** section, click on the **+** button and select **Add Action**. 5. On the right side, search and select the **Log in** (under Firebase Authentication) action. 6. Set the **Auth Provider** to **JWT token**. 7. Now, you must provide the actual JWT token. To set the token from an API response: 1. Click on the **UNSET** and select the **Action Outputs -> Action Output Variable Name** (that you specified in the API call section.) 2. Set the **API Response Options** to **JSON Body** and **Available Options** to **JSON Path**. 3. Enter the **JSON Path** to locate the token in API response, such as `$.token,` and click **Confirm**. 8. (Optional) add the [snackbar action](https://docs.flutterflow.io/resources/ui/pages/scaffold#show-snackbar-action) to display the success message. 9. (Optional) Inside the **False** section, add the snackbar action to display the failure message.

### 4. Adding logout action To let users log out of your app, you can use the [Logout](https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions#logout-action) action. ### 5. Verify user creation To confirm the successful integration and the creation of users, navigate to your **Firebase project > Authentication > Users** and check the user entries. Tip: Notice the 'userid' (originally created by your server) is added inside the **User UID** column. ## Create a JWT token locally Sometimes you might want to build and test the JWT authentication before the login or create account API is ready. You can achieve this by creating the JWT token locally and passing it inside the [login action](#3-add-login-action). :::caution Use this method only for testing purposes. Ideally, you should be doing this on the server side. ::: Below are steps to create a JWT token locally using Node.js: 1. In the Firebase dashboard of your project, navigate to the far left menu. Select **Project Settings( )** -> **Service accounts**. 2. Select **Generate new private key**. This will open a new popup. Again, click **Generate key** and save the `.json` file in some folder. You will need it while generating the token. 3. Now, download and Install [node.js](https://nodejs.org/en/download/). 4. Open a terminal at the folder where you have saved the `.json` file and enter this command: `npm install firebase-admin`. This will install Firebase Admin SDK inside the folder. 5. In the same folder, create an `index.js` file and add the below content. ``` const admin = require('firebase-admin'); const ServiceAccount = require('./[YOUR_SERVICE_ACCOUNT_JSON_FILE_NAME].json'); admin.initializeApp({ credential: admin.credential.cert(ServiceAccount) }); const uid= 'userid1'; // This user id will be stored in Firebase. admin.auth().createCustomToken(uid) .then((customToken) => { console.log(customToken); }) .catch((error) => { console.log('Error creating custom token:', error); }); ``` 1. To run this `index.js` file inside the terminal (at the same location where this file is located), hit this command: `node index.js`. This will print the JWT token in the console. 2. Copy this JWT token, return to FlutterFlow Studio, and save it in the **app state variable** (String Datatype). 3. Open the JWT token action, click on **UNSET** (or a variable if you have already set it), and select the **App State -> variableName** (that holds the JWT token).

## Accessing Firebase Database Once you log in via the JWT token, the *Authenticated User* object is available. This object contains the fields (i.e., logged-in user's data), especially **User Reference (users ref),** that you may need to provide while adding or retrieving Firestore documents. Here's an example of how you can use the *Authenticated User* object to filter the to-do items based on the user who created it. ![access-firebase-database.avif](https://docs.flutterflow.io/assets/images/access-firebase-database-e3ec523d4100cb53d23d2452081eef3a.avif) ## Sending push notifications Once you log in via the JWT token, the *Authenticated User* object is available. This object contains the fields (i.e., logged-in user's data), especially **User Reference (users ref),** that you may need to provide while adding or retrieving Firestore documents. When such user reference is stored inside the Firestore documents, you can use them inside the **Single** or **Multiple Recipient** while defining the **Audience** inside the [Trigger Push Notification](https://docs.flutterflow.io/concepts/notifications/push-notifications#trigger-push-notification-action) action, as shown in the image below: ![send-push-notification-to-users-created-via-JWT-token.png](https://docs.flutterflow.io/assets/images/send-push-notification-to-users-created-via-JWT-token-ff46f39bfb7debb4b20811e130d309a4.png) To learn more about how to use user references for sending push notifications, please check the [push notification](https://docs.flutterflow.io/concepts/notifications/push-notifications) section. # GitHub Login > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/firebase/github Learn how to add GitHub authentication in your FlutterFlow Studio app. The GitHub auth provides a convenient way for users to authenticate and log in to your application using their GitHub accounts. ![github-demo.gif](https://docs.flutterflow.io/assets/images/github-demo-41380054c31b666044e4811ef9c1ffad.gif) :::note[Prerequisites] Before getting started with this section: - Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). - Complete [**Initial setup**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) required for authentication. ::: ## Adding GitHub auth Adding GitHub auth comprises of following steps: 1. [Enabling GitHub authentication in Firebase](#1-enabling-github-authentication-in-firebase) 2. [Adding GitHub login action](#2-adding-github-login-action) ### 1. Enabling GitHub Authentication in Firebase To enable GitHub authentication in the Firebase: 1. Open the [Firebase console](https://console.firebase.google.com/), Click on **Authentication** ( in the left side menu). 2. Select the **Sign-in method** tab, and select **GitHub**. If you have already added another provider, click on the **Add new provider**, select **GitHub**, and **Enable** it. 3. To get the **Client ID** and **Client Secret**, [register your app](https://github.com/settings/applications/new) as a developer application on GitHub, and while doing so, paste the authorization callback URL to your GitHub app configuration. 4. Click **Save**.

5. To test the app in Run Mode, add our domain to **Authorized domains**. ![adding-authorized-domain-2.png](https://docs.flutterflow.io/assets/images/adding-authorized-domain-2-ffe3326be53615349de80ceabb861d10.png) ### 2. Adding GitHub Login Action Follow the steps below to add GitHub login action: 1. Select the widget (e.g., Button) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside *Action Flow Editor*) and select **Add Action**. 3. Search and select the **Login** (under *Backend/Database > Firebase Authentication*) action. 4. Set **Auth Provider** to **GitHub**. ![adding-github-login-action.png](https://docs.flutterflow.io/assets/images/adding-github-login-action-3b533ba2182aeb6b1ef822f4c605aa3c.png) :::note To let users log out of your app, you can use the [**Logout**](https://docs.flutterflow.io/integrations/authentication/firebase/auth-actions#logout-action) action. ::: # Custom Authentication > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/custom-authentication Learn how to add custom authentication in your FlutterFlow Studio app. Custom authentication allows you to manage auth-related data (login details) while utilizing your own backend to authenticate users. :::tip[concepts] Understanding the concept of [**Token**](https://docs.flutterflow.io/integrations/authentication/tokens) is essential for grasping how secure access and user verification work in an application. ::: ## Adding custom authentication Let's see how to add custom authentication by building an example that looks like this:

The steps to add custom authentication are as follows: 1. [Enabling custom authentication](#1-enabling-custom-authentication) 2. [Building pages](#2-building-pages) 3. [Authenticate users](#3-authenticate-users) 4. [Save auth data](#4-save-auth-data) 5. [Access auth data](#5-access-auth-data) 6. [Update auth data](#6-update-auth-data) 7. [Logout](#7-logout) ### 1. Enabling custom authentication To enable custom authentication in FlutterFlow Studio: 1. Open **Setting and Integrations** () **>** **App Settings > Authentication**. 2. Turn on the **Enable Authentication** toggle and set **Authentication Type** to **Custom**. 3. To ensure that your users are directed to the appropriate pages based on their login status, you must set the initial pages. 4. By default, the **Persist Auth Sessions** option is enabled, which means users remain logged in until they actively log out. With this option enabled, your app will automatically open to the homepage whenever it's restarted. 5. After successful authentication, your backend typically sends login details like an authentication token, a refresh token, and user details. To keep the user logged in within your app, you must store this data. You can achieve this by enabling **Associate User Data Type** and setting **User Data Type** to the [Custom Data Type](https://docs.flutterflow.io/resources/data-representation/custom-data-types). **Note** that the structure of your Custom Data Type should closely resemble the structure of a successful authentication's JSON response. At the very least, it should include critical fields like the authentication token.

### 2. Building pages Let's add a page that allows users to create accounts and log in. To speed up, you can add a page from the template. Here is the page added from the templates, and after some modification, it looks the below: Also, see how to [build a page layout](https://docs.flutterflow.io/concepts/layouts) in case you want to build a page from scratch. ![auth-2-template.avif](https://docs.flutterflow.io/assets/images/auth-2-template-99e25264064ae6a07dac7abe7788f881.avif) ### 3. Authenticate users On each page, on click of a button, you can add appropriate authentication related [API calls](https://docs.flutterflow.io/resources/backend-logic/rest-api). For this example, we use [this](https://dummyjson.com/docs/auth).

### 4. Save auth data After successful authentication, you can save the auth related data using the 'Log in' action. Here's how you do it: 1. Inside the **TRUE** branch of the [previous API call](#3-authenticate-users), add the **Log in** (under *Backend/Database > Custom Authentication*) action. 2. Under the **User Auth Properties**, you can set values for **Authentication Token**, **Refresh Token**, **Token Expiry Time**, and **User UID**. **Note that for the 'Persist Auth Sessions' option to work, you must set the Authentication Token**. 3. **Set User Data** to store the result of the previous API call (i.e., auth details) in a Custom Data Type. See how to get the [JSON into Data Type](https://docs.flutterflow.io/resources/backend-logic/rest-api#json-to-data-type).

### 5. Access auth data To access the auth data after a user logs in, open the **set from variable** menu **> Authenticated User >** choose **from Auth Properties** or **User Data Fields**.

### 6. Update auth data You may want to update the auth data in situations like updating the access token with the new one after it has expired. You can do so using the **Update Authenticated User** action. Here's exactly how you do it: 1. Once you get the 401 status code, i.e., unauthorized user error, ensure to make an API call to renew the access token. 2. On getting the new access token, add a new action named **Update Authenticated User**. 3. Under the **User Auth Properties**, you can update a value for the **Authentication Token** with a new access token. ![update-auth-data.avif](https://docs.flutterflow.io/assets/images/update-auth-data-454adf49f58fd1bf0ee90a499bdcccee.avif) ### 7. Logout You can logout a user by adding the **Log Out** action. ![logout.avif](https://docs.flutterflow.io/assets/images/logout-2c596eacb8601f332f9a25c382850528.avif) # Tokens: Types and Lifespans > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/tokens Learn about the types and lifespans of tokens in custom authentication. Here are some key terms we'll encounter in [**Custom Authentication**](https://docs.flutterflow.io/integrations/authentication/custom-authentication). - **Authentication Token**: An Auth Token acts as a digital key provided to client apps upon successful login. This key verifies the user's identity for subsequent actions within the app, eliminating the need for repeated login prompts. It ensures secure and streamlined access to the app's features. - **Refresh Token**: This token functions as a secondary mechanism to renew the authentication token without requiring the user to re-enter login credentials. This is particularly useful for maintaining a user's session securely, even when the primary authentication token expires, enhancing both security and user experience. - **Token Expiry Time** : This refers to the lifespan of an authentication token. It defines the period during which the token remains valid. This is a critical security measure to prevent unauthorized access, ensuring that tokens are regularly refreshed and authenticated. Developers must save these values in the persisted app state to keep it secure. :::caution[Remember] Not all login APIs will return an Auth Token, Refresh Token, and Token Expiry Time. The details of the response depend on the configuration of your backend API. Always check your API documentation to understand what is returned upon successful authentication. :::
![login-request.png](https://docs.flutterflow.io/assets/images/login-request-3604fe8a80dae54fddb0ec5f4fdcfb4f.png)
1.1 An example of a Login API transaction that returns the above values in its response
### Example of Auth using Tokens For example, when a user logs in using a Login API, the server verifies the submitted credentials and typically responds with both an **Auth Token** and a **Refresh Token** (both strings). The authentication token is short-lived; for instance, it may be valid for 1 hour and is used to authenticate API requests (_as shown in diagram 1.1_). If you need to use the token, it is typically included in any authenticated API request, such as accessing a list of users available only to logged-in users. In this case, the app sends a request to the API with a header that includes an Authorization header containing the authentication token.
![token-success-request.png](https://docs.flutterflow.io/assets/images/token-success-request-6e28992f0e16301b69f5354a9a9330c1.png)
An example of an Authenticated API request that sends a Authorization Bearer Token that uses the saved Auth Token
After an hour, or as determined by the token's expiry time, the authentication token expires. Any attempt to access another post with the expired token will result in a 401 Unauthorized response. To retrieve a new token, a common practice involves the client app making a request to a specific endpoint, submitting the saved refresh token in the request body. The server then validates the refresh token and responds with a new authentication token. ![token-fail-request.png](https://docs.flutterflow.io/assets/images/token-fail-request-946120818dd871422ec0787c9a4e7e9e.png) Thanks to the refresh token, users can continue accessing the app without needing to log in again. This process enhances security by limiting the lifespan of each token while ensuring a seamless experience for the user. # Initial Setup > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup Learn how to perform the initial setup for Supabase Authentication in your FlutterFlow Studio app. To use authentication, you will need to complete the following initial setup: 1. [Creating a "users" table](#1-creating-a-users-table) 2. [Enabling authentication in FlutterFlow Studio](#2-enabling-authentication-in-flutterflow-studio) :::note[Prerequisites] Before you begin, make sure you have completed the [**Supabase Setup**](https://docs.flutterflow.io/integrations/supabase/setup). ::: ### 1. Creating a "users" table To use Supabase authentication, you'll need to create a table to store your users' data, such as their name, email, and profile picture. Also, it's recommended to create a [foreign key relationship](https://supabase.com/docs/guides/database/tables#joining-tables-with-foreign-keys) from the `id` column of your "users" table to the `id` column of the "users" table in auth (protected) schema, i.e., `auth.users.id` with `on delete cascade`. This ensures that when a user is deleted from the "auth.users" table, their corresponding data in your "users" table will also be removed. Here's how you do it:
:::note The "users" table in auth (protected) schema is a private table that Supabase uses to store auth-related sensitive information such as email, encrypted pass, and confirmation token. ![img.png](https://docs.flutterflow.io/assets/images/img-b181589c7111a788900a2fa263eafee3.png) ::: ### 2. Enabling authentication in FlutterFlow Studio To enable authentication in FlutterFlow Studio: 1. Open your FlutterFlow Studio project. 2. Navigate to the Setting and Integrations () from the Navigation Menu > App Settings > Authentication. 3. Turn on the **Enable Authentication** toggle and select **Authentication Type** to **Supabase**. 4. To ensure that your users are directed to the appropriate pages based on their login status, you must set the [initial pages](https://docs.flutterflow.io/resources/projects/settings/general-settings#initial-page). ![img_1.png](https://docs.flutterflow.io/assets/images/img_1-b7c8f0344e87b684233866df3d4144e5.png) # Authentication Actions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/supabase/auth-actions Learn how to add Supabase Authentication actions in your FlutterFlow Studio app. Currently FlutterFlow Studio supports the following Actions for Supabase Authentication: ## Log in [Action] This action provides users with multiple login options to access their accounts. Follow the steps below to add Email Login action: 1. Select the widget(e.g., Button) on which you want to add the action. 2. Select **Actions** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu) and click + **Add Action**. 3. Search and select the **Log in** (under *Backend/Database > Supabase Authentication*) action. 4. Set **Auth Provider** to **Email**. 5. Set the **Email Field** dropdown to the widget name that accepts email (e.g., *TextFieldEmail*). 6. Set the **Password Field** dropdown to the widget name that accepts a password (e.g., *TextFieldPassword*). ## Create Account [Action] By using this action, you can provide your users with the flexibility to create their accounts in different ways, according to their preferences. :::note As of now, we support creating accounts with Email/Password, Google and Apple auth providers. ::: Follow the steps below to add email signup action: 1. Select the widget(e.g., Button) on which you want to add the action. 2. Select **Actions** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu), **Open** the **Action Flow Editor,** and click + **Add Action**. 3. Search and select the **Create Account** (under *Backend/Database > Supabase Authentication*) action. 4. Set **Auth Provider** to **Email**. 5. Set the **Email** **Field** dropdown to the widget name that accepts email (e.g., *TextFieldEmail*). 6. Set the **Password Field** dropdown to the widget name that accepts a password (e.g., *TextFieldPassword*). 7. Similarly, If you have a confirm password field in your UI, set the **Confirm Password Field** to the appropriate one. ## Log out [Action] This action enables users to securely log out of their account and clear their session data from the app, which ensures that their account remains safe and secure. Follow the steps below to add this action: 1. Select the widget (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties Panel (the right menu), If it's the first action, click **+ Add Action** button. Otherwise, click the "**+**" button below the previous action tile (inside **Action Flow Editor**) and select **Add Action**. 3. Search and select the **Log Out** (under **Backend/Database > Supabase Authentication**) action. ![img_6.png](https://docs.flutterflow.io/assets/images/img_6-d59b94e106d404251a6053eb1e1ba61b.png) ## Send Reset Password Email [Action] This action allows users to reset their password by sending a reset link to their registered email address.

:::note[Prerequisites] To build the reset password functionality, you need to create the following two pages in your app: 1. **ForgotPassword Page**: This page allows users to enter their email address and request a password reset link. 2. **UpdatePassword Page**: This page allows users to set a new password after clicking on the reset link. ::: Here’s how you can add the Supabase reset password feature to your app: 1. On the **ForgotPassword Page**, add the **Send Reset Password Email** action and set the **Email Field** dropdown to the widget that accepts the user's email address. This action will send the reset password link to the provided email. 2. The reset link sent to the user will open the **UpdatePassword Page**. On that page, add the **Update Password** action and set the **Password Field** and **Confirm Password Field** to the respective input widgets. 3. Copy the route name of the **UpdatePassword Page** and paste it into the **Supabase Dashboard > Authentication > Email Templates > Reset Password > Source**. After **`"{{ .ConfirmationURL}}"`** add **`"/[here]"`** only if you're not using a [custom redirect URL](#use-custom-redirect-urls). If using a custom redirect URL, the confirmation URL will redirect directly to your specified path. 4. [Deploy your app to the web](https://docs.flutterflow.io/deployment/web-publishing). 5. Copy the URL of your deployed project and paste it into the **Supabase Dashboard > Authentication > URL Configuration > Site URL**. :::tip **For mobile**, you must set the **deep link URL** as the Site URL. To find this, navigate to **FlutterFlow Studio > Settings & Integrations > App Details > Routing & Deep Linking**, open the **URL Scheme** tooltip, and copy the URL. ![mobile-deeplink.avif](https://docs.flutterflow.io/assets/images/mobile-deeplink-6d0ca0a2b81a9f9f8e817e8992f66d80.avif) :::

### Use Custom Redirect URLs Instead of relying on the default `{{ .ConfirmationURL }}` path, you could optionally configure a **custom redirect URL** in Supabase. This option allows you to bypass the default setup and send users directly to a custom page in your app for resetting their password. To configure a custom redirect URL: 1. When adding the **Send Reset Password Email** action in FlutterFlow Studio, enter the **Redirect To** URL. For example `http://my-site.com/resetPassword`. 2. Whitelist this custom URL by navigating to **Supabase Dashboard > Authentication > URL Configuration > Redirect URL**, and click **Add URL** to include it. 3. Update the reset password template. Go to **Supabase Dashboard > Authentication > Email Templates > Reset Password > Source** and ensure only `{{ .ConfirmationURL }}` is present in the template (remove any appended route names).

## Delete User At present, we do not support deleting Supabase user action. However, you can refer to this community video for guidance on how to do so.
# Email Authentication > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/supabase/email Learn how to integrate Email Login of Supabase Auth into your FlutterFlow Studio app. Supabase email authentication is a secure and easy way to allow users to sign up and log in to your application using their email and password. :::note[Prerequisites] Before getting started with this section, ensure you have, 1. Completed all steps in the [**Supabase setup**](https://docs.flutterflow.io/integrations/supabase/setup) 2. Completed [**Initial setup**](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup) required for authentication. ::: ## Adding Email Authentication Let's see how to add a Supabase email authentication by building an example that looks like this:
The steps to add Supabase email authentication are as follows: ### Configure Email Authentication in Supabase Due to some Supabase auth behavior, you need to disable the email verification on the Supabase side. However, you can still add the email verification logic on your own in your app if you wish to. Here's how you disable email verification on the Supabase side: 1. In your Supabase project, navigate to **Authentication > Provider**. 2. Open the **Email** section and disable the **Confirm email** and **Secure email change**.
![img_2.png](https://docs.flutterflow.io/assets/images/img_2-c7a194a0116b8eb06cc80e5ab6bea181.png)
Disable email verification on the Supabase side
### Building pages Let's add a page that allows users to create accounts and log in. To speed up, you can add a page from the [template](https://docs.flutterflow.io/resources/ui/pages#create-page-from-template). Here is the page added from the templates, and after some modification, it looks the below: Also, see how to build a page layout in case you want to build a page from scratch. ![img_3.png](https://docs.flutterflow.io/assets/images/img_3-dd11fde15d52a4400a5f9616c6588301.png) ### Adding Create Account [Action] Now, you can proceed to add an account creation flow, which basically consists of three actions in the following order: 1. Supabase [Create Account Action](https://docs.flutterflow.io/integrations/authentication/supabase/auth-actions#create-account-action) 2. Supabase [Insert row action](https://docs.flutterflow.io/integrations/database/supabase/database-actions#insert-row-action) 3. [Navigate](https://docs.flutterflow.io/concepts/navigation/overview) action The first one creates an account in Supabase and adds an email and password in the "auth.users" table (i.e., *Protected schemas > schema auth*). However, this action does not create an entry in the "users" table you created [here](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup#1-creating-a-users-table). To do so, you need to add another action called Supabase *insert row* action with the user's details, such as email and profile_pic. Once the entry has been created, you can navigate to the home page using the navigate action. Here's how it looks:
### Adding Log In [Action] To allow users to log in with their credentials, you can use the [**Log In**](https://docs.flutterflow.io/integrations/authentication/supabase/auth-actions#log-in-action) action. ### Adding Logout [Action] To let users log out of your app, you can use the [**Log Out**](https://docs.flutterflow.io/integrations/authentication/supabase/auth-actions#log-out-action) action. ### Verify user creation To verify that you have successfully added the email authentication, you can come over to your Supabase project > Table Editor > select the "users" table and verify the user entries.
img_5.png
### What's next? Now that you have successfully added the Supabase email authentication in your app, you can access the logged-in user's details, such as email, user id, phone number, email verified, and JWT token via the **Set Variable menu > Authenticated User**. Here's an example of filtering the to-do list based on the logged-in user using the **Set Variable menu > Authenticated User > User ID** property.
# Google Login > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/supabase/google Learn how to integrate Google Login of Supabase Auth into your FlutterFlow Studio app. Google Authentication with Supabase offers a secure and convenient method for users to sign up and log in to your app using their Google accounts. :::note[Prerequisites] Before getting started with this section, ensure you have, 1. Completed all steps in the [**Supabase setup**](https://docs.flutterflow.io/integrations/supabase/setup) 2. Completed [**Initial setup**](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup) required for authentication. ::: ## Adding Google authentication Let's see how to add a Supabase Google authentication by building an example that looks like this:

The steps to add Supabase Google authentication are as follows: ### 1. Create and configure Google Cloud project To begin adding Google auth, you must first have an active [Google Cloud Platform](https://cloud.google.com/) account. You'll need to either set up a new project or use an existing one within this account. Here's how you do it: 1. If you haven't already, create a new project in [Google Cloud Console](https://console.cloud.google.com/).

2. If you haven't already, configure the [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent). This helps Google display a consent screen to the user, including a summary of your project and its policies and the requested scopes of access.

3. Now, you must create credentials so that your app can access Google data. To do so: 1. Head over to [credentials page](https://console.cloud.google.com/apis/credentials), click **+ CREATE CREDENTIALS** and select **OAuth client ID**. 2. Set **Application type** to **Web Application**. 3. Below, under the **Authorized redirect URIs**, click **+ ADD URI**. To get this URI, open your **Supbase project > Authentication > Providers**. Open the **Google** section, copy the **Callback URL**, and paste it here. 4. Click **CREATE**. 5. Copy the **Client ID** and **Client secret**; you'll need this in the next step.

4. For *Android*, you'll need to create a new credential with the **Application Type** set to **Android**. While creating, you'll need to provide the package name and [SHA-1 key](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup#generate-the-sha-1-key). **Note** that after your app goes live, you must replace the SHA-1 key with the [key from the Play Console](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup#getting-sha-keys-for-release-mode).

5. Similarly, create credential for *iOS* platform as well. **Note** that after your app goes live, you must specify the *App Store* and *Team ID*.

### 2. Configure Google auth in Supabase This step involes enabling Google login and providing the client IDs and secret in Supabase. Here's how you do it: 1. Head over to [Supabase project dashboard](https://supabase.com/dashboard/) **> Authentication > Providers**. 2. Open the **Google** section and turn on the **Enable Sign in with Google**. 3. Paste the **Client ID** and **Client secret** from the **Web** credential. 4. Paste the **Authorized Client IDs** from the **Android** credential. 5. Turn on the **Skip nonce checks** to support **iOS** platform.

6. Now, you must specify the redirect URL in [Supabase project dashboard](https://supabase.com/dashboard/) **> Authentication > URL Configuration**. It is the URL to which a user is sent after successful authentication. Here's how you do it for both web and mobile.

### 3. Enable Google auth in FlutterFlow Studio To enable Supabase Google auth in FlutterFlow Studio: 1. In FlutterFlow Studio, navigate to the **Setting and Integrations** **>** **App Settings > Authentication**. 2. Open the **Supabase Authentication** section and turn on the **Enable Google Authentication** toggle. 3. Paste the **iOS** and **Web Client ID** obtained in step 1.

### 4. Add a Google sign-in button To allow users to authenticate, you need a login page with a button. You can create your own or use the one from the widget template or page template. Here's how you can add the Google sign-in button from our page template:

### 5. Adding create account action Now, you can proceed to add an account creation flow, which basically consists of two actions in the following order: 1. Supabase create account action. Here's how you add it: 1. Select the widget (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on the **+ Add Action**. 4. Search and select the **Log in** (under *Backend/Database > Supabase Authentication*) action. 5. Set **Auth Provider** to **Google**. 2. Supabase [insert row action](https://docs.flutterflow.io/integrations/database/supabase/database-actions#insert-row-action) The first one creates an account in Supabase and adds the user details at *Supabase Dashboard > Authentication > Users*. However, this action does not create an entry in the "users" table you created [here](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup#1-creating-a-users-table). To do so, you need to add another action called Supabase *insert row* action with the user's details, such as email.

### 6. Adding login action When you click the Google sign-in button, it will trigger the 'Log In' action, prompting a Google sign-in popup for users to input their credentials. To add login action: 1. Select the widget (e.g., Button) on which you want to add the action. 2. Select **Actions** from the properties panel (the right menu) and select **Add Action**. 3. Search and select the **Log in** (under *Backend/Database > Supabase Authentication*) action. 4. Set **Auth Provider** to **Google**. ![Adding login action](https://docs.flutterflow.io/assets/images/adding-login-action-a46c475b4cd576832776c52a3c962132.avif) ### 7. Adding logout action To let users log out of your app, you can use [this](https://docs.flutterflow.io/integrations/authentication/supabase/auth-actions#log-out-action) action. ### 8. Preparing to test the app Currently, testing the Supabase Google login feature isn't possible in Run or Test modes due to certain restrictions. But, for web platform testing, you can publish your app with a subdomain using our [web publishing](https://docs.flutterflow.io/deployment/web-publishing) feature. You can test your app on a real device or emulator using FlutterFlow Studio’s Local Run. Follow the [Local Run documentation](https://docs.flutterflow.io/testing/local-run) and see [how to set up a physical device](https://docs.flutterflow.io/testing/local-run#setup-physical-device) to start testing. ### 9. Verify user creation To verify that you have successfully added the Google authentication, you can come over to your Supabase project > Authentication > Users and verify the user entries. ![Verify user creation](https://docs.flutterflow.io/assets/images/verify-user-creation-8226603473539212d9a93c67818fc86d.avif) # Apple Login > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/supabase/apple Learn how to integrate Apple Login of Supabase Auth into your FlutterFlow Studio app. Adding Apple Sign-In with Supabase offers a convenient, secure, and privacy-friendly way for users to sign up or log in to your app using their Apple ID. This guide will walk you through the steps necessary to integrate Apple login with Supabase, including configuring the necessary keys and settings in both Supabase and the Apple Developer Console.

:::note[Prerequisites] Before adding Apple Sign-In to your FlutterFlow Studio project, make sure you have: 1. Completed all steps in the [**Supabase setup**](https://docs.flutterflow.io/integrations/supabase/setup) 2. Completed [**Initial setup**](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup) required for authentication. 3. Created an [**Apple account**](https://account.apple.com/account). 4. An active [**Apple Developer Account**](https://developer.apple.com/programs/enroll/). Read more about the [**Apple Developer Program**](https://developer.apple.com/programs/) and how to sign up. ::: Adding Apple sign-in comprises of the following steps: ## Set Up in Apple Developer Console To set up Apple Sign-In, you need to configure a few settings in your Apple Developer Console. This includes setting up email communication to manage user privacy and enabling the Apple Sign-In capability for your App ID. ### Configure Email Communication "Apple sign-in" is a privacy-focused authentication system. One of its notable features is the ability to hide a user's real email address when signing up for apps and services. When users choose to hide their email, you get one random email address that forwards to the user's actual Apple ID email. This helps users keep their real email addresses private. ![hide-apple-email.avif](https://docs.flutterflow.io/assets/images/hide-apple-email-4797a25c79fdfa22556f73f4aaf20d91.avif) So, in order to contact such users, you must register email sources that your organization will use for communication. To register email sources, open the [**Services**](https://developer.apple.com/account/resources/services/list) (under [**Certificates, Identifiers & Profiles**](https://developer.apple.com/account/resources/certificates/list)) section in your Apple developer account, configure **Sign in with Apple for Email Communication**, add the email source, and complete the registration process.

### Enable Apple Sign-In Capability in your App ID To enable Apple sign-in for your app, open the [**Identifiers**](https://developer.apple.com/account/resources/identifiers/list) section in your Apple developer account, select your existing **App ID**, enable **Sign In with Apple**, and click **Save**. :::tip If you haven't created an App ID yet, follow the instructions provided by Apple to [**register an App ID**](https://developer.apple.com/help/account/manage-identifiers/register-an-app-id/). :::

## Configure Apple Auth in Supabase To enable and configure Apple authentication in your Supabase project, open the [Supabase dashboard](https://supabase.com/dashboard/project/_/auth/providers), select your project, enable **Sign in with Apple** under the **Apple** section, enter the **Client ID** and **Secret Key**, and click **Save**. :::tip To obtain the secret key, use the tool provided under [**Configuration section**](https://supabase.com/docs/guides/auth/social-login/auth-apple?queryGroups=platform&platform=flutter#flutter-configuration-web). ![get-secret-key.avif](https://docs.flutterflow.io/assets/images/get-secret-key-2f2a50880520c81cecf2784e729c7493.avif) :::

## Enable Apple Auth in FlutterFlow Studio To enable Supabase Apple authentication in FlutterFlow Studio, go to **Settings and Integrations** > **Supabase** > **Supabase Authentication**, and toggle on **Enable Apple Authentication**. ![enable-apple-auth-flutterflow.avif](https://docs.flutterflow.io/assets/images/enable-apple-auth-flutterflow-1746e0bf61acaaef283ec81baaf789bb.avif) ## Create Account [Action] Now, proceed to add an account creation flow, which consists of the following two actions: 1. **Create Account Action**: Add the **Create Account** action (under Supabase Authentication). This will create an account in Supabase and add the user details to **Supabase Dashboard > Authentication > Users**. 2. [**Insert Row Action**](https://docs.flutterflow.io/integrations/database/supabase/database-actions#insert-row-action): The previous action does not automatically create an entry in the public "users" table you created [here](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup#1-creating-a-users-table). To do this, add a **Supabase Insert Row** action, to log the user's details, such as their email. ![create-account.avif](https://docs.flutterflow.io/assets/images/create-account-2fc4d2bda51572603955b581ef39054f.avif) ## Login [Action] To enable user login, add the **Log In** action (under Supabase Authentication). When users click on the sign-in button, they will be prompted to log in with their Apple credentials. ![login.avif](https://docs.flutterflow.io/assets/images/login-c58aab763a4eb1ce27d983109cc300d9.avif) ## Logout [Action] To let users log out of your app, you can use [this](https://docs.flutterflow.io/integrations/authentication/supabase/auth-actions#log-out-action) action. ## Prepare to Test To test your app on a real device, you must configure the project in Xcode. This includes adding a team to your project and setting an appropriate signing certificate. Here's how you configure your project in Xcode: 1. From the Local Run, [open your project in Xcode](https://docs.flutterflow.io/testing/local-run#access-project-code). :::tip If you are using Android Studio, right-click on the **ios** folder, find **Flutter,** and then click on the **Open iOS module in Xcode**. ::: 2. In Xcode, click on **Runner** (left side menu) and then select the **Signing and Capabilities** tab. 3. We recommend choosing the **Automatically manage signing** option. This will auto-create the profiles, app ID, and certificates required to build and run your app. If you don't, you'll have to [manually create a 'provisioning profile'](https://blog.codemagic.io/distributing-native-ios-sdk-with-flutter-module-using-codemagic/) and then add it in the Xcode. 4. Under the **Signing** section, find the **Team** dropdown and select your team. 5. Now use [Local Run](https://docs.flutterflow.io/testing/local-run) to test the app on a real device.

## Verify User Creation To verify that you have successfully added the Apple authentication, you can come over to your **Supabase project > Authentication > Users** and verify the user entries. Also, verify entries in your public `users` table. ![user-entries-in-supabase-auth](https://docs.flutterflow.io/assets/images/user-entries-in-supabase-auth-37198d7578c002efde7b523278ed7e3b.avif) # Authentication: Generated Code > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/authentication/generated-code Learn about the generated code behind enabling authentication in FlutterFlow Studio. In FlutterFlow Studio, enabling Authentication is a very simple task. You can check the documentation for the same here but ideally it is just enabling Authentication in Settings, choose your Authentication Type and adding an Action to your desired Auth button. But behind the scenes, a lot of code generation happens to enable this function for you, lets go through it one by one. We will first discuss the base authentication architecture and then discuss the code changes when we choose custom authentication vs Firebase/Supabase auth. ## File structure When we enable Authentication in the Settings dashboard, it creates the following folders in our file structure to manage custom authentication. ``` lib/ auth/ custom_auth/ auth_util.dart custom_auth_manager.dart custom_auth_user_provider.dart ``` Similarly, when we enable say Firebase authentication, the following files and folders are generated for you. ``` lib/ auth/ firebase_auth/ auth_util.dart email_auth.dart (along with other providers) firebase_auth_manager.dart firebase_user_provider.dart auth_manager.dart base_auth_user_provider.dart ``` :::note This documentation is exclusively focused on the generated code for Custom Authentication. For instructions on integrating custom authentication into your FlutterFlow Studio app, please refer here. ::: # Custom Auth Manager The most crucial component of our generated authentication system is the ``CustomAuthManager`` class. It is responsible for managing authentication session attributes such as the ``authenticationToken``, ``refreshToken``, ``tokenExpiration``, and user-specific attributes like `uid` and `userData`. This class provides essential functionalities including: `signIn()`: Handles user sign-in processes. `signOut()`: Manages user sign-out actions. `updateAuthUserData()`: Updates authentication and user data. `persistAuthData()`: Persists authentication data across sessions for persistent login capabilities. In addition to the `CustomAuthManager`, we have another important file in our authentication framework: `custom_auth_user_provider.dart. ` This file defines a class, ``AuthUser``, to encapsulate the state of an authenticated user. It leverages BehaviorSubject from the [rxdart](https://pub.dev/packages/rxdart) package to manage a stream of the user object, enabling real-time updates to the user's authentication state. This stream is initially set with a user object that indicates a logged-out state. Subsequent authentication actions will update this stream, enabling real-time adjustments to any part of the application that depends on the user's authentication status. Building on our authentication framework, the `custom_auth_manager.dart` file brings in the currentUser variable, an instance of the ``AuthUser`` class. This global reference allows for quick and centralized access to the currently signed-in user's information, enabling access to their authentication state across the application. The `loggedIn` property further simplifies verifying if a user is logged in by checking the currentUser's status. ## Auth Manager Initialization Then, we have the auth_util file, which contains a singleton instance of `CustomAuthManager` ``` final _authManager = CustomAuthManager(); CustomAuthManager get authManager => _authManager; ``` The `authManager.initialize()` is called in `main()` before runApp is executed. The `initialize()` method creates an instance of SharedPreferences, preparing it for `authToken`, `refreshToken`, etc, and also handles the logic for token expiration, including the automatic logout when these tokens expire. :::note Also note that this initialization occurs only because the 'Persist Auth Sessions' option has been enabled in the Custom Authentication Settings. Alt text for the image ::: This file also offers easy-to-use getters for essential information such as the user's ID, login token, and other data. This setup simplifies the process of accessing and managing login details throughout your app. ## Log in Implementation When the Log In action is activated by tapping a button, we initiate a series of operations behind the scenes to ensure a smooth login process. Upon calling the signIn method, it triggers the `_updateCurrentUser` method from `CustomAuthManager` internally. This method receives various parameters such as `authenticationToken`, `refreshToken`, `tokenExpiration`, `authUid`, and `userData`, updating the CustomAuthManager class's properties with these details. Consequently, this stores the current session's authentication and user information effectively. :::note To learn more about the concepts of Authentication Token, Refresh Token, and Token Expiry Time, please refer the [Concepts](https://docs.flutterflow.io/integrations/authentication/tokens) doc. ::: A new user object, marked as logged in (`loggedIn` set to true), along with the provided `authUid` and `userData`, is then added to the user object stream mentioned earlier. This update informs all the stream's subscribers about the changed user state, signaling that the user has successfully logged in. Additionally, the `persistAuthData` method is invoked to save the updated authentication details (tokens, expiration, user ID, etc.) for future sessions. After signing in, `context.goNamedAuth('AuthPage', context.mounted);` is called that navigates the user to the Logged In Page specified in FlutterFlow Studio's Authentication Settings. # Cloud Firestore > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started Learn how to get started with Cloud Firestore in your FlutterFlow Studio app to manage your app's data. [Firestore Database](https://firebase.google.com/docs/firestore) is a product from Google's [Firebase](https://firebase.google.com/). It's a flexible, scalable, NoSQL cloud database. It allows you to store your app data and uses real-time listeners to keep the data in sync. Let's understand the Firestore database (Cloud Firestore, a NoSQL Database) in more detail. ## What is a NoSQL Database The NoSQL database is a schema-less database. That means the data is NOT stored in the table format. You actually don't have any restrictions on how you store your data. The Firestore database uses the collection-document model to store the data. Key terms to remember: * **Collection:** A collection is simply a set of 'documents.' * **Document:** A document is a record that contains the 'fields.' * **Fields:** The key-value pairs inside the document are called 'fields.' e.g., name, place, age, etc. To better understand, see the figure below:
![img.png](https://docs.flutterflow.io/assets/images/img_20-f99f4388b62b57262c21368ac5281a0c.png)
Collection document model
Every user's information is kept in a unique document. Multiple of these documents come together to form a collection. The beauty of this system is that not all documents within a collection need to have identical fields. So, if you decide to add a new field (e.g., DOB, image) to a new document, there's no need to go back and add it to older ones. --- ## Structuring the Database To see how to structure the database, consider an example that allows users to comment on a post. With FlutterFlow Studio, you can structure the database in the following ways: * [Top-level collections](#top-level-collections) * [Subcollections within documents](#subcollections-within-documents) ### Top-level collections In Top-level collections, multiple collections are created at the root level of your database. For example, you create collections such as 'comments' and 'posts' at the root level. Comments for all the posts are stored in a single top-level collection. To know which comment belongs to which post, you include additional reference fields that distinctly identify each post within this structure.
![img_1.png](https://docs.flutterflow.io/assets/images/img_1-7304390dcb8f4f7d5971a1ed1d6c13f1.png)
Top-level collection
:::tip[Pro Tip] Use top-level collections when you often search or filter within one collection without depending on another. For instance, if you want to see all comments, regardless of their related post (i.e., showing comments with the most likes). ::: ### Subcollections within documents Collections are created inside the document. Such a collection is called subcollection. For example, you create the top-level collection, such as posts, and then create a 'comments' collection (as a subcollection) inside the 'posts' collection. The advantage? You don't need extra tags or reference fields to know which post a comment belongs to; it's already grouped right there.
![img_2.png](https://docs.flutterflow.io/assets/images/img_2-5a73a7fd54b5b0550b9fe0617341145c.png)
Subcollections
:::tip[Pro Tip] Subcollection is best when you have several queries or filters or search on a collection that is based on the other collection. For example, loading or searching the comments of a specific post (i.e., show all comments of a specific post that have more likes.) ::: :::note You can secure the data using the [**Firestore Rules**](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules). ::: --- :::tip[Learn more] [**MongoDB**](https://www.mongodb.com/), [**Cassandra**](https://cassandra.apache.org/_/index.html), and [**ElasticSearch**](https://www.elastic.co/) are the other No-SQL database solutions that exist in the market. If you are a visual learner, you can check out the video:
::: ## Manage Databases You can also create multiple Firestore databases within a single Firebase project. This is especially useful for enterprise use cases, for example, when managing region-based databases or supporting multiple clients with isolated data stores. Additionally, you can use multiple databases to simulate different environments such as development, staging, and production. **However, note that** this setup is not directly related to the [Development Environments](https://docs.flutterflow.io/testing/dev-environments) in FlutterFlow Studio, which operates independently of Firebase's multi-database configuration. This means that you’ll need to manually switch Firestore Database ID when switching Development Environments. To create a new database, go to the **Firebase Console > Firestore Database** section. Click the button next to the default database, i.e, **Add database**. Choose a region and configure your security rules. Once the new database is created, you can switch between databases using the dropdown. Next, copy the new **Database ID** and navigate to **FlutterFlow Studio > Settings and Integrations > Firebase > Advanced Settings**. Paste the ID into the **Firestore Database ID** input field. Finally, regenerate the config file. Your app will now use the newly created database.

# Firestore Rules > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules Learn how to deploy Firestore rules in your FlutterFlow Studio app to manage data access and security. Firestore security rules are essential in safeguarding your Firebase data from potential malicious users. These rules not only enhance security but also give you control over data access within your application. With Firestore rules, you can enforce restrictions, ensuring that only authorized users can interact with specific data. For instance, you can configure Firestore rules to permit appointment creation only for authenticated users, such as those who have signed in via Email, Google Sign-in, or other authenticated methods. :::tip If you are brand new to Firestore rules, check out this overview about [**Getting Started With Firestore Rules**](https://firebase.google.com/docs/firestore/security/get-started). ::: ## Creating Firestore Rules There are two ways you can set the Firestore Rules: 1. [Using FlutterFlow Studio Firestore setting](#1-using-flutterflow-studio-firestore-settings) 2. [Using Firestore Database Console](#2-using-firestore-database-console) ### 1. Using FlutterFlow Studio Firestore Settings To set up basic rules, you can use the *Firestore Setting* available right inside FlutterFlow Studio. #### Overview of Firestore Rules inside of FlutterFlow Studio You can control the following operations that can be performed on a document: * **Create:** Allow users to create a new document inside the collection. * **Read:** Allow users to read documents inside the collection. * **Write:** Allow users to update a document of a collection. * **Delete:** Allow users to delete a document of a collection.
![img_3.png](https://docs.flutterflow.io/assets/images/img_3-d37f2952bba1f6a6e4703b836f2ed6de.png)
Default Rules
We provide various levels of access control that allow you to define user permissions for data access: * **Everyone**: This grants access to all users, whether authenticated or unauthenticated, allowing them to create, read, write, and delete documents. * **Authenticated Users**: Access is limited to authenticated users only, such as those who have signed in through Email, Google Sign-in, etc. Any user logged into the app can now create, read, write, and delete documents. * **Tagged Users**: Allow users to read/update/delete a document if they are tagged in that document. For example, say there is a "posts" collection with a `created_by` field representing the user who created the post. Then the "Tagged User" rule can be set on the `created_by` field to only allow accessing (read/update/delete) the post if the logged-in user is the one who created it.
![img_4.png](https://docs.flutterflow.io/assets/images/img_4-f33dd4a3f82494821ec3d9f33f715b3b.png)
* **Users Collection**: Allow users whose authentication id is the same as the id of a document. Tip: This option is only applicable to a 'users' collection. * **No One**: No one is allowed to create/read/write/delete a document. :::caution[Note] For 'Tagged Users,' the document must contain a field that can either be a reference to the user or a string with the user id. ::: #### Default rules applied to new collections When you create a new collection inside the [Firestore Content Manager](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-content-manager), below are the default rules applied to the collection: * **Create -> Everyone**: All users can create a document. * **Read -> Everyone**: All users can read documents. * **Write -> No One**: No one can update a document. * **Delete -> No One**: No one can delete a document.
![img_5.png](https://docs.flutterflow.io/assets/images/img_5-ee72ce8c6324bb4bfe724e501a717e5e.png)
Default Rules
The default rule is suitable while you are getting started, but before the app goes live, please think about limiting access to any collections that potentially include the user's private information. To help you with that, we mark it as 'Has Private Data'. This will show you a warning to update the rule and restrict access. For example, a newly created 'notes' collection allows everyone to read all notes by default. In reality, only the user who created it should be able to read it. But because we have marked it as '**Has Private Data**' it will show a warning like the one below, and you can modify the rules that allow only a user to read notes who created it.
![img_6.png](https://docs.flutterflow.io/assets/images/img_6-c019fedd01873bec231fb5140062f695.png)
Firestore Warning
If you want more control over a specific collection, you can remove the FlutterFlow Studio generated rule by checking the **Exclude** option. And then, you can set up advanced or custom security rules using the Firestore Database console. :::note To bring the rules into effect, you must deploy them. Click the **Deploy** button from here, and you will see the deployed rules at **Firebase Console > Firebase Database > Rules.** ::: When a user is deleted from your app, you might want to delete all records and data associated with that user as well. To do so, first set the 'Tagged Users' for the delete rule, and then check the () option.
#### Example: How to use Firestore Rules? Let's take an example to set up the rules on a *todos* collection for the following requirements: * Only authenticated users should be able to create a Todo item. * All users (authenticated/unauthenticated) can see all the Todo items. * Only a user who created the Todo item can update it. * No one can delete a Todo item. To set up the Firestore Rules for the above requirements: 1. Inside the **Firestore Rules** section, set the **Create** to **Authenticated Users**. 2. Set the **Read** to **Everyone**. 3. Set the **Write** to **Tagged Users**. This will open a popup named **Tag Users**. 2. Inside the dropdown, click on **Unset** and select the field that contains either user reference or user id. 5. Click **Save Changes**. 4. Set the **Delete** to **No One**. 5. Now you can [deploy](#deploy) the rules. :::caution The rules set in the above examples are for simplification purposes. You should carefully understand your requirements and set the rules accordingly. :::
### 2. Using Firestore Database Console To set up more advanced or custom rules you can use the Firebase Cloud Firestore Console. Let's take an example to set up the rules on a *todos* collection for the following requirements: * To create a Todo item, a user must be authenticated and verified via email or phone, and it must be a valid Todo item. * All users (authenticated/unauthenticated) can see all the Todo items. * Only a user who created the Todo item can update it with valid Todo details. * Only a user who created the Todo item can delete it. To set up the Firestore Rules for the above requirements: 1. Open the Firebase console of your project, and click on the **Firestore Database** in the left side menu. 2. Select the **Rules** tab. 3. Paste the following code and click on **Publish**. ``` rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { // 1. function isSignedIn() { return request.auth != null; } // 2. function verified() { return request.auth.token.email_verified || request.auth.token.phone_number; } // 3. function isValidItem() { return request.resource.data.name.size() > 0 ; } match /todos/{document} { // 4. allow create: if isSignedIn() && verified() && isValidItem(); // 5. allow read: if true; // 6. allow write: if isValidItem() && resource.data.created_by == /databases/$(database)/documents/users/$(request.auth.uid); // 7. allow delete: if resource.data.created_by == /databases/$(database)/documents/users/$(request.auth.uid); } match /users/{document} { allow create: if request.auth.uid == document; allow read: if true; allow write: if request.auth.uid == document; allow delete: if false; } match /{document=**} { allow read, write: if request.time < timestamp.date(2022, 3, 4); } } } ``` Here’s a quick rundown of what’s going on in the code above: 1. **isSignedIn()**: This checks whether a user is authenticated. 2. **verified()**: This checks whether the user is verified via email or phone. 3. **isValidItem()**: This checks whether the Todo item is not empty. 4. **create**: Allow to create a Todo item only if a user is authenticated, verified, and created a valid Todo item. 5. **read**: Allow all users to see all Todo items. 6. **write**: Allow to update a Todo item with valid details to a user who created it. 7. **delete**: Allow to delete a Todo item to a user who created it.
## Deploy To deploy the Firestore Rules, simply hit the **Deploy** button. Before you finally deploy the new rules, a popup asks you to review your changes. Here, you can check the difference between the before and after versions of the Firestone Rules and then click **Deploy Now**. :::caution * You must deploy rules every time you make a change. * Before publishing your app, ensure you remove default Firestore rules, such as 'allow read, write: if request.time < timestamp.date(2024, 5, 31);' and exit Test mode. ::: ![img_7.png](https://docs.flutterflow.io/assets/images/img_7-4144c7e2f496368e69e93a72ba51232a.png) ## Reverting to previous rules You can go back to the previous rule state with Firebase Cloud Firestore Console: 1. Open the Firebase console of your project, and click on the **Firestore Database** in the left side menu. 2. Select the **Rules** tab. 3. Select and copy the previous rule from the left-side menu. 4. Select the current rule from the left side menu and paste the previous rule. 5. Click on **Publish**. :::tip[Learn More] Learn more about [**creating custom Firestore Rules**](https://fireship.io/snippets/firestore-rules-recipes/). ::: ## FAQs
Getting an error, "cloud resource location is not set," "It looks like you haven't used Cloud Firestore in this project before" or a red alert while deploying rules. **Error-1** ![img_8.png](https://docs.flutterflow.io/assets/images/img_8-7fe4c5fe4e410c57b16c0be27e9317e9.png) **Error-2** ![img_9.png](https://docs.flutterflow.io/assets/images/img_9-f9906f201f4bb7c03f4b000e3e997a37.png) If you encounter such issues, the 'Default GCP resource location" is probably not set in your Firebase project. To fix this issue: 1. First, ensure that you have [**configured the Cloud Firestore**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#enable-firestore-for-database-access) 2. And then, head over to the second link (from the error) and set the GCP resource location.
![img_10.png](https://docs.flutterflow.io/assets/images/img_10-acdc9f00cd36548d0ee86e3dbd5bf3d5.png)
Highlighted Link
![img_11.png](https://docs.flutterflow.io/assets/images/img_11-c9169a52d249792339aea6654fc71d6f.png)
Set the link to Firebase Console > General Settings > Default GCP Resource Location
# Creating Collections > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections Learn how to create collections in Firestore for your FlutterFlow Studio app, including organizing documents within collections. A collection is a group of documents. For example, you could have a 'users*'* collection that contains a list of documents, each representing a single user.
img_20.png
User collection document model
:::note[Getting Started: Things to Know First] - Get to know how to [**structure the Firebase Database**](https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started#structuring-the-database). - Ensure you've gone through and completed every step in the [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for your project. ::: ## Creating a collection Here are the steps to create a collection: 1. Click on the **Firestore** from the Navigation Menu (left side of your screen). 2. Click on the **(+)** Plus sign button. 3. A popup will appear, Enter the collection name and click **Create** Button. 4. Next, [define the collection schema](#define-schema-creating-fields) (create Fields) and [add some data](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-actions#create-document-action) to the collection. :::note A collection will only appear on [**Firebase Console**](https://console.firebase.google.com/u/0/) if it contains at least one document. :::
### Define Schema (Creating Fields) A document represents a single item or entity, such as a user, post, animal, etc. To add data inside the document, you must define the document schema by creating Fields. Creating Fields helps you know what kind of data a document can contain. Although you can add more fields later on, it's always a good idea to add fields from the start. :::caution Field names cannot be changed, so ensure that you have used the correct Field names. ::: To define the schema (create fields) for the document: 1. Select your collection from the list on the left side. 2. If you haven't added any fields yet: 1. You can choose from the template collections that have common fields needed in most applications. This will auto-add all the fields. 5. Click on **Start from scratch** to define your own schema. 8. Or, use [AI Gen Schema](#create-schema-using-ai-gen). 3. To add a new field, start typing its name (e.g., title, description, date, etc.) and choose the suitable **Data Type**. 4. While choosing the Data Type, you can set if it will be a list or not using **Is List?** toggle. 1. You can keep it disabled for storing only a single value. For example, fields such as title, description, price, etc., can have only one value. You can't have multiple titles for a single post. 2. You can enable it to store multiple values of the same data type. For example, to store the list of accessory names for the field accessories. 5. Click on the **Done** icon. :::tip You can also use *Tab* and *Enter* keys to navigate quickly while creating fields. :::
### Create schema using AI Gen With **AI Gen Schema**, you can automatically generate a schema for your Firebase collection from a simple prompt. :::tip[To get better results...] ...you can try optimizing your prompt. i.e., make it more descriptive. ::: Example prompts: - Generate a collection for books, their reviews, and their purchase history. - Create a database schema for music albums, their ratings, and sales records. - Generate a collection for video games, their user reviews, and purchase history. - Create a collection for art exhibits, visitor reviews, and ticket bookings. - Generate a collection for online courses, student feedback, and enrollment records.
--- :::note To learn more about custom data types within FlutterFlow Studio, [check this doc](https://docs.flutterflow.io/resources/data-representation/data-types#built-in-data-types) # Creating Subcollections > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-subcollections Learn how to create subcollections in Firestore for your FlutterFlow Studio app, including organizing documents within subcollections. [Collections](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections) that are created inside the document are called subcollections. For example, you could have a 'comments' subcollection inside the 'posts' collection to store a post's comments. Subcollection is best when you have several queries/filters or search on a collection based on the other collection. For example, loading or searching the comments of a specific post. (i.e., show all comments of a post with more likes.) :::caution[Feature Completion] At this time, FlutterFlow Studio supports one level of nesting (e.g., collection -> subcollection). Second-level nesting is not currently supported ( e.g., collection -> subcollection 1 -> subcollection 2.) ::: ![img_21.png](https://docs.flutterflow.io/assets/images/img_21-eb0073a7794e33e857bb128f3b57d8f4.png) :::note[Getting Started: Things to Know First] - Get to know how to [**structure the Firebase Database**](https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started#structuring-the-database). - Ensure you've gone through and completed every step in the [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for your project. ::: ## Working with subcollections In this section, you'll learn to work with subcollections by building an example that allows you to see all messages and post a new message in a chat room (example below). :::tip[Here are a few tips on how subcollections work in FlutterFlow Studio:] * You can create a subcollection document under an existing reference if there is a subcollection defined. * You can either specify the reference to query a subcollection (UserA -> favorites) or can do a “collectionGroup” query across all subcollections (all Users -> Favorites) by not specifying the reference. ::: Before we begin, we need to identify the collections and define the database structure. So looking at the requirements, it's very clear that we'll need two collections. One for storing chat room details and another for storing its messages. And we need to display the messages only for a specific chat room. So, having the message collection as a subcollection of the chat rooms seems to be a good option. Here's what the database structure looks like: ![img_22.png](https://docs.flutterflow.io/assets/images/img_22-9f9568a94eb866b20899d864891eab8e.png) Building the chat room example comprises the following steps: 1. [Creating a collection](#1-creating-a-collection) 2. [Creating a subcollection](#2-creating-a-subcollection) 3. [Add data to the collection](#3-add-data-to-the-collection) 4. [Building chat room listing page](#4-building-chat-room-listing-page) 5. [Building messages page](#5-building-messages-page) ### 1. Creating a collection [**Create the collection**](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections) called *chat_rooms*. This will be used to hold the chat room details. While defining the schema for *chat_rooms* collection, add the fields to display its name, i.e., *chat_room_name.* ![img_23.png](https://docs.flutterflow.io/assets/images/img_23-0ab98eb05f49d1d28f073680489f1c7f.png) ### 2. Creating a subcollection To create the subcollection: 1. Click on the **Firestore** from the Navigation Menu (left side of your screen). 2. Click on the **(+)** Plus sign button. 3. A popup will appear; enter the collection name as '*messages.'* 4. **Turn on** the **Is Subcollection** toggle. 5. The dropdown list with existing collections will appear. Click on the **Unset** and select the parent collection, *chat_rooms* in this case. 6. Click **Create** Button. 7. Next, [define the document schema](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections#define-schema-creating-fields). While defining the schema for the 'messages' subcollection, add the fields such as *message* (to store the message body) and *from* (to store the sender name).

### 3. Add data to the collection Add some default chat room details using [Firestore Content Manager](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-content-manager).

### 4. Building chat room listing page The first page shows the chat room listing, and when you tap, it opens the new page and shows all messages. The steps to build the chat room page are as follows: 1. Query the **chat_rooms** collection and display the chat room names in a ListTile (inside ListView). 2. Add the **[Navigate To](https://docs.flutterflow.io/concepts/navigation/overview#navigation-actions)** action **on Tap** of the **ListTile** and open the messages page. **Note**: While navigating, pass the chat room record to the next page. Learn how to [pass data to the next page](https://docs.flutterflow.io/concepts/navigation/passing-data). .

### 5. Building messages page The next page shows all the messages and allows you to send messages in the chat room. The steps to build the chat room page are as follows: 1. Use the **ListView**, **ListTile**, **TextField**, and **Button** widgets to design a page that looks like the below: ![img_24.png](https://docs.flutterflow.io/assets/images/img_24-ca68c3f4b34738abbe7ff5dda39534c5.png) 2. On the ListView, query a subcollection as you would query any other collection; except for the subcollection, you must provide its parent collection reference (i.e., chat_rooms reference in this case). This way, you'll only see messages from that specific chat room.

3. On tap of 'Send' button, add the [create document](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-actions#create-document-action) action for `messages` collection and provide current `chat_rooms` reference. Also, provide the message to add via **From Variable > Widget State > [TextFieldName]**.

# Firestore Content Manager > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-content-manager Learn how to use the Firestore Content Manager in your FlutterFlow Studio app to manage Firestore data efficiently. The Firestore Content Manager provides an easy way to visually create, edit, and add documents to your [**Firestore database**](https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started). :::note Subcollections are not supported in Content Manager at this time. ::: :::note[Prerequisites] Before getting started with this section, ensure you: 1. Become familiar with [**Structuring the Firebase Database**](https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started#structuring-the-database). 2. Completed all steps in the [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase). 3. Create a [**Collection**](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections). 4. [**Defined the Fields**](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections#define-schema-creating-fields) for the collection. Only fields defined in your Firebase schema are shown in the Firebase Content Manager. ::: ## Adding Document Before you add a new document to the collection, make sure you have some Fields added. For instance, the 'exam_result' collection with basic fields looks like this:
![img_12.png](https://docs.flutterflow.io/assets/images/img_12-97c5c5ba66602e35e36bf86d8b9995f8.png)
'exam_result' collection
To add a document: 1. Head to the **Firestore** (left side Navigation Menu) and click **Manage Content**. This will open up a new browser window. 2. Select the **Collection** to which you want to add a document and then select + **Add Document.** A popup will appear. 3. Enter the information for the record and click **Add Document**. :::caution If you get this error "**Could not create an account as firebase@flutterflow.io to your Firebase project**", just enable the '[**Email Sign-In**](https://docs.flutterflow.io/integrations/authentication/firebase/email-login)' in your Firebase project. ![img_13.png](https://docs.flutterflow.io/assets/images/img_13-252de78599d465db3bb3b5ca1d49aa86.png) :::
### Upload CSV file for bulk addition You might want to migrate your data from somewhere else to the collection of your current project. Adding an extensive list of records one by one is an incredibly time-consuming process. If you can get or already have data in a CSV (comma-separated values) file, we allow uploading the CSV file, and your data will be loaded into the collection in just a few steps. :::note To successfully upload the data: * Ensure you have header rows in your CSV file. The header should contain the exact name of the fields you have in your collection. * If you are uploading lat-long data, make sure you format it like (lat, lng) or [lat,lng]. * Dates must be in a format like YYYY-MM-DD HH:MM:SS, where hours should be in 24hrs format (e.g., 2022-11-07 13:05:32). ::: To better understand, here is the sample places collection and CSV file: ![img_14.png](https://docs.flutterflow.io/assets/images/img_14-1e462d868d3005b30aec2e5572e00be7.png) **_places.csv_** ``` name,location,last_updated Central,"(40.76835069123224, -73.97203144014624)",2022-11-07 13:05:32 Museum,"(40.8217031079394, -73.9256367137398)",2022-11-09 16:12:02 Zoo,"(40.85452267684994, -73.8774290321384)",2022-11-04 03:05:54 ``` Here's how you upload the CSV file: 1. Select the **Collection** and click the **Upload CSV** button (see top right side). A popup will open. 2. Click **Select File** and upload your CSV file. 3. Now, you can choose the **Separator Type** and enter the **Number of Rows to Upload**. If you leave this empty, all records will be imported. 4. Click **Upload CSV** button. 5. Once the file is uploaded, you'll see the preview of data with field name and its data type. 6. Click **Validate & Import**. If everything looks good, this will import the data and you can **Finish and Close**. If there is any issue with data type mismatch or formatting issue, you'll see a message like this:
![img_15.png](https://docs.flutterflow.io/assets/images/img_15-7583d2accfff425dc4bf8a3f2d8ab94d.png)
Formatting issue

If your CSV file contains additional fields, you'll go through a quick *field import process* that will add the new fields with their data in your collection.
--- ## Adding Advanced Fields You might want to add some advanced fields to store data, such as a Document Reference, DateTime, LatLng, and Multiple Items. Let's see how to add them using Firestore Content Manager. ### Document Reference To store the document reference, make sure you have a Field with **Data Type** set to **Doc/Record Reference** and **Reference Type** set to your **Collection**. The field looks like this: ![img_16.png](https://docs.flutterflow.io/assets/images/img_16-7b20d6bc8df9015f970c3e4e2aeef656.png) To add a document reference: 1. First, select the **Collection** from which you want to get a document reference. 2. Click on the **id** of the record to **copy** the document reference. 3. Now, select the **Collection** you would like to add a document to and then select + **Add Document.** A popup will appear. 1. Find the **Field** that accepts document reference and **paste** it 2. Click **Add Document**.
### Date Time To store the DateTime, make sure you have a Field with **Data Type** set to **Timestamp**. The field looks like this: ![img_17.png](https://docs.flutterflow.io/assets/images/img_17-e8c831e2fba6ac377bbcf720adb80ae5.png) To add a Date Time: Select the **Collection** you would like to add a document to and then select + **Add Document.** A popup will appear. 1. Find the **Field** that accepts DateTime. 2. Click on it, choose the **Date,** and then click **OK**. 3. Now, select **Time** and click **OK**. 4. Click **Add Document**. :::note To modify the given Date Time, click on the Date Time Field again to open the Date Picker dialog. :::
### Lat Lng To store the Latitude and Longitude of any place, make sure you have a Field with **Data Type** set to **Lat Lng**. The field looks like this: ![img_18.png](https://docs.flutterflow.io/assets/images/img_18-d9aa8af378581bbeb0fb5b94368adb9e.png) To add a Lat Lng for any place: Select the **Collection** you would like to add a document to and then select + **Add Document.** A popup will appear. 1. Find the **Field** that accepts LatLng. There are two ways you can add LatLng. * Directly add LatLng value for any place. * Click on the icon to find the place and get the LatLng. 2. Click **Add Document**.
### Multiple Items To store the multiple items of the same data type, For example, a list of Fruit names, make sure you have a Field with **Data Type** set and **Field Type** set to **List**. The field looks like this: ![img_19.png](https://docs.flutterflow.io/assets/images/img_19-0e3e23776ec20189dd46edf05eca64f2.png) To add data to List Field: 1. Select the **Collection** you would like to add a document to and then select + **Add Document.** A popup will appear. 2. Find the **Field** that accepts a list and click on it. 5. Click on the **+ Add Item** and enter the value. 8. Similarly, add more items. 11. Click **Add Document**. ### Custom DataType (aka Firestore Map) To add data to a custom data type field: Select the **Collection** you would like to add a document to and then select + **Add Document**.A popup will appear. 1. Find the **Field** that accepts a custom data type. 2. Select **Tap to Set Fields (Unset)** or **Tap to Edit Fields** (based on whether you are creating or updating the document). This will open a new popup. 3. Enter the values for the fields of the custom data type. 4. Select **Save Data**. 5. Click **Add Document**.
--- ## Updating Document To update a document: 1. Select the **pencil icon** in the row of the Document you want to update**.** You can also open the record by long-pressing any field in the Document (excluding the ID). 2. A popup will appear. Update the document as needed and then select **Update Document.** 3. You will now see the updated information displayed in your collection.
--- :::tip[Other Tips & Tricks] * Clicking on the ID field will copy the \*reference\* to a record. This is a helpful feature when you need to reference a user while you are creating a document. * Clicking on assets will open the asset URL. ::: --- ## FAQ
Getting 'Error updating Firestore Security Rules...' To fix this issue, you must [**deploy the Firestore Rules**](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules#deploy).
Getting the error "Could not create an account as firebase@flutterflow.io to your Firebase project. If you encounter such an issue, you just need to enable the [**Email Sign-In**](https://docs.flutterflow.io/integrations/authentication/firebase/email-login) in your Firebase project.
# Firestore Actions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-actions Learn about Firestore actions in your FlutterFlow Studio app, including how to perform various database operations. The Firestore action allows you to create, update, or delete a record from a Firestore Collection. :::note[Prerequisites] - Get to know how to [**structure the Firebase Database**](https://docs.flutterflow.io/integrations/database/cloud-firestore/getting-started#structuring-the-database). - Ensure you've gone through and completed every step in the [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for your project. - Created a [**collection**](https://docs.flutterflow.io/integrations/database/cloud-firestore/creating-collections) ::: ## Types of Firestore Database Actions Following are the types of Firestore database action: 1. [**Create Document**](#create-document-action)**:** Creates a new record inside the specified Firestore Collection. 2. [**Read Document**](#read-document-action): Fetches document data using a reference. 3. [**Update Document**](#update-document-action)**:** Updates the specified field value of the existing document. 4. [**Delete Document**](#delete-document-action)**:** Deletes records inside the specified Firestore Collection. 5. [**Query Collection**](#query-collection-action): Retrieves record(s) from the Firstore collection. ### Create Document [Action] Go to your project page on FlutterFlow Studio and follow the steps below to define the Action to any widget. 1. Select the **Widget** (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on **+ Add Action**. 4. On the right side, search and select the **Firestore** > **Create Document** action. 5. Set the **Collection** to your collection name. 6. Under the **Set Fields** section, click on the **+ Add Field** button. 7. Open the *Field* to pass its value from a widget: - Set the **Value Source** to **From Variable**. - Click on **UNSET** and select **Widget State > Name** of the TextField. 8. Similarly, add the field for the other UI elements. 9. By default, documents are added with an auto-generated ID. However, if you prefer to use your own ID for the document, you can enable the **Custom ID** toggle.
### Read Document [Action] There are some scenarios where you may want to fetch document data in response to a widget action. For example, fetching the user's profile details like name, profile picture, and bio to display them on click of a button. Here are some more use cases where you may find this action helpful: * Fetching additional user details for a post or comment. * Retrieve product details, price, and availability for order IDs in a user's cart. * Get details for cities referenced within a country document in a travel app. Let's see how to add this action with an example that fetches and displays the details of users who've reviewed a travel destination. Here's how it looks:

Here's how collections are setup: ![img_25.png](https://docs.flutterflow.io/assets/images/img_25-ac2455b536426cfbb3d2072fcf942d70.png) Follow the steps below to define this action to any widget: 1. Select the **Widget** (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on **+ Add Action**. 4. On the right side, search and select the **Firestore** > **Read Document** action. 5. Now, **Select Reference to Read** data from. 6. Provide the **Action Output Variable Name**. This will be used to store the document data.

7. Now, you can use the *Action Output Variable Name* provided in the previous step to fetch the details. For example, to display data on Text widget, select the **Text widget > Properties Panel > Text > Set Variable menu > ***[action_output_variable_name]*** > select the field** you want to display.
### Update Document [Action] Go to your project page on FlutterFlow Studio and follow the steps below to define the Action to any widget. 1. Select the **Widget** (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on **+ Add Action**. 4. On the right side, search and select the **Firestore** > **Update Document** action. 5. In order to update a specific document within a Firebase collection, you need to specify the reference to that document. The reference acts as a pointer to the exact document you want to update. 6. Under the **Set Fields** section, click on the **+ Add Field** button. 7. Open the *Field* to pass its value from a widget: 1. Set the **Value Source** to **From Variable**. 2. Click on **UNSET** and select **Widget State > Name** of the TextField. 8. Similarly, add the field for the other UI elements.
### Delete Document [Action] Go to your project page on FlutterFlow Studio and follow the steps below to define the Action to any widget. 1. Select the **Widget** (e.g., Button) on which you want to add the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on **+ Add Action**. 4. On the right side, search and select the **Firestore** > **Delete Document** action. 5. In order to delete a specific document within a Firebase collection, you need to specify the reference to that document. The reference acts as a pointer to the exact document you want to delete.
### Query Collection [Action] There are certain scenarios where you may want to query a collection manually. For example, you might want to only fetch data in response to a specific user action, such as clicking a button or submitting a form. Additionally, If your app fetches different data under different conditions, you might find it more convenient to manually call queries. For example, fetching different tasks for admin and team members. To manually query a collection, follow the steps below to define this action to any widget: 1. Select the **Widget** (e.g., Button) on which you want to define the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on **+ Add Action**. 4. On the right side, search and select the **Firestore** > **Query Collection** action. 5. Choose the **Collection** you want to query. 6. Choose the **Query Type** among the following: - **List of Documents:** Use this option when you need to query an entire list of documents from a collection. This is useful for retrieving multiple documents that can be ordered or filtered by specific criteria, such as a keyword. - **Single Document:** Select this when you want to fetch a specific single document from a collection, typically identified by its unique ID. - **Count:** Choose this option to determine the number of documents that meet certain criteria without retrieving the documents themselves. This is useful for getting quick insights or summaries, like the total number of entries that match a filter. 7. You can also [Filter](#filtering-a-collection-query) and [Order](#ordering-a-collection-query) the query result. 8. Provide the **Action Output Variable Name**. This will be used to store the query result.

9. Now, you can use the *Action Output Variable Name* provided in the previous step to generate children from a variable on **ListView**. 10. Finally, you can display data in a **Text** widget. To do so, select the **Text widget > Properties Panel > Text > Set from Variable menu** **> [children_from_variable_name] item > select the field** you want to display.

#### Filtering a Collection Query Sometimes, you might need to filter a list based on a condition. For example, you might want to show only incomplete Todo items on the main listing. To add a filter when querying a collection: - In the Action properties of **Query Collection Action**, scroll down and click on the **+ Filter** button at the bottom - Find the **Field Name**, click on the Unset, and select a field on which you would like to apply the filter. - Find the **Relation** dropdown, click on the **Unset**, and choose the relation among the list. - Find the **Value** property and set it to an appropriate value and click **Confirm**. :::note - Select a filter relation that aligns with your specific needs. For instance, if you wish to display only incomplete todos, you can create a field named 'isDone,' set the relation to 'Equal To,' and define the value as 'False.' - Another example would be to showcase users older than 30; in this case, you'd create a 'Age' field, set the relation to 'Greater Than,' and specify the value as 30. - You can combine multiple filters using **AND** or **OR** operators to create more advanced filtering logic. This enables you to refine your data query to match specific conditions. :::
#### Ordering a Collection Query You might want to show your list based on a specific order. For example, you could show a Todo list in order of due date. To specify the order when querying a collection: - In the Action properties of **Query Collection Action**, scroll down and click on the **+ Order By** button at the bottom - Find the **Field Name**, click on the **Unset**, and select the field which you would like to choose for ordering. - Find **Order** dropdown, click on the Unset, and choose the order either Increasing or Decreasing and click **Confirm**. :::note Choose the order based on your requirements. For instance, if you want to display Todo items sorted by their due dates, simply set the **Field Name** to date and the **Order** to Increasing. :::

:::caution If you apply both filtering and ordering while querying a collection, an index is necessary otherwise FlutterFlow Studio will throw an error. [**Learn how to avoid the errors.**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#adding-indexes) ::: ## Enabling Firestore Batch Write When working with databases, you often need to create, update, or delete data. Typically, you would send individual requests to the database for each operation, which requires multiple round trips to the server. This can be time-consuming and inefficient. By enabling Firestore batch write, you can group multiple operations and send them to the database as a single request. With this, either all the operations within the batch will succeed or none of them will be applied. This guarantees data consistency, so you don't end up with a partially updated state if something goes wrong during the process. :::tip * You can learn more about [**Firestore Batch Write**](https://firebase.google.com/docs/firestore/manage-data/transactions#batched-writes). * If you are a newbie, we recommend watching [**this video**](https://youtu.be/dOVSr0OsAoU) first. ::: Suppose you have an e-commerce application, and after a successful order, you need to update the product inventory count and create a new document in the 'orders' collection. Using a batch write, you can combine these operations and execute them together to ensure data consistency. To enable Firestore batch write, you must have multiple Firestore any combination of actions; inside the action editor, at the top right side, enable **Batch Firestore Writes**.
![img_26.png](https://docs.flutterflow.io/assets/images/img_26-7e206b723fb16f08a5900b43e0de2fc5.png)
Enabling Firestore Batch Write
## Trigger action on data change Sometimes, you might want to trigger an action whenever the data changes inside the collection. For instance, In a news app, you might want to notify users when new news is available, like this:

To do so: 1. Ensure you have added a **Query Collection** or **Document from Reference** on a widget with **Single Time Query** disabled. 2. Now, on the widget with **Query Collection** or **Document from Reference**, open the **Action Flow Editor** and set **On Data Change** as the [Action Trigger](https://docs.flutterflow.io/resources/functions/action-triggers). This ensures that any actions you add will be triggered whenever the data is updated, added, or deleted. 3. You can now [add any action](https://docs.flutterflow.io/resources/functions/action-flow-editor#adding-an-action-example) you want to perform, such as showing a notification, refreshing the UI, or fetching related data. :::note If you are using this trigger on a ListView, make sure to **disable** the **Infinite Scroll**. :::

# Supabase Database Actions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/supabase/database-actions Learn how to insert, upsert, update, delete, and query Supabase rows from your FlutterFlow Studio app. Supabase Database Actions allow you to insert, upsert, update, delete, or query rows in a Supabase table. You can also set up [**Backend Queries**](https://docs.flutterflow.io/resources/backend-query) to load Supabase data automatically and keep it updated through real-time streaming. :::note[Prerequisites] Before using these actions: - Complete the [**Supabase setup**](https://docs.flutterflow.io/integrations/supabase/setup). - Create the table and fields your action will use. ::: ## Types of Supabase Database Actions The following actions are available for Supabase tables: - [**Insert Row**](#insert-row-action): Adds a new row to a table. - [**Upsert Row**](#upsert-row-action): Inserts a new row or updates an existing row when the conflict columns match. - [**Update Row**](#update-row-action): Updates rows that match specified filters. - [**Delete Row**](#delete-row-action): Deletes rows that match specified filters. - [**Query Rows**](#query-rows-action): Retrieves rows from a table based on specific criteria or conditions. ### Insert Row [Action] Use **Insert Row** when you always want to create a new row. To configure the action: 1. Select the widget that will trigger the action and open the **Action Flow Editor**. 2. Click **+ Add Action**, then search for and select **Insert Row**. 3. Set **Table** to the Supabase table where you want to add the row. 4. Under **Set Fields**, click **+ Add Field** and select a field. 5. Set its value directly or choose **From Variable** to use data such as a widget state value. 6. Repeat steps 4–5 for each remaining field you want to set. :::tip[Generated values] Leave automatically generated fields unset. For example, Supabase can generate `id` when it is configured as an identity column and `created_at` when its default value is `now()`. ::: ### Upsert Row [Action] The **Upsert Row** action inserts a new row when no existing row has the same values in the selected conflict columns. If a matching row exists, the action updates that row instead. This is useful when you want to save data without first querying the table to determine whether to insert or update it. For example, you can use `id` as the conflict column when saving a task. If a task with that `id` exists, the action updates its fields. Otherwise, it inserts a new task. To configure the action: 1. Select the widget that will trigger the action. 2. Open the **Action Flow Editor**. 3. Click **+ Add Action**, then search for and select **Upsert Row**. 4. Set **Table** to the Supabase table you want to modify. 5. Under **Set Fields**, click **+ Add Field** and provide the values to insert or update. Include values for every selected conflict column. 6. Under **On Conflict Columns**, select the primary key or unique columns that identify an existing row. 7. Optional: Enter an **Action Output Variable Name** to use the returned row in later actions. :::note[Conflict columns] The selected conflict columns must form a primary key or unique constraint in Supabase. If their values do not match an existing row, the action inserts a new row. For more information, see the [**Supabase Upsert documentation**](https://supabase.com/docs/reference/dart/upsert). ::: :::tip[Configure RLS] Because an upsert can either insert or update a row, configure suitable `INSERT` and `UPDATE` row-level security (RLS) policies for the table. If you use the action output, ensure the user can also read the returned row. See the [**Supabase Row Level Security guide**](https://supabase.com/docs/guides/database/postgres/row-level-security) for details on creating policies. ::: ### Update Row [Action] Use **Update Row** to change one or more existing rows that match your filters. To configure the action: 1. Select the widget that will trigger the action and open the **Action Flow Editor**. 2. Click **+ Add Action**, then search for and select **Update Row**. 3. Set **Table** to the Supabase table you want to update. 4. Optional: Enable **Return Matching Rows** if you need the updated rows in later actions. 5. Under **Matching Rows**, click **+ Add Filter** and configure the **Field Name**, **Relation**, and **Value**. For example, set **Field Name** to `id`, **Relation** to **Equal To**, and **Value** to the target row's ID. 6. Under **Set Fields**, click **+ Add Field** and provide each new value. ### Delete Row [Action] Use **Delete Row** to remove one or more rows that match your filters. To configure the action: 1. Select the widget that will trigger the action and open the **Action Flow Editor**. 2. Click **+ Add Action**, then search for and select **Delete Row**. 3. Set **Table** to the Supabase table from which you want to delete rows. 4. Optional: Enable **Return Matching Rows** if you need the deleted rows in later actions. 5. Under **Matching Rows**, click **+ Add Filter** and configure the **Field Name**, **Relation**, and **Value**. For example, set **Field Name** to `id`, **Relation** to **Equal To**, and **Value** to the target row's ID. :::caution Filters determine which rows are updated or deleted. Use a unique field such as `id` when you intend to affect only one row. ::: :::tip You can add the [**Refresh Database Request**](https://docs.flutterflow.io/integrations/database/refresh-db-request) action after deleting rows to refresh the displayed data. ::: ### Query Rows [Action] Use **Query Rows** to load data in response to an action, such as a button tap. This is useful when the query should run only after user interaction or when different actions need different data. To configure the action: 1. Select the widget that will trigger the query and open the **Action Flow Editor**. 2. Click **+ Add Action**, then search for and select **Query Rows**. 3. Select the **Table** you want to query. 4. Optional: Add [filters](#filtering-table-data) or [ordering](#ordering-table-data). 5. Enter an **Action Output Variable Name** to access the returned rows in later actions. #### Use Query Results Access the returned rows from **Action Outputs**. To display them in a ListView, generate dynamic children from the action output and bind widgets inside each child to the appropriate row fields. #### Filtering Table Data Use filters to return only rows that match specific conditions. For example, you can query only completed assignments. To add a filter: 1. In the **Query Rows** action properties, click **+ Add Filter**. 2. Set **Field Name** to the column you want to filter. 3. Select a **Relation**. 4. Set **Value**, then click **Confirm**. :::tip Choose a filter relation based on the results you need. For example: - **Equal To**: To show only completed assignments, set **Field Name** to `is_done`, **Relation** to **Equal To**, and **Value** to `True`. - **Greater Than**: To show only users older than 30, set **Field Name** to `age`, **Relation** to **Greater Than**, and **Value** to `30`. - **Like**: To find addresses with ZIP codes starting with `35`, set **Field Name** to `zip_code`, **Relation** to **Like**, and **Value** to `35%`. Use these wildcards for pattern matching: - **Percent (`%`) Wildcard**: Represents zero or more characters. - Example: `'A%'` matches any string starting with `'A'` (e.g., `'Apple'`, `'Apex'`). - Example: `'%A%'` matches any string containing `'A'` (e.g., `'Canada'`, `'Australia'`). - **Underscore (`_`) Wildcard**: Represents a single character. - Example: `'A_'` matches any two-character string starting with `'A'` (e.g., `'An'`, `'At'`). - Example: `'A__'` matches any three-character string starting with `'A'` (e.g., `'Ant'`, `'Art'`). ::: :::note You can combine multiple filters using **AND** or **OR** operators to create more advanced filtering logic. ::: #### Ordering Table Data Use ordering to return rows in a specific sequence, such as assignments ordered by due date. To specify the order: 1. In the **Query Rows** action properties, click **+ Add Order**. 2. Set **Table Field Name** to the column used for ordering. 3. Set **Order** to **Increasing** or **Decreasing**, then click **Confirm**. :::tip To show assignments with the earliest due dates first, set **Table Field Name** to `due_date` and **Order** to **Increasing**. ::: ## Trigger an Action on Data Change You can trigger an action whenever data changes in a Supabase table. For example, an e-commerce app can notify users when an order's status changes. To respond to data changes in a Supabase table: 1. Ensure you have added a **Supabase Query** to a widget (e.g., a ListView) with **Single Time Query** disabled to enable real-time updates. 2. On the widget with the **Supabase Query**, open the **Action Flow Editor** and set **On Data Change** as the [Action Trigger](https://docs.flutterflow.io/resources/functions/action-triggers). This ensures that any actions you add will be triggered whenever the data is updated, added, or deleted. 3. [Add an action](https://docs.flutterflow.io/resources/functions/action-flow-editor#adding-an-action-example), such as showing a notification, refreshing the UI, or fetching related data. :::note When using this trigger on a ListView, disable **Infinite Scroll**. :::

## Offline Support for Supabase Apps For offline support, consider using the [**PowerSync Library**](https://marketplace.flutterflow.io/item/dm1cuOwYzDv6yQL2QOFb), built by the [**PowerSync**](https://www.powersync.com/) team. It syncs Supabase data locally and updates it when the device reconnects. # Supabase Database Functions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/supabase/database-functions Learn how to call Supabase database functions from your FlutterFlow Studio app. [Supabase database functions](https://supabase.com/docs/guides/database/functions) are reusable PostgreSQL functions that run inside your Supabase database. FlutterFlow Studio can call these functions through a [Remote Procedure Call (RPC)](https://supabase.com/docs/reference/dart/rpc), pass values to their arguments, and use the returned data in your app. Database functions are useful for calculations, aggregated results, complex queries, and operations that are difficult to perform with a standard Supabase query. For example, the following app uses a database function to calculate and display the completion percentage for each project. ![A FlutterFlow Studio app displaying task completion percentages returned by a Supabase database function.](https://docs.flutterflow.io/assets/images/task-completion-results-aba2decc3287398b51cba7ba5fa56777.avif) :::note[Prerequisites] - Complete the [**Supabase setup**](https://docs.flutterflow.io/integrations/supabase/setup) and connect your project to FlutterFlow Studio. - For this example, create the `tasks` table and the columns used by the function. - Configure suitable database permissions and [**Row Level Security (RLS)**](https://supabase.com/docs/guides/database/postgres/row-level-security) policies for the data the function accesses. ::: ## When to Use a Database Function Use a database function when you need to: - Return data from complex queries or multiple related tables. - Run a calculation or aggregation close to the data. - Reuse the same database logic in different parts of your app. - Perform multiple related database operations together. For straightforward row operations, such as inserting, updating, deleting, or querying rows, use [Supabase Database Actions](https://docs.flutterflow.io/integrations/database/supabase/database-actions). Use a [Supabase Edge Function](https://docs.flutterflow.io/concepts/custom-code/cloud-functions#supabase-edge-functions) when the operation needs server-side TypeScript, secrets, or calls to external services. ## 1. Create a Database Function You can create a database function from the Supabase Dashboard using the SQL Editor, as described in the [Supabase database functions guide](https://supabase.com/docs/guides/database/functions#getting-started). The following `get_project_progress` function reads the task counts for each project and returns each project's completion percentage: ```sql create or replace function public.get_project_progress() returns table ( id text, project_name text, number_tasks bigint, completed_tasks bigint, completion_percentage numeric ) language sql security invoker as $$ select t.id, t.project_name, t.number_tasks, t.completed_tasks, case when coalesce(t.number_tasks, 0) = 0 then 0 else round( (coalesce(t.completed_tasks, 0)::numeric / t.number_tasks) * 100, 2 ) end as completion_percentage from public.tasks t; $$; ``` To create the database function in Supabase: 1. Open your project in the Supabase Dashboard. 2. Go to **SQL Editor** and write your SQL query. 3. Click **Run** and review the returned rows. 4. Go to **Database > Functions** to verify that your function is listed.

:::tip[Function security] Use `security invoker` unless the function specifically needs to run with the function creator's permissions. With invoker security, the function runs using the permissions of the signed-in user. Also review who has permission to execute the function and protect the tables it accesses with RLS. See the [**Supabase database functions guide**](https://supabase.com/docs/guides/database/functions) and [**API security guide**](https://supabase.com/docs/guides/api/securing-your-api). ::: ## 2. Import Database Functions into FlutterFlow Studio After creating or changing a function in Supabase, refresh the schema in FlutterFlow Studio: 1. Open **Settings and Integrations > Supabase**. 2. Confirm that the correct Supabase project is connected. 3. Click **Update Schema**. This fetches the latest database definitions and makes compatible PostgreSQL functions available as **Supabase RPC** actions. Repeat this step whenever you change a function's name, arguments, or return type. ![The Update Schema button in FlutterFlow Studio's Supabase settings.](https://docs.flutterflow.io/assets/images/update-supabase-schema-68df3d7b1696b75b604c146c042e287d.avif) ## 3. Call a Database Function You can call an imported database function using any appropriate action trigger. For example, call a function on page load to retrieve the latest progress when the page opens. 1. Select the widget or page where you want to call the function and open the **Action Flow Editor**. 2. Select an existing trigger or add a new one. 3. Select a **Supabase RPC** action. 4. If the function accepts arguments, set each one using a specific value or a variable. 5. Enter an **Action Output Variable Name** so you can use the returned data in later actions. ![Calling a Supabase database function from the Action Flow Editor.](https://docs.flutterflow.io/assets/images/call-supabase-database-function-61329fb0f0f7195cc09d1c82311c1ae6.avif) ## 4. Use the Function Output The data available from the action output is determined by the function's declared return type. A function can return a single value, one object, or multiple rows. For example, [`get_project_progress`](#1-create-a-database-function) uses `returns table (...)` to declare a tabular result with columns for the project name, task counts, and calculated completion percentage: ```sql returns table ( id text, project_name text, number_tasks bigint, completed_tasks bigint, completion_percentage numeric ) ``` Here, `returns table` defines the columns returned by the function. It does not create or refer to a physical table in Supabase. Supabase returns the generated rows as a JSON array, with each row represented as an object: ```json [ { "id": "c45a5311-3899-437b-9be5-72b4b342751a", "project_name": "Mobile App Release - Discovery", "number_tasks": 13, "completed_tasks": 5, "completion_percentage": 38.46 } ] ``` To use these rows as structured data, create a [Custom Data Type](https://docs.flutterflow.io/resources/data-representation/custom-data-types), such as `ProjectProgress`. Its field names must exactly match the JSON field names, including capitalization and underscores: | JSON field | Custom Data Type field | FlutterFlow Studio data type | | --- | --- | --- | | `id` | `id` | String | | `project_name` | `project_name` | String | | `number_tasks` | `number_tasks` | Integer | | `completed_tasks` | `completed_tasks` | Integer | | `completion_percentage` | `completion_percentage` | Double | Because this function returns multiple rows, create a page-state variable that holds a list of `ProjectProgress` values. In an **Update Page State** action, use the RPC **Action Output** as the source and map the returned JSON array to that variable. You can then use the structured list in widgets and later actions on the page. :::note You do not need to save the result in page state when only subsequent actions need it. In that case, use the RPC result directly from **Action Outputs**. :::

## FAQs
Why doesn't my database function appear in FlutterFlow Studio? Confirm that the function exists in the connected Supabase project, then click **Update Schema**. If it still does not appear, review the function's schema, arguments, and return type.
Why does my app receive a permission error when calling a function? Check the function's [execute privileges](https://supabase.com/docs/guides/database/functions#function-privileges) and the permissions for every table it accesses. For a `security invoker` function, the calling user must be allowed to access the underlying data, including through applicable [RLS policies](https://supabase.com/docs/guides/database/postgres/row-level-security).
Why does the action show old arguments or output fields? Click **Update Schema** after changing the function. Then reopen the **Supabase RPC** action and verify its arguments, output variable, and any widgets or state variables that use the result.
# Refresh Database Request [Action] > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/refresh-db-request Learn how to use the Refresh DB Request action in your FlutterFlow Studio app to refresh your database content. Using this action, you can see the updated values of an item inside the scrollable widgets such as ListView, GridView, StaggeredView, Row, and Column.

:::note[Prerequisites] If you are querying data via a Backend Query, ensure you have enabled the **Single Time Query** in the Backend Query properties (Query Collection or API Call) on any scrollable widget. ::: Go to your project page on FlutterFlow Studio and follow the steps below to define the Action to any widget. 1. Select the **Widget** (e.g., Button) on which you want to define the action. 2. Select **Actions** from the Properties Panel (the right menu), and click **Open**. This will open an **Action flow Editor** in a new popup window. 3. Click on the **+ Add Action**. 4. On the right side, search and select the **Refresh Database Request** (under *Backend/Database*) action. 1. From the dropdown, select the widget (e.g., ListView, GridView, etc.) on which you have added the backend query. 2. By default, the **Wait for Result** option is enabled. That means the subsequent action(s) will only trigger after this action is finished. If any subsequent action is not dependent on this action or you want to trigger them regardless of the completion of this action, you can turn off this option. 3. When the **Wait for Result** is enabled, you can specify the **Min Wait Time** and **Max Wait Time** in ms (e.g., 1000ms = 1 second). * **Min Wait Time**: Time before triggering the following action(s) or refreshing the UI. * **Max Wait Time**: Time after which the subsequent action(s) will trigger regardless of the completion of this action. 5. Click **Close**.

# SQLite > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/database/sqlite Learn how to quickly get started with SQLite in your FlutterFlow Studio app for local data storage. SQLite is a compact, efficient database management system. Unlike conventional databases that require a server, SQLite is serverless and embeds directly into applications. It's perfect for mobile apps where resources are limited, and a full-fledged database server is impractical. For example, it's ideal for a mobile app that needs to store data locally, such as a personal finance tracker or a health record app, especially when offline functionality is required. :::caution Currently, we don't support SQLite on Web-based apps. ::: Let's understand how you can utilize SQLite in your app with an example. An app where users can add, update, and delete Notes. Here's how it looks when completed:

Here are the steps to build such an example: 1. [Enable SQLite](#1-enable-sqlite) 2. [Database configuration](#2-database-configuration) 3. [Add SQL queries](#3-add-sql-queries) 4. [Display all notes](#4-display-all-notes) 5. [Add note](#5-add-note) 6. [Update note](#6-update-note) 7. [Delete note](#7-delete-note) ## 1. Enable SQLite To enable SQLite in FlutterFlow Studio, navigate to Settings and Integrations > Integrations > SQLite > switch on the **Enable SQLite** toggle. ![img.png](https://docs.flutterflow.io/assets/images/img-69f9c51c511fba175c15e7c8ca5c2e0d.png) ## 2. Database configuration In the database configuration step, you'll need to upload your SQLite database file and assign a name to it. This process is crucial for initializing the database when your app launches. If you don't yet have an SQLite database, you can easily create one using tools like [sqlitebrowser](https://sqlitebrowser.org/). Simply download [sqlitebrowser](https://sqlitebrowser.org/dl/), create a new database, set up your tables, and optionally add some data. After preparing your database, upload the file to FlutterFlow Studio to integrate it with your app. For this example, we'll create a "Notes" table with `ID`, `Title`, `Details`, `DueDate`, and `IsCompleted` as columns. :::caution It is advisable to avoid using any SQL reserved keywords such as `type` and `data` as column names to prevent potential build errors or unexpected behavior. SQLite reserves certain words for its SQL syntax, and using these as identifiers without proper handling may cause issues. For a comprehensive list of reserved keywords, refer to the [**SQL reserved words**](https://en.wikipedia.org/wiki/List_of_SQL_reserved_words). ::: Here's how you can create and configure the database:

:::note[Important to note] SQLite does not have dedicated date-time or boolean data types. For storing date-time values like `DueDate`, we use the integer data type and represent the date-time as a [**UNIX timestamp**](https://www.unixtimestamp.com/). Similarly, for boolean values, such as checking if a note is completed, SQLite uses integers where `0` represents `false` (or not completed) and `1` represents `true` (or completed). ::: ## 3. Add SQL queries SQL queries are statements used to interact with a database. We allow you to add queries in two different sections: #### 1. Read Queries This includes statements that retrieve data from the database but do not modify anything. Some common examples: * `SELECT * FROM customers;` - retrieve all rows and columns. * `SELECT name, city FROM customers;` - retrieve specific columns. * `SELECT * FROM customers WHERE city = 'New York';` - retrieve rows that match a condition. #### 2. Update Queries This includes statements that modify the database, such as: * `INSERT INTO customers (name, address, city) VALUES ('John', '555 Main St', 'New York')` - add new rows. * `UPDATE customers SET address = '123 Main Street' WHERE name = 'John'` - update existing rows. * `DELETE FROM customers WHERE city = 'Chicago'` - delete rows that match a condition. In general, to add any query, you need to provide a name, the query statement, and variables that are used to pass values from your app to queries. For *Read Queries*, you have to define the output columns as well. This will help you display the row data in the UI by selecting the column name. :::tip * To use variables, simply use the syntax `${variableName}`. For example: `SELECT \* FROM Notes WHERE id = ${noteId}` * When passing string or text data in queries, enclose variables in single quotes, like `${title}`, to signify them as strings. ![img_1.png](https://docs.flutterflow.io/assets/images/img_1-f3fb3ba48d21061a2b7784fd6091e621.png) ::: Below are the queries that we'll require for this example: #### 1. GetAllNotes This will retrieve all notes from the database. ``` Select * from Notes ```

#### 2. AddNote This will add a new note to the database. ``` INSERT INTO Notes (Title, Details, DueDate, IsCompleted) VALUES ('${title}', '${details}', ${dueDate}, 0); ```

#### 3. UpdateNote This will update the existing note based on the note ID. ``` UPDATE Notes SET Title = '${title}', Details = '${details}', DueDate = ${dueDate}, IsCompleted = ${isCompleted} WHERE ID = ${id}; ```

#### 4. DeleteNote This will delete the note based on the note ID. ``` DELETE FROM Notes WHERE ID = ${id}; ```
## 4. Display all notes To show a list of notes, you can use the **ListView** > **Container** widgets to design a page that looks like the following: ![img_2.png](https://docs.flutterflow.io/assets/images/img_2-d8caf311fc98a1220bc08f26b9d65fa4.png) Now, on the ListView widget, add a SQLite backend query as per the following instructions: ### Add a SQLite Query: Go to your project page and follow the steps below to define an SQLite query: - Select the widget (or page) on which to apply the query. - Select **Backend Query** from the Properties Panel (the right menu). - Click **Add Query** and set the Query Type to **SQLite Query**. - Select the **Query Name**. (Only Read Queries will be displayed here.) and click **Confirm**.

Once you have the SQLite query defined, you can use the data retrieved from the query to display on widgets present inside. Follow the steps below: - Select the widget (e.g., Text) on which you want to display the data. - From the Properties Panel, open the Set from Variable menu > select [your query name] Row > select the column data that you want display here and click **Confirm**.

:::note In our example, the due date is stored as a Unix timestamp, which isn't user-friendly for display purposes. Therefore, we've included a custom function in the [example project](https://app.flutterflow.io/project/note-taking-app-zto2ua) that converts this timestamp into a human-readable date format. ::: ## 5. Add note You can add a new note in the database using the SQLite query Action with the type set to **Update Query** and Query Name to [AddNote](#2-addnote). Here's how you do it:
## 6. Update note For updating note values, like marking a note as completed or modifying other fields, utilize the SQLite Query Action and set the type to **Update Query**. Here, set the Query Name to [Update Note](#3-updatenote). Here's how you do it:
:::note * In this example, we are updating the note on a bottom sheet component. To provide a better user experience, we initially display the current values of the note, ensuring that users have a clear idea of what they are going to edit. To display the note values in bottom sheet, we [pass](https://docs.flutterflow.io/concepts/navigation/passing-data) the current note with **Type** set to **SQLite Row**. ![img_3.png](https://docs.flutterflow.io/assets/images/img_3-bfc44730b7360439ac421a992f0d2c12.png) * When updating a date value, we also verify if the date has been modified. If there's no change, we simply pass back the same value we received. ::: ## 7. Delete note You can delete an existing note from the database using the [SQLite query action](https://docs.flutterflow.io/resources/backend-query/sqlite-query) with the type set to *Update Query* and Query Name to **Delete Note**. :::tip[Pro Tip] To refresh the page, simply add an [**Update App State Action**](https://docs.flutterflow.io/resources/data-representation/app-state) Action with the Update Type set to 'Rebuild Current Page'. ::: Here's how you do it:

:::note[Example project] Check out the complete [**example project**](https://app.flutterflow.io/project/note-taking-app-zto2ua) for reference. ::: ## FAQs
Can SQLite handle complex data structures compared to App State Variables? Yes, SQLite can handle complex data structures much more effectively. It allows for structured data storage, complex queries, sorting, and filtering, which are challenging to implement with app state variables.
Is SQLite a good choice for apps that require offline functionality? Absolutely. SQLite stores data locally, making it an excellent choice for apps that need to operate offline. Users can access and manipulate data without needing an internet connection.
Will using SQLite affect my app's performance compared to using App State Variables? SQLite is designed to be lightweight and efficient, so it generally won't negatively impact your app's performance. In fact, for larger data sets, it's more efficient than storing data in app state variables.
How does SQLite ensure data security and integrity? SQLite maintains data integrity and supports transactional operations. This means it ensures the database state remains consistent even in cases of unexpected interruptions, like app crashes or power failures.
# Import from FF Designer > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/designer/import-from-ff-designer Learn how to export screens from FF Designer and import them into FlutterFlow Studio. You can quickly bring your generated designs from [FF Designer](https://designer.flutterflow.io/) into FlutterFlow Studio to continue building with real widgets, actions, and logic. This allows you to transform visual storyboards into fully functional app screens without recreating layouts manually. #### Step 1: Export from FF Designer 1. Open the top-left **FF Designer** menu. 2. Choose **Export to FlutterFlow Studio**. 3. This copies the selected frames (or entire storyboard) to your clipboard. :::tip You can also use the shortcut **Cmd + C** to copy frames directly for faster export. ::: #### Step 2: Import into FlutterFlow Studio 1. Open your FlutterFlow Studio project. 2. Navigate to the page where you want to paste the design. 3. Select any widget from the widget tree. 4. Paste the copied design. FlutterFlow Studio will recreate the layout structure using real widgets, preserving hierarchy, spacing, and styling.

To import a single component, copy the component’s root element and paste it into your widget tree.

# Connect to Firebase > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/firebase/connect-to-firebase Learn how to integrate Firebase with your FlutterFlow Studio app to add user authentication, cloud storage, real-time databases, and more. Firebase integration in FlutterFlow Studio provides an effortless way to enhance your apps with powerful features such as user authentication, cloud storage, real-time databases, and more. This setup guide will walk you through integrating Firebase with FlutterFlow Studio, empowering you to easily create feature-rich, scalable applications. ## Create a new Firebase project from FlutterFlow Studio FlutterFlow Studio allows you to automatically create a Firebase project directly from the builder using a quick three-step process. #### Step 1: Set Up Your Project Go to **Settings & Integrations > Project Setup > Firebase** in FlutterFlow Studio to get started. #### Step 2: Select Your Region Hit **+ Create Project**. You’ll see a popup where you can confirm your project's name and choose the Firebase region that best serves your users. #### Step 3: Connect Your Google Account Choose **Create** or **Sign in with Google** to link your Firebase account. If asked, you must grant the access requested from 'flutterflow.io' to be able to create and configure the Firebase project on your behalf. Here, you can **Select all** and click **Continue**. Alt text Once initiated, FlutterFlow Studio will handle the rest of the project creation in the background. Here's a quick walkthrough: As soon as the process is completed, you will see the following view in your Firebase Settings dashboard. Firebase Project Created #### Enable Firebase Authentication If you want to use the Firebase Authentication in your app or the Firebase Content Manager, you must enable the authentication in the Firebase console and enable the 'Email/Password' sign-in. #### Enable Firebase Storage If you plan to use Firebase storage in your app, click on the Enable Storage on Firebase and enable it on Firebase console. #### Download Firebase Config files The configuration files are necessary when connecting to Firebase. It contains various settings and keys that enable your project to communicate with Firebase services. To generate those files, click on Auto Generate Config Files and then click Generate Files. ## Connect an existing Firebase project manually If you already have a Firebase project and want to connect it to your current FlutterFlow Studio project, go to **Settings & Integrations > Project Setup > Firebase** and click on the Firebase Setup Wizard. A pop-up dialog will appear. Follow these steps: :::caution The manual steps in this section use legacy access (**firebase@flutterflow.io**), which is being turned off. Since October 14, 2026, you can't create new legacy connections. Connect with **Sign in with Google** instead. See [Legacy access shutdown](#legacy-access-shutdown) for the dates and how to reconnect an existing project. ::: #### Setup Firebase In the dialog, scroll down to **Setup Firebase**, check that option, and click **Next Step**. The second page of the dialog will open. Before filling in more information, you need to allow FlutterFlow Studio to access your Firebase project. The following section will guide you through this process. #### Allow FlutterFlow Studio to Access Your Project 1. Go to the Firebase console of your existing project, navigate to the far left menu, and select **Project Settings -> Users and Permissions**. 2. Select **Add Member** from the top right. 3. Add **firebase@flutterflow.io** as an "**Editor**" for your project and select **Done**. Then press **Add Member**. ![firebase-add-member.png](https://docs.flutterflow.io/assets/images/firebase-add-member-c9dc098f376dda9328e0070f1f3b0f69.png) 4. On the same page (i.e., Users and Permissions), select **Advanced Permission Settings** (small blue text below the table). This will open the Google Cloud console in a new browser window. Steps 2, 3 and 4 5. Find the row containing *firebase@flutterflow.io* and select **Edit principal** (pencil on the far right of the row). In the Google Cloud console page 6. Select **+ Add Another Role.** 7. Under **Select A Role**, search for **Service Account User** (you may need to scroll to find this). Select **Service Account User**. On choosing Select A Role and searching for Service Account User 8. Select **+ Add Another Role** again. Under **Select A Role**, search for **Cloud Functions Admin**. Select **Cloud Functions Admin**. :::note Note: The option to add Cloud Functions Admin may only show up if you are on a Firebase Blaze plan. In addition, you may need to [enable cloud functions](https://console.cloud.google.com/marketplace/product/google/cloudfunctions.googleapis.com) first. Cloud Functions Admin permissions are required for several FlutterFlow Studio features (e.g., Push Notifications). Adding this Cloud Functions Admin is optional, but not doing so will prevent you from using any functions that require Cloud Functions. ::: #### Connect and autogenerate files 1. From the Firebase dashboard of your project, navigate to the far left menu and select **Project Settings**. 2. Under Your Project, find the **Project ID**, right-click it, and copy. 3. Return to FlutterFlow Studio, enter your Firebase Project ID in the dialog, and click Connect. A green checkmark will appear once the connection is successful. 4. Under Config Files, choose **Generate Config Files** and then select **Generate Files**. :::note Do not close or refresh the page while the files are being generated. ::: ## Legacy access shutdown If your project connects to Firebase through legacy access (**Use Legacy Access (firebase@flutterflow.io)**), reconnect it with Google. FlutterFlow Studio is turning off legacy access in stages: | Date | What changes | | --- | --- | | October 14, 2026 | You can't create new legacy connections. A **Legacy Firebase Access** entry appears in **Project Issues** for projects that still use legacy access. Deploys keep working. | | October 28, 2026 | Deploys from projects that still use legacy access fail, unless support granted the project emergency access. | | November 30, 2026 | Emergency access ends. Deploys from projects that still use legacy access fail for everyone. | Your published apps keep running. The change affects only deploys that you start from FlutterFlow Studio, such as Cloud Functions and Firebase rules. Enterprise deployments aren't affected. ### Reconnect your Firebase project 1. Go to **Settings & Integrations > Project Setup > Firebase**. 2. In the **Reconnect Firebase Project** banner, select **Reconnect Firebase Project**. 3. Sign in with Google and grant the requested access. Reconnecting gives FlutterFlow Studio a dedicated service account in your Firebase project, so deploys no longer depend on **firebase@flutterflow.io**. :::tip After the reconnect succeeds, you can remove the **firebase@flutterflow.io** principal from every role it holds under IAM in the Google Cloud console. Leave your Firestore rules and Authentication users alone, because the [Content Manager](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-content-manager) signs in with the same address. ::: ### Deploy dialog When you deploy to a Firebase environment that still uses legacy access, FlutterFlow Studio shows a dialog that asks you to reconnect. - **Before October 28, 2026:** The **Reconnect your Firebase project** dialog offers **Reconnect with Google** and **Deploy anyway**. To stop the reminders for the current project, select **Don't show again** and then **Deploy anyway**. The dialog then shows the date that deploys stop working. FlutterFlow Studio saves this choice for you and the project in your browser. - **After October 28, 2026:** The **Reconnect Firebase to deploy** dialog blocks the deploy. Select **Reconnect with Google** to go to the Firebase settings, or **Cancel** to close the dialog. ### Emergency access If you can't reconnect before October 28, 2026, contact support@flutterflow.io to request emergency access for the project. Emergency access lets an existing legacy connection keep deploying until November 30, 2026. It doesn't allow new legacy connections. While emergency access is active, the **Reconnect Firebase Project** banner shows the end date. ## Connect to Firebase on Creating a New FlutterFlow Studio Project If you know you'll be integrating Firebase as you create your project, you can do the following: #### Step 1: Create a new project and enable Firebase First, create a new project, and while doing so, keep the Setup Firebase option enabled and click Next Step. Alt text #### Step 2: Connect to Firebase If you'd like FlutterFlow Studio to create a Firebase project for you, click **"+ Create Project"** and follow the [related steps](#create-a-new-firebase-project-from-flutterflow-studio). Alternatively, if you wish to connect an existing Firebase project manually, please follow the [manual steps here](#connect-an-existing-firebase-project-manually). #### Step 3: Enable Authentication Turn on the Enable Authentication to allow users to log into your app using various sign-in methods, including email and password, social media providers, and even phone number. **Note:** this step only enables authentication. You will need to complete an additional setup to implement authentication logic later. Enable Authentication During Project Creation ## Enable Firestore for Database Access If you plan to use Firestore Database as your backend, follow these additional steps to enable Firestore. This will allow you to create collections and add documents directly from FlutterFlow Studio. To configure Firestore Database: 1. From the Firebase dashboard of your project, navigate to the far left menu. Under Build, select Firestore Database and then select Create Database (marked in yellow in the screenshot). Alt text 2. Next, you will need to set your **Firebase security rules**. To get started quickly, you can select Start in test mode and select Next. Alt text :::note We recommend updating your Firebase security rules before deploying your app. Please see [this link](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules) for additional information on Firestore security rules. ::: 3. Next, you will need to choose the location where your Firestore data will be stored. From the dropdown, select a location and then select Enable. Please see this link for additional information on Firebase locations. Alt text On completion, you land at the panel view of Cloud Firestore and can start creating collections and documents right away! ### Adding Indexes Deploying indexes is necessary to perform certain queries in your Firestore database. Firestore automatically adds indexes for the most basic queries. However, when you apply both filtering and ordering while querying a collection, an index is necessary, and a warning will be generated to add it. We create indexes for you. The only thing you need to do is deploy them to your Firestore database. Here are the steps to deploy indexes. - Click on the Firestore from the Navigation Menu (left side of your screen). - Switch to the **Settings** tab. - Scroll down to the **Firestore Indexes** section and click on **Deploy**. :::caution[Please note] If you add a filtering/ordering on the query or change the existing filtering/ordering settings, you should deploy the Firestore Indexes again. :::
## Enable Billing If you want to deploy [Cloud Functions](https://firebase.google.com/products/functions) (e.g., Braintree payments, Push Notifications) or use [Firebase Cloud Storage](https://firebase.google.com/products/storage), you will need to enable billing for your Firebase project. Please follow these steps to enable billing: 1. From the Firebase dashboard of your project, navigate to the far left menu. Under Build, select **Functions** and then select **Upgrade project**. 2. Select **Purchase**. If this is your first time enabling billing, you will be taken to a new page to provide your payment information. Otherwise, you can set a project budget. Please see [this link](https://firebase.google.com/pricing) for additional information on Firebase pricing. Alt text # Remote Config > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/firebase/remote-config Learn how to integrate Firebase Remote Config in your FlutterFlow Studio app. [Firebase remote config](https://firebase.google.com/docs/remote-config) allows you to control your app's behavior and appearance without pushing an app update. For example, you could use it to change or show/hide certain elements of your app, such as a promo banner and Santa hat, or use it as a feature flag (payments, food delivery) with no need to publish an app update. ![Using Firebase Remote Config to show/hide a feature](https://docs.flutterflow.io/assets/images/show-hide-fi-2c2cc22236d36e12d343efc5e727a8f5.avif) When you enable the Remote Config, you must specify the parameter in our builder (called 'in-app defaults') and inside the Remote Config dashboard of your [Firebase console](https://console.firebase.google.com/). When the app starts, it fetches config values from the Firebase console, and for any reason, if it fails, your app will use the in-app defaults. :::caution The app will try to fetch values every time it starts. However, due to the minimum fetch interval of 1 hour (set by default), the values won't be fetched more than once in 1 hour. ::: ## Using Firebase Remote Config Follow the steps below to use the Remote Config: ### 1. Enable Remote Config To enable Remote Config, navigate to **Settings and Integrations** > **Project Setup** > **Firebase** > Expand the **Remote Config** section and **Enable Remote Config**. ![Enabling Remote Config](https://docs.flutterflow.io/assets/images/remote-config-d8b616f9817002cfc3f28ac542a0e971.avif) ### 2. Add parameter in Firebase Console You will be able to dynamically control your app using the parameters created in the Firebase Console of your project. To create the parameter: 1. Navigate to the [Firebase Console](https://console.firebase.google.com/u/0/) > Enagage > Remote Config** page. 2. If this is the first time, click **Create configuration** button. 3. Click **Add parameter**. This will open the **Create parameter** section on the right side. 4. Enter the **Parameter name** (e.g., *show_promo_banner*, *primary_color*, etc.). 5. Set the **Data type** among the *String*, *Number*, *Boolean*, and *JSON*. 6. Set the **Default value**. 7. If you enable the **Use in-app default** toggle, any change made to this parameter from here won't be reflected in your app. Instead, your app will use values from the parameters defined in our builder (see how to create it in the [next step](#3-add-parameter-in-flutterflow-studio)). 8. Click **Save**. 9. Click **Publish Changes** to make this parameter immediately available to your app.

### 3. Add parameter in FlutterFlow Studio Parameters added to your FlutterFlow Studio project are called in-app defaults. To add them: 1. Navigate to **Settings and Integrations** > **Integrations** > **Firebase Remote Config**. 2. Click **+ Add Parameter**. A pop will open. 3. Enter the parameter **name**, select the **Data Type**, set its **Default Value**, and click **Create Parameter**. **Note**: The parameter name must match the name given in the [previous step](#2-add-parameter-in-firebase-console).

### 4. Use parameter Now you can access the newly created parameter from the **Set from Variable > Firebase Remote Config**. Here's an example of using the remote config parameter to set the [conditional visibility](https://docs.flutterflow.io/resources/ui/widgets/widget-commonalities#conditional) for the social login feature.

Here's another example that changes the app's background using the color value from the Remote Config parameter.

# Firebase Crashlytics > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/firebase/crashlytics Learn how to integrate Firebase Crashlytics in your FlutterFlow Studio app. [Firebase Crashlytics](https://firebase.google.com/products/crashlytics) is a crash-reporting tool that helps you catch errors. It enables you to troubleshoot the issue by logging the details, such as the exact line number that caused the error, device name, OS version, and time when the crash happened. To enable Firebase Crashlytics, navigate to **Settings and Integrations** > **Project Setup** > **Firebase** > Expand the **Crashlytics** section and **Enable Crashlytics**. Firebase Crashlytics only supports catching errors on mobile platforms (Android and iOS). You can see all the logged errors/crashes inside the Crashlytics dashboard of your [Firebase console](https://console.firebase.google.com/). There, you'll see the list of crashes (with the page name and line number that caused the issue), and you can filter it by their state, signal, device type, and OS. ![Crashlytics dashboard](https://docs.flutterflow.io/assets/images/crashlytics-dashboard-2d40f05759331f5b6b4b39142a44ec4f.avif) 1. Click on the issue name to see its details. 2. To test the crash on your app, [download the app](https://docs.flutterflow.io/flutterflow-cli/exporting), add a code that throws an error, and run it on a mobile device or emulator with an active internet connection. ![Test crash](https://docs.flutterflow.io/assets/images/test-crash-b03b9e0d185ce6ce1c38646edc09447b.avif) # App Check > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/firebase/app-check Learn how to integrate Firebase App Check in your FlutterFlow Studio app. [Firebase App Check](https://firebase.google.com/docs/app-check) is a new security feature for protecting the backend services of apps. It blocks traffic that comes from sources other than the registered app, ensuring that usage costs are not incurred for illegitimate usage. App Check works by using attestation services, which already exist for iOS, Android, and the web. The feature can protect three different types of backends, including Firebase backends like Cloud Firestore, Google API services like Cloud Run, and API endpoints of your own server. ## **Adding Firebase App Check** To add *Firebase App Check* to your app: 1. Navigate to the [Firebase Console](https://console.firebase.google.com/u/0/) > Build > App Check page. 2. If this is the first time, click the **Get started** button. ![Get started with App Check](https://docs.flutterflow.io/assets/images/get-started-e563b36a10af3562962ca8f78d842f5f.avif) 3. Now, you'll see the list of apps you have added to this Firebase project. To register attestation service(s), select the project, click **Register,** and then select attestation service. 1. For Android, you can select [Play Integrity](https://developer.android.com/google/play/integrity?authuser=1) and then follow step number 2 and 3 from [here](https://firebase.google.com/docs/app-check/android/play-integrity-provider?authuser=2#project-setup). 2. For iOS, you can choose from [Device Check](https://developer.apple.com/documentation/devicecheck) or [App Attest](https://developer.apple.com/documentation/devicecheck/establishing_your_app_s_integrity) and then follow step number 2 and 3 from [here](https://firebase.google.com/docs/app-check/ios/devicecheck-provider?authuser=2). 3. For the Web, select [reCAPTCHA v3](https://developers.google.com/recaptcha) or [reCAPTCHA Enterprise](https://cloud.google.com/recaptcha-enterprise) and then follow steps 2 and 3 from [here](https://firebase.google.com/docs/app-check/web/recaptcha-enterprise-provider?authuser=2#project-setup). **Note**: To run the app in Run/Test mode, you must register the **Web** version of the app as well. **Android**

**iOS**

**Web**

4. Ensure that enabling Firebase App Check [won't disrupt your existing legitimate users](https://firebase.google.com/docs/app-check/monitor-metrics?authuser=2). 5. Now, you can select the service you want to secure. Switch to the **APIs** tab, select the service, and click **Enforce** button. A popup may open, telling you that once enabled, it will deny all requests that do not have *App Check* token. Click **Enforce** again if you are ok. **Note** that it might take up to 15 minutes to start the enforcement.

6. Navigate back to FlutterFlow Studio and open **Settings and Integrations > Project Setup > Firebase >** scroll down and expand **App Check** section **>** switch on **Enable App Check** toggle. 7. You can fill out the optional details such as **reCAPTCHA Site Key** (you should have it while performing step 3.3) and [**Run/Test Mode Debug Token**](https://firebase.google.com/docs/app-check/flutter/debug-provider). To get the debug token, follow the steps below: 1. Navigate to the [Firebase Console](https://console.firebase.google.com/u/0/) > Build > App Check > Apps. 2. Open the app for which you want to generate the debug token. 3. Click three dots icon (i.e., overflow menu icon) and select **Manage debug token**. 4. Click **Add debug token**. 5. Give it a **Name** and click **Generate token**. 6. Copy the generated token and paste it in FlutterFlow Studio's designated field. 7. Click **Save**.

5. You might want to see if it works on a real device or an emulator. To run on a real device, you can set the **Android Provider** to **Play Integrity** and to run on an emulator, set it to **Debug,** and then try checking it by downloading the APK. 1. If it doesn't work for *Play Integrity*, ensure you have enabled the Play Integrity API. See how to do it in step 2 [here](https://firebase.google.com/docs/app-check/android/play-integrity-provider?authuser=1&hl=en#project-setup). 2. If it doesn't work for *Debug*, you can try [downloading the code](https://docs.flutterflow.io/flutterflow-cli/exporting), following the instructions [here](https://firebase.google.com/docs/app-check/flutter/debug-provider#android), and running it locally. :::tip To add the App Check on the app with the non-Firebase (i.e., your self-hosted) backend, follow the instructions [**here**](https://firebase.google.com/docs/app-check/flutter/custom-resource). ::: # Performance Monitoring > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/firebase/performance-monitoring Learn how to integrate Firebase Performance Monitoring in your FlutterFlow Studio app. [Firebase Performance Monitoring](https://firebase.google.com/docs/perf-mon) is a tool that *automatically* collects performance data from your app and provides insights through the Firebase console. It can monitor both network requests and specific parts of your code. Enabling performance monitoring is beneficial for: - **Identify Bottlenecks**: Discover where your app's performance is lagging. - **Improve User Experience**: Slow or unresponsive apps lead to a poor user experience. - **Data-Driven Decisions**: Make optimization decisions based on real performance data. - **Monitor Network Calls**: See how long network requests take, helping identify slow APIs or network issues. To enable performance monitoring, navigate to Settings and Integrations > Project Setup > Firebase > Open the Performance Monitoring section and Enable Performance Monitoring toggle. # Best Practices: Secure API Keys > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/best-practices/secure-api-keys Learn best practices for securing API keys in your FlutterFlow Studio app, including key restrictions, geographical restrictions, IP address binding, and service-specific limitations. Google Cloud API key restriction is essential for managing access and enhancing security when working with Google Cloud services. This overview explains how to effectively restrict API keys, allowing developers to control how and where their keys can be used. Developers can set geographical restrictions, bind keys to specific IP addresses, or limit usage to particular services. These measures ensure that API keys are secured, helping to protect projects and maintain optimal functionality. To minimize potential damage from compromised API keys: - **Add restrictions to your API key:** By setting restrictions, you can limit how an API key can be used, thus reducing the impact if it becomes compromised. - **Delete unnecessary API keys:** Remove any API keys that are no longer required to reduce exposure to attacks. - **Rotate your API keys periodically:** Regularly create new API keys, delete the old ones, and update your applications to use the new keys. This practice helps maintain security and limit the lifespan of any single key. ## Add restrictions to your API key API keys are unrestricted by default. Unrestricted keys are insecure because they can be used by anyone, from anywhere. You can add either [application restrictions](https://cloud.google.com/docs/authentication/api-keys?#adding-application-restrictions) or [API restrictions](https://cloud.google.com/docs/authentication/api-keys?#api_key_restrictions) to enhance security. In the following example, we will use the **Map API keys** and restrict them to specific platforms using their unique identifiers. At this stage, you should already have API keys created, but they are currently unrestricted. If they are not yet created, you can follow the integration process for any of the Google Cloud services we support in FlutterFlow Studio, or for Maps, [you can go here.](https://docs.flutterflow.io/integrations/google-maps/generate-maps-keys) All your created API keys should be available on the [Cloud Credentials Page](https://console.cloud.google.com/apis/credentials). (Ensure you are logged into the correct Google account and are in the right Google Cloud project.) Follow the steps below to enable the iOS key exclusively for iOS apps with a unique package name:
Now your iOS API Key will only work when accessed from your app with the given unique identifier. You can also restrict the API keys by **HTTP referrers** or **IP addresses**. Here's a quick overview from the official docs: ![app-restriction.png](https://docs.flutterflow.io/assets/images/app-restriction-85dca210a3d64c0162faf32140c4ffa0.png) :::note[Learn More] Learn more about **securing API keys for all platforms and restricting API usage** by visiting the official [**Google Cloud Docs**](https://cloud.google.com/docs/authentication/api-keys?#securing). ::: # Maps & Places APIs > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/google-maps/generate-maps-keys Learn how to generate and use Maps keys for Google Maps integration in your FlutterFlow Studio app. FlutterFlow Studio natively supports **Google Maps**, providing a seamless and efficient way to embed interactive maps into your FlutterFlow Studio apps. It also supports **Places API** that returns formatted location data and imagery about establishments, geographic locations, or prominent points of interest. ## Add Maps APIs To enable **Google Maps** in your project, please follow the steps: ### Get API Keys To start working with **Google Maps APIs**, you need to enable the **Maps API** from the [Google Cloud Console](https://console.cloud.google.com/). 1. As you land on the Cloud console, make sure you are in the correct Google Cloud project. Then, from the right menu, click on [**Library**](https://console.cloud.google.com/apis/library) and search for **Maps**. 2. You may receive a prompt from Google Cloud to add a billing account. Please add a billing account to continue. 3. You will see options such as the **Maps SDK for iOS, Maps SDK for Android**, and the **Maps Javascript API**. Select the platform you wish to support and then click **Enable**. If you are running on Run Mode, ensure that your Maps Javascript API is enabled.

:::caution To secure your API keys, refer to the [**Best Practices guide: Secure API Keys**](https://docs.flutterflow.io/best-practices/secure-api-keys) ::: - Click on the Credentials menu from the left panel. - Find the key for the platform you need, and copy the key. ### Add keys to FlutterFlow Studio Now add the API keys platform wise to FlutterFlow Studio Settings page ![g-maps-settings.png](https://docs.flutterflow.io/assets/images/g-maps-settings-fb9c10318d1871f824e906ac5929daa4.png) ### Create a new Key if not available If you don't find the Android key (auto created by Firebase) or iOS key (auto created by Firebase) in the Google developer console, here are the steps to create one: - On your Cloud console, click the **Credentials** menu on the left. - Click on the **+ Create Credentials** at the top. - Click on the **API Key** to create a new key for the Android app. Similarly, create one for iOS and Web.
## Add Places APIs You can [enable the **Places API**](https://console.cloud.google.com/apis/library/places-backend.googleapis.com) from your Google Cloud Console — make sure you are in the correct Google Cloud project. **Please note** that the current [PlacePicker widget](https://docs.flutterflow.io/integrations/google-maps/place-picker-widget) uses the legacy Places API. We plan to update the PlacePicker widget soon to support the new API. In the meantime, ensure that the legacy Places API is enabled for full functionality. ![places-api.png](https://docs.flutterflow.io/assets/images/places-api-75e9526626afcffa8bd5266aa4b37992.png) # Google Maps Widget > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/google-maps/google-maps-widget Learn how to add and configure the Google Maps widget in your FlutterFlow Studio app. The **Google Maps** widget enables the integration of interactive maps into your app, offering users valuable geographical insights. For instance, in a food delivery app, this widget could display the locations of restaurants. It offers a range of customization options, allowing you to tailor the display with various map types and markers to suit your specific needs. :::danger[Feature Completion] As we continuously enhance our platform, please note that while our integration is robust, it is not yet feature-complete. We encourage you to review the available APIs and features detailed below to ensure they meet your app development needs before integration. ::: ![google-maps-widget.png](https://docs.flutterflow.io/assets/images/google-maps-widget-36f25b917240de88b6192e5a0fe57418.png) :::note[Prerequisite] Ensure you have added the [**Google Map API keys**](https://docs.flutterflow.io/integrations/google-maps/generate-maps-keys#get-api-keys) before adding the Google Maps widget to your project ::: ## Add Google Map widget 1. Open the Widget Palette and locate the **Google Map** widget under the **Base Elements** tab. You can drag it to your desired location or add it directly from the widget tree or canvas area. 2. By default, the map displays a random location. To set a specific location, go to the **Properties Panel > Initial Location**. 3. Enter the latitude and longitude values in the **Lat and Lng** fields to specify the location. To use the user's current location, set a variable through the **Set Variable menu > Global Properties > Current Device Location**. 4. To change the map type, go to the **Properties Panel > Map Type** and select one of the following options: - **Roadmap:** Displays the default road map view. - **Terrain:** Shows a physical map based on terrain information. - **Hybrid:** Combines normal and satellite views. - **Satellite:** Displays satellite images from Google Earth. 5. To customize the visual appearance of your map, navigate to the **Properties Panel > Map Style**. 6. To set the **initial zoom level** of the map, go to the **Properties Panel > Initial Zoom** of Map and enter the desired value. Note that a higher value will zoom in on the map while a lower value will zoom out.
:::tip If you don't see your current location while testing, make sure you have enabled location permission in your browser. ![location-browser.png](https://docs.flutterflow.io/assets/images/location-browser-e5f61c7357f9afa44240d26841e467aa.png) ::: ## Markers A marker is an icon that appears over the map, indicating a location. To add markers: - Select the **Google Map** widget, move to the **Properties Panel > Num Markers** and select whether you want to show **Single** or **Multiple** markers. ### Set Markers from Firebase - Set the Marker Type to **Document** if the data is on Firestore Collection - In case of Documents, create a collection and query it on any widget (must be a parent of GoogleMap) or page. - In Marker Document, set the source of markers as shown in the following video.
### Set Markers from List of LatLng If you choose **LatLng**, you must provide a source that contains a list of locations as Data Type (LatLng) (e.g., App State > [variable_name] (List of **LatLng**)).
### Changing Marker Color To change the marker color, move to the Properties Panel > Google Map > set the Marker Color dropdown value to the color you like:

![marker-color.png](https://docs.flutterflow.io/assets/images/marker-color-06977322341a142ddc3bbe1f5b90b2d9.png) ### Set Marker Image Custom marker images can enhance your map interface by making it more intuitive and visually engaging, while also aligning with your app's branding. To set an image as a marker: - Move to the **Properties Panel > Google Map > set the Marker Icon to Image**. - Select the type of image you want to set: - For an image hosted online, set the Image Type to **Network** and specify the image URL in the Path field. - To provide an image from your system, set the Image Type to **Asset** and upload the image.
### Centering map on marker tap To center a map on a marker tap, move to the **Properties Panel > Google Map > enable the Centering Map on Marker Tap toggle**.
## On Marker Tap [Action Trigger] Sometimes, you might want to receive a callback when a user taps on a marker. This can be useful for dynamically displaying additional information about the location, opening a detailed view, or initiating other actions based on the selected marker. Here’s how you do it: - Select the **Google Map** widget. - From the Properties Panel, select **Actions** and open the **Action Flow Editor**. - Under the action trigger **On Marker Tap**, add any actions here. ![marker-tap.png](https://docs.flutterflow.io/assets/images/marker-tap-4a87b7d9ec158938bef841037f291923.png) ## Advanced Customizations You can customize the appearance and behavior of this widget using the various properties available in the properties panel. ### Allow Interacting With the Map By default, the map interaction feature is enabled, allowing users to drag, zoom in, and zoom out on the map. However, you can disable the **Allow Zooming the Map** and **Show Zoom Buttons** on the Map options if you wish to restrict the zoom functionality. To access these settings, navigate to the **Properties Panel > Google Map > Allows Interacting with the Map**.
#### Map Takes Gesture Preference When this is turned on, any gestures, such as zooming or dragging, will only affect the map, not the rest of the page. This is helpful if your map is inside a scrollable page, so users can interact with the map without accidentally scrolling the whole page. :::note This setting is only available if **Allow Interacting** and **Allow Zooming** are turned on. ::: **Map Takes Gesture Preference (Disabled)**

**Map Takes Gesture Preference (Enabled)**

### Show User Location When enabled, a blue dot appears on the map to indicate the user's current location. If the map is moved, users can re-center their location by clicking the button at the top right side. To enable this option, navigate to the **Properties Panel > Google Map > enable the Show User Location toggle**. :::note When you enable this option, make sure to set the **Initial Location to Global Properties > Current Device Location**. :::
### Showing Compass While exploring the map, users may rotate the map (which can make it difficult to trace the route). Enabling compass will allow users to bring the map to its original direction. To enable the compass, navigate to the **Properties Panel > Google Map > enable the Show Compass toggle**.
### Enabling map toolbar The Toolbar, located at the bottom right of the map, becomes visible when a user selects a marker. It offers quick access to either a map view or directions in the Google Maps mobile app. To enable the toolbar, navigate to the **Properties Panel > Google Map > enable the Show Map Toolbar toggle**.
### Showing Traffic on Map Showing traffic on the map allows user to know the flow of traffic on the roads and helps them decide on a better route. To show live traffic on a map, navigate to the Properties Panel > Google Map > enable the Show Traffic on Map toggle.
## FAQ
Why Google Maps custom markers are not working in run mode or test mode?

Due to a recent update, Google Maps custom markers won't work in Run or Test mode unless CanvasKit is enabled. This is expected behavior. To use custom markers effectively, enable CanvasKit from [**Advanced Web Settings**](https://docs.flutterflow.io/resources/projects/settings/project-setup#advanced-web-settings).

# Move Map Center [Action] > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/google-maps/move-map-center-action Learn how to use the Move Map Center action in your FlutterFlow Studio app to adjust the center of the Google Map. This action allows you to center the map on a specified location, such as setting the pickup and drop-off points. You can define the location either by directly inputting the latitude and longitude values or by using a variable. :::note[Prerequisites] - To implement this feature, add a Google Maps widget to your page or component. [**Learn how.**](https://docs.flutterflow.io/integrations/google-maps/google-maps-widget) - If you wish to enable users to select locations from a dropdown using FlutterFlow Studio's PlacePicker widget, you can also integrate the Place Picker widget into your map view. [**Learn more here**](https://docs.flutterflow.io/integrations/google-maps/place-picker-widget). ::: Assuming you've set up the Place Picker widget on your Google Maps widget view, let's add a button that triggers the action to move the map center, so the map centers on the newly selected location. In our example, we've added an IconButton with a location pin icon. For the button's OnTap action trigger, we'll add the Move Map Center action and set the LatLng to the LatLng of the Place Picker's selected place. You must check if the PlacePicker value (or the variable holding your new LatLng) is set before calling the Move Map Center action. ![move-map.png](https://docs.flutterflow.io/assets/images/move-map-365ef164a672a6e3878a06126998459f.png) # Place Picker Widget > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/google-maps/place-picker-widget Learn how to add and configure the Place Picker widget in your FlutterFlow Studio app. The `PlacePicker` widget is designed to retrieve information about places, such as establishments (e.g., buildings, parks, museums) and geographic features (e.g., roads, lakes, mountains). It provides details like name, address, city, state, country, zip code, and latitude-longitude coordinates. This widget is particularly useful in applications like cab booking services. For instance, it can be used to capture the exact location and full address of a destination, displaying this information on a page or integrating it into a Google Map. Visually, the PlacePicker appears as a button. When tapped, it enables you to search for a place by typing its name, and displaying a dropdown list of matching locations. Once a place is selected, its name is displayed on the button, and additional details are accessible through the placePickerValue variable from Widget State. Here's an example from the Demo app:

:::note[Prerequisites] - The Place Picker **requires a Google Maps API key**. See how to [**create and add API keys**](https://docs.flutterflow.io/integrations/google-maps/generate-maps-keys#add-maps-apis) to FlutterFlow Studio. - Ensure you have enabled the [**Places API**](https://docs.flutterflow.io/integrations/google-maps/generate-maps-keys#add-places-apis) from Cloud console. - Enable **Google Maps Platform Billing** via your Cloud console. Please note: Failing to enable the Google Maps Platform Billing will not show any place in an autocomplete list. :::
## Add Place Picker widget To add the PlacePicker widget to your project:

By default, the `Place Picker` widget features an icon and the text "Select Location" on the button. You can modify the styling and properties of these elements from the Properties Panel on the right. If you retain the Text widget, the text will update to the name of the selected location when a user makes a selection. Both the icon and text are optional; adjust them according to your design requirements.
![place-picker-properties.png](https://docs.flutterflow.io/assets/images/place-picker-properties-40c1481618f4452598a0fc7b9fd9aefa.png)
The widget properties of Place Picker widget
## Use PlacePicker Values The selected place’s details are stored in a `GooglePlace` custom data type provided by FlutterFlow Studio. You can access this via **Widget State > placePickerValue**, which includes fields like name, address, latitude/longitude (LatLng), city, state, country, and ZIP code. These values can be used to display content in Text widgets or perform conditional logic based on the selected location.

# Static Map Widget > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/mapbox/staticmap-widget Learn how to add and configure the StaticMap (Mapbox) widget in your FlutterFlow Studio app. The StaticMap widget shows an image of the map from the [mapbox](https://www.mapbox.com/). This widget is a good choice when you want to display a location on a map without interactivity or controls such as zoom-in, zoom-out, and map scrolling. :::tip To display a map with interactivity or controls, use the [**GoogleMaps**](https://docs.flutterflow.io/integrations/google-maps/google-maps-widget) widget. ::: ## Adding StaticMap widget Here's an example of how you can add the StaticMap widget to your project: 1. First, drag the **StaticMap** widget from the **Base Elements** tab (in the Widget Panel) or add it directly from the widget tree. 2. You'll need the Mapbox API key to render the map image. Get the API key by creating the [Mapbox account](https://account.mapbox.com/auth/signup/) and then return to FlutterFlow Studio, move to the properties panel, scroll down to the Static Map section and enter the key into the **Mapbox API Key** input box. 3. To display your location on the map, enter the **Latitude** and **Longitude** values inside the **Lat** and **Lng** input boxes. :::tip To get the lat long values for any location, open to Google Map, right-click on any place and click on the first item from the list. It should look like this `19.080045795863743`, `72.8794235725136`. :::

## Customization You can customize the appearance and behavior of the widget using the various properties available under the [properties panel](https://docs.flutterflow.io/flutterflow-ui/builder#navigation-menu). ### Changing the map style Changing the map style allows you to change the overall theme and type of the map, such as Light, Dark, Street, and Satellite. To change the map style: 1. Select **StaticMap** from the widget tree or the canvas area. 2. Move to the properties panel and scroll down to the **Static Map** section. 3. Find the **Map Style** property and choose among the *Light*, *Dark*, *Outdoor*, *Street*, *Satellite*, and *Detailed* *Satellite*.

### Set zoom, tilt, and rotation You can define the zoom level, adjust the map tilting and rotate the map as per your requirement. To set the zoom, tilt, and rotation value for the map: 1. Select **StaticMap** from the widget tree or the canvas area. 2. Move to the properties panel and scroll down to the **Static Map** section. 3. Find the **Map Zoom** property and set the value that is good enough to highlight the place. The value starts from 0 (which is a full zoom-out). To zoom in, set the higher value. 4. Find the **Map Tilt** property and enter the value to display the map in the sloping position. 5. Find the **Map Rotation** property and enter the value to rotate the map.

### Customizing marker By default, the marker is invisible on the map. You can make it visible by setting the marker color. You can also change the marker icon/image from the URL link. To customize the marker: 1. Select **StaticMap** from the widget tree or the canvas area. 2. Move to the properties panel and scroll down to the **Static Map** section. 3. To show the marker, find the **Map Marker Color** property, click on the box next to **Unset**, select the color, and then click **Use Color** or click on **Unset** and enter a Hex Code directly. 4. To display the custom marker image/icon, enter the URL into the **Map Marker URL** input box. This widget does not resize the marker image from the URL link. Make sure you provide the image with the appropriate size.

### Caching map image Enabling the cache will store the map image and display it when the internet is unavailable. To cache the map image: 1. Select **StaticMap** from the widget tree or the canvas area. 2. Move to the properties panel and scroll down to the **Static Map Image** section. 3. Find the **Cache** toggle and turn it on.

### Changing the box fit Changing the box fit value allows you to control how the map should display inside the StaticMap widget. Various options under the Box Fit property help you scale (grow or shrink in size) the map image. To change the box fit value: 1. Select the **StaticMap** from the widget tree or the canvas area. 2. Move to the properties panel (on the right side of your screen) and scroll down to the **Static Map Image** section. 3. Find the **Box Fit** dropdown, and try changing it to the other values.

# Launch Map > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/maps/launch-map Learn how to open Map app installed on your device from your FlutterFlow Studio app. Using this action, you can open the Map app installed on your device. For example, you could add this action on an event page to let users know more about the place inside the map apps like Google Maps, Apple Maps, and Waze app. You can specify the Lat Long details or full address of any place to access the additional information such as directions, call details, timings, photos, street view, reviews, and more.

## Types of Map apps This action lets you specify the type of map app to open. If it's not installed, the default map app of the platform will be used. For example, opening the Google Maps on iOS devices. If not installed, it will open the default Apple Maps app. You can launch the following types of maps apps: 1. **System Default**: Opens the default map app. That is opening Google Maps on Android devices and Apple Maps on iOS devices. 2. **Google Maps**: Google's default map app on Android devices. 3. **Apple Maps**: The default map app on iOS devices from Apple. 4. [**Waze**](https://play.google.com/store/apps/details?id=com.waze): App that tells you about real-time traffic, police, crashes, and more. ### Adding Launch Map [Action] Go to your project page on FlutterFlow Studio and follow the steps below to define the Action to any widget. 1. Select the **Widget** (e.g. Location icon, Address text) on which you want to define the action. 2. Select **Actions** from the Properties panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 1. Click on the **+ Add Action**. 2. On the right side, search and select the **Launch Map** action. 3. Set the **Preferred Map Type** among the **System Default**, **Google Maps**, **Apple Maps,** and **Waze**. 4. To open the map app using lat long: 1. Set the **Place Type** to **Location**. 2. Inside the **Location** section, enter the values in the **Latitude** and **Longitude** input boxes. You can also specify these values from a variable, such as an app state variable or a variable from an API response by clicking on the **Set from Variable**. 3. (Optional) To set the place name (which will be displayed when the map app is opened), Inside the **Title** section, enter the place name in the **Value** input box. To set it from the variable, click on the **Set from Variable**. 5. To open the map app using address: 1. Set the **Place Type** to **Address**. 2. Inside the **Address** section, enter the address into the **Value** input box. You can also specify the address from a variable, such as an app state variable, or a variable from an API response by clicking on the **Set from Variable**. 3. (Optional) To set the place name (which will be displayed when the map app is opened), Inside the **Title** section, enter the place name in the **Value** input box. To set it from the variable, click on the **Set from Variable**. 6. Click **Close**.

# Braintree > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/payments/braintree Learn how to integrate Braintree payments in your FlutterFlow Studio app. You can accept payments in your app using [Braintree](https://developer.paypal.com/braintree/docs/start/overview) (a service provided by PayPal) integration. This will also allow your users to pay directly using a credit card or using a service like PayPal, Google Pay, or Apple Pay

:::note[Prerequisites] Before starting to set up payments, make sure you have: - Completed all the steps of [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for your project. - Upgraded your Firebase project to [**Blaze Plan**](https://firebase.google.com/pricing). - Enabled [**Firebase Authentication**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) for your project. ::: :::note FlutterFlow Studio uses [**Firebase Cloud Functions**](https://firebase.google.com/docs/functions) to process a transaction using the selected service (Braintree/PayPal). ::: ## Braintree Integration Integrating the Braintree in your app comprises the following steps: ### 1. Setup payments integration Payments can be set up on FlutterFlow Studio using Braintree. You should always test your payment processing using a Sandboxed environment, before deploying them to a production environment. Follow the steps below to set up using Braintree: 1. Go to [Braintree Website](https://www.braintreepayments.com/). 2. **Sign up** for getting access to the Sandboxed environment. You might receive an email with the additional steps for completing the sign-up process. If you already have a Braintree account just **Log In**. 3. Navigate to the **Braintree Settings** page of your FlutterFlow Studio project by going to the **Settings and Integrations** > **In App Purchases & Subscriptions** > **Braintree**. 4. On this page, **Enable Braintree/PayPal** using the toggle. 5. Under the **Credentials (Sandbox)** section, you need to enter the **Merchant ID**, **Tokenization** **Key**, **Public Key** & **Private Key** of the Braintree account. 6. To get the required credentials, navigate to your Braintree account **Home** page. 7. Click the **gear icon** (top-right corner), select **Business**. From this page, you'll get the **Merchant ID**. 8. Now, go to the **API** page. Here, you'll get the **Public Key** & **Private Key**. 9. To generate a **Tokenization Key**, go to the **API** page, and click **Generate New Tokenization Key**. Copy the Key and enter it in the respective field of FlutterFlow Studio.

Finally, click **Deploy** to upload the Cloud Functions required for processing a payment using Braintree:

### 2. Enable Google Pay or Apple Pay (Optional) Completing the payment integration by following the above steps will allow you to accept payments using a credit card or a PayPal account. Additionally, you can accept payments using Google Pay or Apple Pay. To accept payments using Google Pay or Apple Pay, you'll need to enter the respective **Merchant ID** of the Google/Apple account in the *Braintree Settings* page > *Credentials (Sandbox)* section. 1. To know how to find the Google Pay Merchant ID, navigate to [this page](https://support.google.com/paymentscenter/answer/7163092). 2. Steps for configuring Apple Pay and getting access to the Apple Merchant ID are [here](https://help.apple.com/developer-account/#/devb2e62b839). ### 3. Trigger payment action In order to initiate a payment, you have to use the *Braintree Payment Action*. Follow the steps below to add this action to any widget: 1. Select the **widget** on which you want to apply the Action. 2. Select **Actions** from the Properties panel (right menu). 3. Click **+ Add Action** button. 4. Choose a gesture from the dropdown among ***On Tap**, **On Double Tap**, or* **On Long Press**. 5. Select the **Action Type** as ***Braintree Payment***. 6. Enter the **Amount** either by defining a ***Specific Value*** or ***From Variable***. 7. Under **Payment Method**, you can select ***Credit Card***, ***PayPal***, or ***Drop-In***. The *Drop-In* option lets users choose which payment method to use. If you want to use the *Credit Card* option follow the steps [here](#using-credit-card). 8. If you have chosen the **Drop-In** option, select the **Allowed Payment Types**. Using Google Pay or Apple Pay will require you to have their respective Merchant ID defined during the Payment Setup process. 9. Enter the **Currency Code** and you can define the optional parameters like **Tax Rate Percentage** and **Shipping Cost**. Enabling Apple Pay requires you to specify the **Country Code** in the respective field. :::caution Make sure the user is authenticated before triggering the Braintree Payment Action, otherwise, it will result in an error. You can follow the steps on [**this page**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) to set up Authentication. :::

#### Using Credit Card If you want to keep only the Credit Card option on your checkout page, you'll need to add the **Credit Card Form** widget to the page. Follow the steps below: 1. Select the **Payment Method** as ***Credit Card***. 2. Drag and drop the [**Credit Card Form**](https://docs.flutterflow.io/resources/ui/widgets/built-in-widgets/credit-card-form) widget onto the canvas. 3. You can modify the design of the form widget as per your app's needs. 4. Again select the **checkout button** to complete defining the Action. 5. Enter the **Currency Code** and you can define the optional attributes like **Tax Rate Percentage** and **Shipping Cost**.

### 4. Testing Braintree payments work on real Android devices or in emulators, and App Store purchases only work on real iOS devices. [This document](https://docs.flutterflow.io/testing/local-run) has instructions on how to run your app on an Android or iOS device. :::note The Braintree Payments cannot be tested in Preview Mode, Test Mode, or Run Mode. ::: To test your app before deployment: 1. Download and run your project as described [here](https://docs.flutterflow.io/testing/local-run). 2. To test the purchase, you can use any of these [basic test card numbers](https://stripe.com/docs/testing#cards). ### 5. Releasing to production Before you release the app to production, complete the following steps: 1. Create the Braintree Account (Not sandbox) and get the production credentials. 2. Add the **production credentials** in the FlutterFlow Studio *Braintree Settings* page > *Credentials (Production)* section. 3. Turn on the **Is Production** toggle present on that page. 4. Deploy the new Firebase Cloud Functions with the production credentials by clicking on the **Deploy** button. Now, you are ready to build and distribute your app with payments to production. # RazorPay > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/payments/razorpay Learn how to integrate Razorpay in your FlutterFlow Studio app. [Razorpay](https://razorpay.com/) is a leading online payment gateway widely used by businesses in India to accept and process digital payments securely. It provides a platform for merchants and businesses to integrate payment solutions into their websites and mobile apps. It allows customers to make online payments using various payment methods such as credit cards, debit cards, net banking, UPI (Unified Payments Interface), and digital wallets. :::caution Currently, publishing to the web with Razorpay enabled is restricted due to some regulations. :::

:::note[Prerequisites] Before starting to set up payments, make sure you have, 1. Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for your project. 2. Enabled [**Firebase Authentication**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) for your project. 3. Upgraded your Firebase project to [**Blaze Plan**](https://firebase.google.com/pricing). We use [**Firebase Cloud Functions**](https://firebase.google.com/docs/functions) to process a transaction. ::: ## Razorpay Integration Integrating Razorpay in your app comprises the following steps: 1. [Setup Razorpay](#1-setup-razorpay) 2. [Trigger Razorpay payment](#2-trigger-razorpay-payment-action) 3. [Testing](#3-testing) 4. [Releasing to production](#4-releasing-to-production) ### 1. Setup Razorpay Setting up the Razorpay payments includes creating an account, enabling test mode, acquiring the keys from your Razorpay account, and adding them to your project. :::caution You should always try out payments in a test mode before releasing them to your production application. Hence, the instructions below will guide you on how to get the test keys. ::: Here are the steps: 1. Create a new Razorpay account from [here](https://dashboard.razorpay.com/signup). If you already have an account, [log in](https://dashboard.razorpay.com/signin). 2. Once you are logged in, turn on the **Test Mode**. Test mode helps you simulate the payments without involving real money transactions.

![Enabling test mode](https://docs.flutterflow.io/assets/images/enable-test-mode-63e84f711a6ce23e85cbd75de80ff2c0.avif)

3. From the left side menu, select **Account & Settings** > Under **Website and app settings** section, select **API keys**. 4. If you're asked to add a website link but your app isn't published yet, you can temporarily publish it to a subdomain using our [web publishing](https://docs.flutterflow.io/deployment/web-publishing) feature. Later, you can update this to your actual domain in both FlutterFlow Studio and Razorpay.

![add-website-link](https://docs.flutterflow.io/assets/images/add-website-link-30819ee6335b8d13c0f6bc7aab70594a.avif)

5. Click **Generate Test Key** and copy the **Key Id** and **Key Secret**. To regenerate, click on **Regenerate Test Key** and choose how you want to deactivate the old key.

![Generate Test Key](https://docs.flutterflow.io/assets/images/generate-test-key-5421c844acd62e810d8a7be508ac4cb4.webp)

6. Return to the FlutterFlow Studio project, navigate to **Settings and Integrations** > **In App Purchases & Subscriptions** > **Razorpay**. Use the toggle to **Enable Razorpay Payments**. 7. Under **Test Credentials**, paste the **Key ID** and **Key Secret** obtained in the previous step. 8. Set your **Business Name**. 9. Click the **Deploy** button.

![deploy](https://docs.flutterflow.io/assets/images/deploy-453f7e6cbf49e55ada68eed897e46030.png) ### 2. Trigger Razorpay payment [Action] To initiate a payment using Razorpay, you must use the **Razorpay Payment** action. This action lets users process a payment inside your app using credit cards, debit cards, net banking, UPI (Unified Payments Interface), and digital wallets via Razorpay. Follow the steps below to add this action: 1. Select the widget (e.g., checkout button) on which you want to add the action. 2. 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 the **+ Add Action**. 3. Search and select the **Razorpay Payment** (under *Integrations*) action. 4. Enter or use a variable for specifying the total amount under the **Amount** section. **Note** that the value should be specified in the currency's smallest unit. - For example, *$24.99* should be passed as *2499* (as a round-off integer; otherwise, it would be automatically rounded); similarly, for an amount of ₹120.00, 12000 should be passed. - Most probably, you'll specify this value from a variable. If you do so, you might need this [inline function](https://docs.flutterflow.io/resources/functions/utility#inline-function-code-expressions) to convert the total amount in the required format: `amount.toStringAsFixed(2).replaceAll(".", "");` 5. Enter the **Currency Code** to be used for the amount, for example, *INR*, *USD*, *EUR*, or *BRL*. Make sure you enter a valid currency code; otherwise, the transaction won't go through. Download the complete [list of supported currencies](https://razorpay.com/docs/build/browser/assets/images/international-currency-list.xlsx).

![Specifying amount and country code manually](https://docs.flutterflow.io/assets/images/specify-amount-and-code-manually-d3b5f57866da6b052eb72fd5706fa61d.avif)

6. With this action, you can also add some optional fields, such as **Receipt Number**, **Description**, **User Name**, **User Email**, **User Contact**, and **Timeout** (time for which the checkout dialog should remain active. By default, it is 180 seconds).

7. You can also customize the color scheme for the payment sheet using properties such as **Dialog Color, Barrier Color,** **Text Color**, **Processing Color**, **Success Color**, **Error Color,** and more.

![Customizing Razorpay payment sheet](https://docs.flutterflow.io/assets/images/customize-payment-sheet-b2c3a55da1a85dbc4cd3d088f7e65949.avif) 8. Enter an **Action** **Output Variable Name** where the payment ID would be stored on a successful transaction. 9. Now you must check if the payment was successful. You can do so by adding the [conditional action](https://docs.flutterflow.io/resources/functions/conditional-logic#conditional-actions). To do so, click the "**+**" button below the previous action tile and select **Add Conditional**. 10. On the right side (**Set Condition for Action**), 1. Select **UNSET** > **Condition** > **Single Condition**. 2. **First Value** > **Action** **Output Variable Name**. 3. Set the operator to **Is Set and Not Empty**. 11. Under the **TRUE** section, add an action that will be triggered if the payment is successful. 12. Under the **FALSE** section, add an action that will be triggered if payment is failed.

:::caution Ensure the user is authenticated before triggering this action; otherwise, it will result in an error. You can follow the steps on [**this page**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) to set up Firebase Authentication. ::: ### 3. Testing You can test Razorpay payments on Run mode, Test mode, an emulator/Simulator, or a physical device. To test payments in Test or Run mode: 1. In your FlutterFlow Studio project, navigate to **Settings and Integrations** > **In App Purchases & Subscriptions** > **Razorpay**. 2. Make sure the **Is Production** is disabled. 3. Make sure you have entered the correct **Test Credentials**. 4. Run your app in [Test mode](https://docs.flutterflow.io/testing/run-your-app#test-mode). 5. To test the purchase, you can try any method from [here](https://razorpay.com/docs/payments/payments/test-card-upi-details/#test-card-for-international-payments). ### 4. Releasing to production Once you are done testing your Razorpay integration and you are ready to go **live**, follow the steps below: 1. Complete **KYC** (or the [Activation Form](https://dashboard.razorpay.com/app/activation?ref=blog.flutterflow.io)) to access the Razorpay Live API. 2. Log into the [Razorpay Dashboard](https://dashboard.razorpay.com/?ref=blog.flutterflow.io#/access/signin) and switch to **Live Mode** on the menu. 3. From the left side menu, select **Account & Settings** > Under **Website and app settings** section, select **API keys**. 4. Click **Generate Live Key** and copy the **Key Id** and **Key Secret**. To regenerate, click on **Regenerate Live Key** and choose how you want to deactivate the old key. 5. Return to the FlutterFlow Studio project, navigate to **Settings and Integrations** > **In App Purchases & Subscriptions** > **Razorpay**. Turn on the **Is Production**. 6. Under **Production Credentials**, paste the **Key ID** and **Key Secret** obtained in the previous step. 7. Click the **Deploy** button. 8. [Test](https://docs.flutterflow.io/testing/run-your-app#test-mode) your app. # RevenueCat > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/payments/revenuecat Learn how to integrate RevenueCat payments in your FlutterFlow Studio app. [RevenueCat](https://www.revenuecat.com/) simplifies implementing in-app purchases and subscriptions by handling all purchase validation operations. :::caution[Pub.Dev package and Limitations] The [**underlying package for RevenueCat**](https://pub.dev/packages/purchases_flutter) does not support web. Any functionality related to in-app purchases or subscriptions managed through RevenueCat will not be available on web platforms. :::

## Setup RevenueCat To set up the RevenueCat, follow these steps carefully: 1. Sign up for a new RevenueCat account [here](https://app.revenuecat.com/). 2. [Create a project](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-create-a-project), [add your app](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-add-an-app--platform), and ensure that you [add service credentials](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-service-credentials) to help RevenueCat communicate with the app stores on your behalf. 3. [Create subscriptions](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-store-setup) in the respective stores. 1. While creating subscriptions in Google Play Console, if you see a message saying '***Your app doesn't have any in-app products yet**'* like in this picture, follow the steps below:

![error-while-creating-sub-in-play-console.avif](https://docs.flutterflow.io/assets/images/error-while-creating-sub-in-play-console-602d9fd2b8458217070b1dc3ad49b334.avif) 1. Return to FlutterFlow Studio and navigate to **Settings & Integrations >** **In App Purchases & Subscriptions >** **RevenueCat**. 2. Switch on the **Enable RevenueCat**. For now, just enter any random string as your API Key (eg. `testkey`). We’ll update this later. 3. Now, from the toolbar menu, click **Download APK** 4. In the Play Console, create a [Closed testing](https://play.google.com/console/about/closed-testing/) track and create a new release. 5. Upload your **App Bundle** or **APK**, enter the release name, and create the release. 6. Open the **Subscriptions** tab again. It should let you manage subscriptions now. 4. [Create Products and Entitlements in RevenueCat](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-configure-products-and-entitlements-in-revenuecat). ### Enable RevenueCat in FlutterFlow Studio To enable RevenueCat in FlutterFlow Studio, follow the steps below:

## Displaying Subscription Details in Your App To show in-app purchase and subscription information — such as pricing, product name, and description — within your app’s UI, you'll need to fetch these details from RevenueCat using the appropriate API or method. Here is an example of retrieving monthly subscription details:

## RevenueCat Actions To manage in-app purchases and subscriptions inside your FlutterFlow Studio app, you have to use the RevenueCat Actions. Below are the types of RevenueCat actions: - **Paywall** - **Purchase** - **Restore Purchases** ### Paywall [Action] This action checks whether a user has purchased an item. If not, you can open the Paywall (asking to buy an item or purchase a subscription). Follow the steps below to see if a user is subscribed and take action accordingly.

### Purchase [Action] This action allows you to purchase the item. Here’s how you add it:

### Restore Purchases [Action] Using this action, you can allow users to re-activate the subscription they have already paid for. This is helpful when a user has reinstalled the app or logged in to a new device. :::note - A good practice is to allow users to manually restore the purchase by showing a button or text (maybe on a paywall/settings page). - If you provide this option, please check [**How RevenueCat should respond to restore behavior**](https://www.revenuecat.com/docs/restoring-purchases#restore-behavior). ::: :::caution[Android apps without login] If your Android app doesn't use authentication, users can only get back a one-time purchase through **Restore Purchases** if the product is non-consumable. Before you rebuild the app, check in the RevenueCat dashboard that each permanent one-time product is set up as non-consumable. Apps built with FlutterFlow Studio use RevenueCat SDK version 10, which no longer restores consumed purchases. For details, see [Restoring consumable purchases](https://www.revenuecat.com/docs/known-store-issues/play-billing-library/restore-consumable-purchases-bc8). :::
![adding-restore-purchase-action.avif](https://docs.flutterflow.io/assets/images/adding-restore-purchase-action-59390e74c4e0be5f07c417cfa440c923.avif)
Adding action to restore purchase
## Testing Subscriptions You can test your subscriptions using sandbox environments, which simulate real store behavior without incurring costs. Check out the full **[Sandbox Testing Guide](https://www.revenuecat.com/docs/test-and-launch/sandbox)** for more details. Before going live, make sure to review **[RevenueCat’s Launch Checklist](https://docs.revenuecat.com/docs/launch-checklist)** to ensure everything is properly set up for production. ## FAQs
I don't see offerings or products

If you're testing in the sandbox and the products are not retrieved from Apple/Google, it's likely a configuration issue. To resolve this, ensure the following: 1. The product identifier set in RevenueCat matches exactly with the store. 2. You're testing on a physical device and not a simulator. 3. The bundle ID in Xcode [iOS] or package name [Google] matches what's in App Store Connect or Google Play Developer console. For iOS only, ensure that products are in the 'Ready To Submit' or 'Approved' state, you've signed your 'Paid Applications Agreement', and you're not using a StoreKit Configuration file. For Google only, ensure that the subscription product is in the Active state, your app is published on a closed track, and you've added a tester. See more details [here](https://community.revenuecat.com/sdks-51/why-are-offerings-or-products-empty-124).

## Looking for other options? If you're looking for other tools to manage in-app subscriptions, [**Adapty**](https://adapty.io/) is a solid alternative to RevenueCat — it offers advanced analytics, paywall A/B testing, and seamless integration with iOS and Android apps. You can explore the [**Adapty Library on our Marketplace**](https://marketplace.flutterflow.io/item/Mf1oFJcqngHzERZSPNA8) — it's actively maintained by the Adapty team and always kept up to date. # Stripe > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/payments/stripe Learn how to integrate Stripe in your FlutterFlow Studio app. Stripe helps integrate payment processing into your FlutterFlow Studio app. Using this payment service, you can easily sell products directly inside your application and manage transactions easily. While using Stripe as the payment provider, users can buy products using credit cards, Apple Pay, or Google Pay.

:::note[Prerequisites] Before starting to set up payments, make sure you: 1. Complete [**Firebase Setup**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) for your project. 2. Enable [**Firebase Authentication**](https://docs.flutterflow.io/integrations/authentication/firebase/initial-setup) for your project. 3. Upgrade your Firebase project to [**Blaze Plan**](https://firebase.google.com/pricing). We use [**Firebase Cloud Functions**](https://firebase.google.com/docs/functions) to process a transaction. ::: ## Stripe Integration Integrating the Stripe Payments in your app comprises the following steps: 1. [Setup Stripe payment](#1-setup-stripe-payment) 2. [Apple Pay setup (optional)](#2-apple-pay-setup-optional) 3. [Trigger Stripe payment](#3-trigger-stripe-payment-action) 4. [Testing](#4-testing) 5. [Releasing to production](#5-releasing-to-production) ### 1. Setup Stripe Payment Setting up the Stripe payment includes acquiring the keys from your Stripe account and adding them to FlutterFlow Studio. :::caution You should always try out payments in test mode before releasing them to your production app. Hence, the instructions below will guide you on how to get the test keys. ::: Follow the steps below to set up payment using Stripe: 1. Create a new **Stripe account** from [here](https://dashboard.stripe.com/register). If you already have an account, [login](https://dashboard.stripe.com/login). 2. From the dashboard page, click **Developers**. 3. Enable **Test Mode** (top right side of your screen). 4. Switch to the **API keys** tab. 5. Return to the FlutterFlow Studio project and navigate to **Settings and Integrations** > **In App Purchases & Subscriptions** > **Stripe**. Use the toggle to **Enable Stripe Payments**. 6. Copy the **Publishable Key** and **Secret Key** from the Stripe API keys page and paste them into the respective fields inside FlutterFlow Studio. If you are using Stripe in test mode, make sure you paste them inside the **Test Credentials** section. 7. Under the **Additional Settings**, you need to specify the following: 1. **Merchant Display Name** (*Required*): Enter a name for the merchant (you) that the user will see while performing the payment. 2. **Merchant Country Code** (*Required*): Enter your country code. This must be the 2 digit ISO country code, such as US, IN, and AU. 3. **Apple Merchant ID** (*Optional*): You need to enter this if you want to accept payments through Apple Pay as well. The instructions for using Apple Pay are in [this section](#2-apple-pay-setup-optional). 8. Click **Deploy**.

This would deploy the Stripe payment service as a Firebase Cloud Function. Now, you are ready to trigger payments inside your app. ### 2. Apple Pay Setup (optional) Setting up Apple Pay comprises the following steps: 1. [Creating Apple Merchant ID](#21-creating-apple-merchant-id) 2. [Uploading Payment Certificate in Stripe](#22-uploading-payment-certificate-in-stripe) 3. [Adding Apple Merchant ID in FlutterFlow Studio](#23-adding-apple-merchant-id-in-flutterflow-studio) #### 2.1 Creating Apple Merchant ID To create Apple Merchant ID: 1. Go to Apple's Developer Center and select [**Certificates, Identifiers & Profiles**](http://developer.apple.com/account). 2. Under **Identifiers**, select ***Merchant IDs***. 3. Click the **Add button** (+) in the upper-right corner. 4. Enter a **Description** and specify an **Identifier**. The identifier is usually defined in the format `merchant` followed by the *Package Name* of your app (you'll find it inside the ***Settings and Integrations*** page of FlutterFlow Studio), for example, `merchant.com.domainname.appname`. 5. Click **Continue**. 6. Review the settings, and click **Register**. 7. Click **Done**. 8. Now, again under **Identifiers**, select ***Apps IDs***. 9. Select your app's identifier from the list. 10. Under **Capabilities**, check the ***Apple Pay Payment Processing*** option. 11. Click **Configure**. 12. Select the merchant account that you just created, and click **Continue**. 13. Click **Save** and then **Confirm** in the dialog.

#### 2.2 Uploading Payment Certificate in Stripe To upload a payment certificate in Stripe: 1. First, go to the [**Settings**](https://dashboard.stripe.com/settings) page from your Stripe dashboard and select the **Payment methods** option. 2. Expand the **Apple Pay** tab under the **Wallets** section. 3. Click **Configure** to navigate to the [**Apple Pay settings**](https://dashboard.stripe.com/settings/payments/apple_pay) page. 4. Under **iOS certificates**, click **+ Add new application**. 5. This will download the **Certificate Signing Request (CSR)** file on your system and click **Continue**. 6. Select the **Merchant ID** with which you want to associate this certificate, and click **Create Certificate**. 7. Follow the instructions to **upload the CSR file** that you downloaded from Stripe. 8. To enable the certificate, click **Activate**. Then click **Download** to save it locally. 9. Go back to the Stripe page where the dialog box is displayed, and click **Continue**. 10. Upload the new certificate file. 11. Once uploaded, you should see the certificate listed under **iOS certificates**. #### 2.3 Adding Apple Merchant ID in FlutterFlow Studio To add Apple Merchant ID in FlutterFlow Studio: 1. Navigate to **Settings and Integrations** > **In App Purchases & Subscriptions** > **Stripe**. 2. Under the **Additional Settings**, enter your **Apple Merchant ID**. ![Adding Apple Merchant ID in FlutterFlow Studio](https://docs.flutterflow.io/assets/images/adding-apple-merchant-id-d00eed09f3715d39b10df09e118fedde.png) ### 3. Trigger Stripe Payment [Action] In order to initiate a payment using Stripe, you have to use the **Stripe Payment** action. Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Container, Button, etc.) on which you want to add the action. 2. Select **Actions** from the Properties panel (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 3. Click on the **+ Add Action**. 4. On the right side, search and select the **Stripe Payment** (under *Integrations*) action. 5. Enter or use a variable for specifying the total payment amount under the **Amount** section. The value should be specified in the currency's smallest unit. For example, *$24.99* should be passed as *2499* (as a round-off integer, otherwise it would be automatically rounded), whereas *¥1925* can be simply passed as *1925*. For more information check out [this page](https://stripe.com/docs/currencies#zero-decimal). 6. Enter the **Currency Code** to be used for the amount, for example, *USD*, *EUR*, *BRL*. Make sure you enter a valid currency code otherwise, the transaction won't go through. 7. Next, you need to specify the **Customer Email** (required) and **Customer Name** (optional) to be used for the transaction. You can either use a variable or enter the value for them. If you are using authentication, these two values can be retrieved from the ***Authenticated User**.* 8. Specify a **Description** of the purchase for both your and the user's record. 9. To enable **Google Pay** or **Apple Pay** as the payment method, turn on the respective toggle. To use Apple Pay, you have to set up a *Merchant ID* by following the steps [here](#2-apple-pay-setup-optional). 10. Select the **Payment Sheet Theme** among ***System Default***, ***Light Theme***, or ***Dark Theme**.* 11. Specify the **Primary Button Color** and **Button Text Color** to be used on the payment dialog. 12. Enter an **Output Variable Name** where the payment ID would be stored on a successful transaction. Later, you can use this variable elsewhere inside the page or pass it to a different page of the app. :::caution Make sure the user is authenticated before triggering the Stripe Payment Action. Otherwise, it will result in an error. :::

### 4. Testing You can test Stripe payments on mobile and the Web before deployment. To do that: 1. Go to the FlutterFlow Studio project and navigate to **Settings and Integrations** > **In App Purchases & Subscriptions** > **Stripe**. 2. Make sure the **Is Production** is disabled. 3. Make sure you have entered the correct **Test Credentials,** such as **Publishable Key** and **Secret Key**. 4. [Download](https://docs.flutterflow.io/flutterflow-cli/exporting) and [run](https://docs.flutterflow.io/testing/run-your-app) your project.. 5. To test the purchase, you can use any of these [basic test card numbers](https://stripe.com/docs/testing#cards). ### 5. Releasing to Production Before you release the app to production, complete the following steps: 1. [Login](https://dashboard.stripe.com/login) to your Stripe account and navigate to the **Developers** page. 2. Disable the **Test Mode** (top right side of your screen). 3. Select **API keys** from the left menu and copy the **Publishable Key** and **Secret Key**. 4. Return to FlutterFlow Studio; under the **Production Credentials** section, paste the **Publishable Key** and **Secret Key**. 5. To deploy the Android app, follow the [Google Play Store Deployment](https://docs.flutterflow.io/deployment/google-playstore-deployment) guide. 6. To deploy the iOS app, follow the [App Store Deployment](https://docs.flutterflow.io/deployment/apple-app-store-deployment) guide. --- ## FAQs
I am getting "Error: Unknown error occurred"

When encountering the "Error: Unknown error occurred" message, consider these troubleshooting steps: 1. **Stripe Settings Adjustment**: In FlutterFlow Studio's Stripe settings, verify the Merchant country code is a 3-digit code, like "USA" instead of "US". If needed, remove previously deployed functions in the Firebase console and redeploy them after updating the country code. 2. **User Authentication Requirement**: Stripe payments require an authenticated user session. Ensure you're attempting the Stripe action after a user has successfully logged in to the app. 3. **Cloud Functions Permissions**: Check that your cloud functions have the **Cloud Functions Invoker** permission set for **allUsers** in the Google Cloud console. To do this, go to the Cloud Console, directly search for the **initStripePayment** function, open the function, switch to the **Permissions** tab, and confirm the permissions status. This permission is typically assigned by default, but it's good practice to double-check. ![unknown-error-occured](https://docs.flutterflow.io/assets/images/unknown-error-occured-b03b43f1bf942dbbd98e2685f95a4ebd.avif)

# Simple Search > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/search/simple-search Learn how to implement simple search functionality in your FlutterFlow Studio app to search local data on a device. The simple search allows you to search the data present locally on a device. For example, you could search from the list of strings (stored in a variable) and from the Firestore collection and documents already retrieved on the user's device (displayed on the screen). :::caution[When to use Simple Search vs Algolia] We advise using a simple search only for the smaller Firestore collection (with limited records). Otherwise, it can be slow and/or expensive. For a more extensive collection, consider using the [**Algolia search**](https://docs.flutterflow.io/integrations/search/algolia-search). :::

## Types of Simple Search There are three types of search you can add to the page: - **Firestore collection**: To search from the Firestore collection. - **Documents**: To search from the list of documents stored in a variable. - **Strings**: To search from the list of strings stored in a variable such as app or page state variable. ## Simple Search [Action] Follow the steps below to add this action to any widget. 1. Select the **Widget** (e.g., Button) on which you want to define the action. 2. Select **Actions** from the [Properties Panel](https://docs.flutterflow.io/flutterflow-ui/builder#properties-panel) (the right menu), and click **Open**. This will open an **Action Flow Editor** in a new popup window. 1. Click on the **+ Add Action**. 2. On the right side, search and select the **Simple Search** action. 3. Select the **Search Type** among the **Firestore Collection**, **Documents**, and **Strings**. 4. If you select the **Firestore Collection**: 1. Set the **Collection** to the one that you want to search from. 2. **Select Searchable Fields** to the field that you want to perform the search on. 5. If you select the **Documents**: 1. Set the **Source** to the variable that holds the list of documents. For example, the result of the query at a top-level widget such as **Page** or **Column** 2. **Select Searchable Fields** to the field that you want to perform the search on. 6. If you select the **Strings**: 1. Set the **Source** to the variable that holds the list of strings (e.g., app or page state variable). 7. Inside the **Search Term** section, set **Widget State > TextField** (where users enter a search term).
# Algolia > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/search/algolia-search Learn how to implement algolia search functionality in your FlutterFlow Studio app. [Algolia](https://www.algolia.com/) is a powerful search-as-a-service platform that provides lightning-fast and highly relevant search capabilities. Integrating Algolia into your FlutterFlow Studio app allows you to implement real-time search functionality, making it easier for users to find relevant information within your app. :::note[Prerequisites] - Algolia integration in FlutterFlow Studio is tied exclusively to Firestore collections. This means you must [**setup Firebase**](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) to sync data from Firestore into Algolia for searching. - **Upgraded** your Firebase project to the [**Blaze Plan**](https://firebase.google.com/pricing) for the Algolia Firebase Extension to work. - Have at least one **Firestore Collection** on which you want to perform the search queries. ::: ## Algolia integration Follow the steps below to integrate Algolia in your FlutterFlow Studio apps: ### Setup Algolia Setting up Algolia involves creating an application, defining an index, and generating an API key with the necessary permissions. Here are the steps in detail: #### Step 1: Create an Algolia Application Login to [Algolia](https://www.algolia.com/). If you don’t have an account, sign up for a free account [here](https://www.algolia.com/users/sign_up). During registration, fill in the required details and select a **data center region**. After signing up, you’ll be presented with an **import data screen**, but you can skip this for now (see button at the top right). Next, name your application by navigating to **Settings > Applications** in the Algolia dashboard. By default, you should see an application called **"(unnamed application)"**. Click the three-dot button beside it, select **Rename**, enter a name for your application, and click **Save**.

#### Step 2: Create an Index An **index** in Algolia is like a **database table** where your searchable data is stored. To create an index, go to the **Search** section in the left menu, then select **Index**. Click on **Create Index**, and **provide an exact name that corresponds to the Firestore collection** on which you intend to perform the search queries.

#### Step 3: Generate an API Key To integrate Algolia, you need an **API key** with the correct permissions. In the Algolia dashboard, go to **Settings > API Keys > All API Keys**, then click **New API Key**. Under **Indices**, select the index you created in the previous step. In the **ACL (Access Control List)** field, include these permissions: `addObject`, `deleteObject`, `listIndexes`, `deleteIndex`, `editSettings`, and `settings`. Click **Create**, then copy the generated API Key and keep it handy—you’ll need it next to [configure Algolia Firebase Extension](#sync-firebase-data).

### Sync Firebase Data To sync your data from Firebase to Algolia, you must install [Algolia Firebase Extension](https://extensions.dev/extensions/algolia/firestore-algolia-search). It allows you to seamlessly connect **Cloud Firestore** with **Algolia**, ensuring that any updates, additions, or deletions in Firestore are instantly reflected in your search index. Follow these steps to set up the official Firebase extension for Algolia search: 1. **Open Firebase Extensions:** Go to the [**Search Firestore with Algolia**](https://extensions.dev/extensions/algolia/firestore-algolia-search) extension page, then click **Install in Firebase Console**. Choose your project to proceed with the installation. 2. **Update Extension Instance ID (Optional)**: An extension instance ID uniquely identifies each installed instance of an extension within your Firebase project. This ID is used to manage the extension instance, including updating or uninstalling it. 3. **Review Billing and Usage:** A summary of billing details will appear. After reviewing, click **Next**. 4. **Review APIs Enabled and Resources Created:** This extension automatically creates some resources like Cloud Functions and APIs to interact with Algolia. Check the listed resources, then click **Next**. 5. **Review Access Granted to this Extension:** You'll be presented with a list of specific services and resources that the extension needs access to. Review the permissions, then click **Next**. 6. **Configure Extension:** During installation, you'll be prompted to provide the following details. - **Collection Path**: Specify the name of the Firestore collection you want to index for search. - **Indexable Fields (Optional)**: You can leave this blank to index all fields or manually list fields you want indexed. - **Force Data Sync (Optional)**: You can enable this to ensure that the extension performs an additional read operation from Firestore before processing and sending data to Algolia. It guarantees that the most recent and accurate data is indexed. - **Algolia Index Name**: The name of the index you created (in [step 2](#step-2-create-an-index)) in Algolia Setup. - **Algolia Application ID**: You can go to the Algolia dashboard page and check its URL, `https://www.algolia.com/apps/`. Copy the `application_id` and enter it in the field. - **Algolia API Key**: Paste the API key you created (in [step 3](#step-3-generate-an-api-key)) during the Algolia Setup and hit **Create Secret** button. - **Full Index Existing Documents**: Set this to **Yes** to import the existing data from the Firestore collection into the Algolia index. - **Cloud Functions Location**: Choose the region for deploying the Cloud Function. 7. **Install**: Click **Install extension** to finalize. Allow a few moments for the extension to install completely before proceeding to the next steps.

### Choose Searchable Fields To limit the fields used for searching in Algolia, you can specify which attributes should be indexed. From the **Algolia dashboard**, go to **Search > Index > Configuration** and click **+ Add a Searchable Attribute**. Enter the field name you want Algolia to use and repeat this step for additional fields. Once done, click **Review and Save Settings**, then confirm by clicking **Save Settings** in the dialog. Algolia will now search only within the specified fields in your app.

### Configure in FlutterFlow Studio To integrate **Algolia Search** into your FlutterFlow Studio app, go to **Settings and Integrations > Algolia** and enable it. Enter the **Application ID**, which you can find in your Algolia dashboard URL (`https://www.algolia.com/apps/`). Next, copy the **Search API Key** from **Algolia Settings > API Keys** and paste it into FlutterFlow Studio. Finally, under **Indexed Collections**, select the Firestore collections you want to make searchable. Here’s exactly how you do it:

## Using Algolia Search You can use Algolia Search in your app using two methods: - [**Algolia Search Action**](#algolia-search-action): This method is useful when the user enters a search term in a TextField and then interacts with a widget, such as tapping a button, to initiate the search. - [**Backend Query**](https://docs.flutterflow.io/resources/backend-query/algolia-search-query): This approach automatically searches or refreshes search results as the user types in the TextField. It leverages the **Update Page On Text Change** property to dynamically update results. ### Algolia Search [Action] To configure the **Algolia Search** action in FlutterFlow Studio, begin by selecting the widget that will trigger the search, such as an **IconButton**. In the **Properties Panel**, navigate to the **Actions** tab and click on **+ Add Action**, choose the appropriate gesture, like **On Tap**. Search and select the **Algolia Search** action. Next, configure the search parameters: for **Firebase Collection**, select the Firestore collection you intend to search; for **Search Term**, choose **From Variable** and select the TextField's value (e.g., **Widget State > [Your TextField]**); and specify the optional **Max Results** to determine the number of search results. Here’s an example of how you can add Algolia Search Action:

## FAQs
Does Algolia work with other data sources like Supabase?

By default, FlutterFlow Studio’s built-in Algolia integration only supports Firestore as the data source. If you need to use Algolia with another database—such as Supabase—you would have to manage that integration via [**custom code**](https://docs.flutterflow.io/concepts/custom-code). However, out of the box, FlutterFlow Studio currently does not offer an Algolia search on databases beyond Firestore.

# Storage Rules > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/firebase-storage/storage-rules Learn how to deploy storage rules in your FlutterFlow Studio app to manage and secure your Firebase storage. Like [Firestore security rules](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules), Firebase Storage security rules control who can access files uploaded by your users in your application. For example, by setting the storage rules, you can allow only authenticated users (e.g., via Email, Google Sign-in, etc.) to upload or send images. :::tip[For beginners] If you are new to storage rules, you may want to check out this overview about [**Getting Started With Storage Rules**](https://firebase.google.com/docs/storage/security). ::: ## Deploying storage rules To deploy the storage rules: 1. First, make sure Firebase Storage is enabled or configured in your project by visiting the [Firebase console](https://console.firebase.google.com/u/0/) and viewing the **Storage** tab. 2. Return to FlutterFlow Studio, navigate to **Settings & Integrations > Project Setup > Firebase**. 3. Scroll down to the **Firebase Storage** section. 4. To set the storage rules outside of the FlutterFlow Studio (i.e., from the Firebase Console), enable the **Manage Outside of FlutterFlow Studio**. 5. To only allow accessing the images, videos, files, etc., to the users who uploaded it, enable **Make Users Uploads Private**. 6. Click the **Deploy** button. 7. A pop-up will open. Click **Yes** to continue and click **Deploy Now**.

:::tip[Learn more] Learn more about Firebase Storage Rules [here](https://firebase.google.com/docs/storage/security). ::: # Firebase Storage Library > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/firebase-storage/storage-library The Firebase Storage Library provides access to the files in Cloud Storage through the Firebase SDK beyond what FlutterFlow Studio's built-in support provides. The [Firebase Storage Library][storage-library-item] provides access to the files in Cloud Storage through the Firebase SDK beyond what [FlutterFlow Studio's built-in support](https://docs.flutterflow.io/concepts/file-handling) provides. [storage-library-item]: https://marketplace.flutterflow.io/item/Ec3NWw8sxqJ1tbriOIEE ## Instructions To start using this library: 1. [Import the library](https://docs.flutterflow.io/resources/projects/libraries#importing-a-library) into your existing FlutterFlow Studio project. 2. [Connect your FlutterFlow Studio project to Firebase](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase) (if you haven't done so already). The library will default to using the default bucket of your associated Firebase project. You can override this behavior by passing an explicit bucket URL to any of the actions. 3. [Use the Custom Actions](https://docs.flutterflow.io/concepts/custom-code/custom-actions#using-a-custom-action) and Custom Functions in your Action Flows. ### Custom actions * `uploadFileToBucket` \- Upload a file to any path in any bucket that you have write access to. * **Parameters:** * The `bucketName` (`String?`) to upload the file to. If you leave this empty, it uses the default bucket of the associated Firebase project. * The `fullPath` (`String?`) where the file will be written to inside the bucket. If this is specified, the `prefix` parameter is ignored. * The `uploadedFile` (`FFUploadedFile`) that is to be uploaded to Cloud Storage. This is the action output of a previous `Store media for upload` action. * The `prefix` (folder/directory) (`String?`) where the file will be uploaded to. If `fullPath` is not specified, the action uses this parameter and the `name` of the `uploadedFile` to determine the full path where it writes the file. * **Action result:** * If successful, the action result is a `fileObject` containing the full path of the uploaded file. * `listAllFilesInBucket` \- List all files in any bucket that you have read access to. * **Parameters:** * The `bucketName` (`String?`) to list the files from. If you leave this empty, it uses the default bucket of the associated Firebase project. * The `listType` (`StorageListType?`) of the items to list (files, directories, both). If left empty, the action will list both files and prefixes (folders/directories). * The `prefix` (`String?`) is the `/` separated path from which to list files. If left empty, the action will list the items in the root of the storage bucket. * **Action result:** * If successful, the action results in a `List` of `fileObject` elements. * `downloadFile` \- Download the data for a file that you have read access to. This downloads the actual data into your application code. If you instead want a public URL to the data, use `getDownloadUrl` instead. * **Parameters:** * The `bucketName` (`String?`) to download the file from. If you leave this empty, it uses the default bucket of the associated Firebase project. * The `fullPath` (`String`) of the file whose data will be read from the bucket. * **Action result:** * If successful, the action result is an `FFUploadedFile` with the data of the file that was read from the bucket. * `getDownloadUrl` \- Get the download URL for a file in a bucket that you have read access to. This URL then provides public, read-only access to the file * **Parameters:** * The `bucketName` (`String?`) that contains the file. If you leave this empty, it uses the default bucket of the associated Firebase project. * The `fullPath` (`String`) of the file for which to get the download URL. * **Action result:** * If successful, the action result is a HTTP URL that allows public access to the file. * `getMetadataForFile` \- Get the metadata for a file in any bucket that you have read access to * **Parameters:** * The `bucketName` (`String?`) that contains the file. If you leave this empty, it uses the default bucket of the associated Firebase project. * The `fullPath` (`String`) of the file for which to get the download URL. * A**ction result:** * If successful, the action result is a `FullMetadata` with all the metadata and custom metadata of the file. * `updateMetadataForFile` \- Update the metadata for a file in any bucket that you have write access to * **Parameters:** * The `bucketName` (`String?`) that contains the file. If you leave this empty, it uses the default bucket of the associated Firebase project. * The `fullPath` (`String`) of the file for which to get the download URL. * The `metadata` (`SettableMetadata`) to write to the Cloud Storage bucket for the file. If any value is left out or empty in the metadata, it is left unmodified in Cloud Storage. * **Action result:** * If successful, the action result is a `FullMetadata` with all the metadata and custom metadata of the file after the update. * `getPathFromUrl` \- Get the path for a file based on its (https:// or gs://) URL. This is a synchronous call, as it doesn't require any call to the server. * **Parameters** * The `Url` to parse. * **Action result:** * The action result is a `fileObject` derived from the URL. * `deleteFileFromBucket` \- Deletes a file from any bucket you have write access to. * **Parameters:** * The `bucketName` (`String?`) that contains the file. If you leave this empty, it uses the default bucket of the associated Firebase project. * The `fullPath` (`String`) of the file to delete from the bucket. * **Action result:** * If the action succeeds the file has been deleted. There is no additional information. ### Enums * `StorageListType` is an enumeration of the types of items that the `listAllFilesInBucket` action can return. Values: * `files`: List only the files in the specified path. * `prefixes`: List only the prefixes in the specified path. You might more commonly refer to these as folders or directories, but since Cloud Storage doesn't actually have support for folders/directories, it uses `/` characters in the file names to emulate those and calls them prefixes. * `filesAndPrefixes`: List both files and prefixes in the specified path. ### Data Types * `fileObject` \- the metadata for a file or prefix (folder/directory) in Cloud Storage. It has the following fields: * `fullPath` (`String`) \- The full path of the file/prefix inside the storage bucket. The value does not start with a leading `/`. * `isPrefix` (`Boolean`) \- Indicates whether the object is a file (`false`) or prefix (folder/directory) (`true`). * `FullMetadata` \- the full metadata of an item in a storage bucket as returned by `getMetadataForFile`, modelled after the [`FullMetadata` class in the Firebase SDK for Cloud Storage](https://pub.dev/documentation/firebase_storage/latest/firebase_storage/FullMetadata-class.html). * `SettableMetadata` \- the settable metadata of an item in a storage bucket, as passed to a call to `updateMetadataForFile`, modelled after the [`SettableMetadata` class in the Firebase SDK for Cloud Storage](https://pub.dev/documentation/firebase_storage/latest/firebase_storage/SettableMetadata-class.html). * `KeyValuePair` \- A `String`/`String` key/value pair as used for the `customMetadata` in the `FullMetadata` and `SettableMetadata` data types. # Mux Livestream > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/mux Learn how to get started with MuxBroadcast in your FlutterFlow Studio app for live video broadcasting. Mux Livestream allows you to integrate live video streaming capabilities directly into your FlutterFlow Studio app. It leverages Mux’s powerful streaming API, providing real-time broadcasting features. For a deeper understanding, check out [how live streaming works](https://blog.flutterflow.io/flutter-mux-live-streaming/#how-does-live-streaming-work). :::tip[Possible use cases] - **Live Events**: Stream conferences, workshops, or meetups. - **Educational Apps**: Conduct live classes, webinars, or tutorials. - **Social Platforms**: Allow users to broadcast and share real-time video content. - **Customer Support**: Provide interactive support sessions via live video streaming. ::: ## Setting Up Mux Integration To get started, go to **Settings and Integrations > Integrations > Mux Livestream** in FlutterFlow Studio and enable **Mux Broadcast**. Then, create a Mux account and go to **Settings > API Access Tokens**. Click **Generate new token**, choose an environment (Development or Production), check **Mux Video** with **Write** access, name the token, and generate it. Copy the **Access Token ID** and **Secret Key**, paste them into FlutterFlow Studio, and click **Deploy**.

## Adding MuxBroadcast Widget To create a live stream, start by adding the **MuxBroadcast** widget to your page. Navigate to the page where you want the livestream to appear, then drag and drop the widget onto the canvas. After placing it, configure its properties using the options available in the right-side panel. The MuxBroadcast widget comes with three key properties to control the live stream: - **Show Streaming View**: By default, this option is disabled, meaning the widget only displays the starting interface (camera preview and "Start Stream" button). Enabling this option shows the live streaming UI on the canvas during design time, which helps with layout and styling previews. - **Broadcast Latency**: Choose between **Standard**, **Reduced**, and **Low** latency modes. Lower latency provides faster interaction but may reduce video quality or reliability depending on the network. - **Broadcast Audio Channel**: Select **Stereo** or **Mono** audio. Stereo provides richer sound with left and right audio separation, while Mono offers broader device compatibility and lower bandwidth usage. ![muxbroadcast-widget.avif](https://docs.flutterflow.io/assets/images/muxbroadcast-widget-3d31a0be6518f23e2e7223a7423f3958.avif) You can also customize the **MuxBroadcast** widget to match your app's design using various styling properties. These include: - **Start Button Style, Text, and Icon:** Adjust the appearance, label, and icon of the broadcast start button. - **Stop Button:** Customize how the stop button looks. - **Flip Camera Button:** Modify the button used to switch between front and rear cameras. - **Live Text Style:** Change the appearance of the "LIVE" text. - **Live Container & Icon:** Style the container and icon shown during live broadcast. - **Duration Text Style:** Customize how the elapsed time is displayed. - **Duration Container:** Style the container holding the duration display. ## Start and Stop Livestream You can manage livestreaming using the built-in action triggers available on the **MuxBroadcast** widget: **On Broadcast Start** and **On Broadcast Stop**. These allow you to trigger workflows when a stream begins or ends. ![streaming-action-triggers.avif](https://docs.flutterflow.io/assets/images/streaming-action-triggers-3d8c36d44f47d2fdaa3d3ce14328339e.avif) ### On Broadcast Start [Action Trigger] The actions under this trigger execute when the user clicks the **Start Stream** button. From here, you can access the livestream URL via **Widget State → Mux Playback URL** and perform tasks such as creating a new database record to indicate the livestream has started. ![on-broadcast-start.avif](https://docs.flutterflow.io/assets/images/on-broadcast-start-ec4c0c129b2882a81e72ad3510da627c.avif) ### On Broadcast Stop [Action Trigger] The actions under this trigger execute when the user stops the stream. You can use this trigger to update your database, such as setting a livestream's `is_live` status to `false`, saving the end time, or navigating away from the stream page. ![on-broadcast-stop.avif](https://docs.flutterflow.io/assets/images/on-broadcast-stop-98af6c37211b1d75ce3f3c711cc9f6f9.avif) ## View Livestream When a livestream is active, you can access the broadcast instantly via the **Mux Playback URL** provided by the **MuxBroadcast** widget. If the livestream has already ended, additional steps are required to retrieve the archived playback URL and enable playback of the recorded session. ### Viewing Active Livestream Once your livestream is active, viewers can watch it in real-time using the **Mux Playback URL**. This URL can be passed to a dedicated page (for example, **ViewBroadcast**) to stream the live session. To display the livestream: 1. Navigate to your desired list or overview page where livestreams are listed. 2. When a viewer taps on a live broadcast card (e.g., from a `ListView`), navigate to the **ViewBroadcast** page and pass the **Mux Playback URL** as a page parameter. 3. Inside the **ViewBroadcast** page, the **Mux Playback URL** can then be used in a [**VideoPlayer**](https://docs.flutterflow.io/concepts/file-handling/displaying-media#videoplayer) widget to stream the live video.

### Viewing Past Livestream When a livestream ends, its original **Mux Playback URL** becomes invalid. To replay an ended session, you need to fetch the archived asset's playback URL that was automatically created during the livestream. To achieve this, you will need to retrieve the live stream ID from its playback ID, then get the associated asset's playback ID from the livestream's recent assets. :::tip You'll need to write a [**custom code expression**](https://docs.flutterflow.io/resources/functions/utility#custom-code-expression) or [**custom function**](https://docs.flutterflow.io/concepts/custom-code/custom-functions) to extract the playback ID from the current Mux Playback URL (e.g., from `https://stream.mux.com/iSHXmiVyFshIPgeZf2F78OrvOGnEQd02Api00ipWRwWaQ.m3u8` extract `iSHXmiVyFshIPgeZf2F78OrvOGnEQd02Api00ipWRwWaQ`, which is a playback ID of a livestream) and then reconstruct the new playback URL using the asset's playback ID in the same format. ::: ![get-past-stream-id.avif](https://docs.flutterflow.io/assets/images/get-past-stream-id-7539757ca9f9fc760aeb0afdfc0e4858.avif) The flow involves using three Mux APIs in sequence: - [**GET /video/v1/playback-ids/`{PLAYBACK_ID}`**](https://www.mux.com/docs/api-reference/video/playback-id/get-asset-or-livestream-id): Gives the livestream ID from the livestream playback ID. - [**GET /video/v1/live-streams/`{LIVE_STREAM_ID}`**](https://www.mux.com/docs/api-reference/video/live-streams/get-live-stream): Retrieves the livestream details including `recent_asset_ids` array. Extract the Asset ID from this api response. - [**GET /video/v1/assets/`{ASSET_ID}`**](https://www.mux.com/docs/api-reference/video/assets/get-asset): Fetches the asset details to get its playback ID from the `playback_ids` array. Now, use conditional logic to check the livestream status and pass the appropriate playback URL. For example, if the broadcast is live, use the current livestream playback URL directly. If the livestream has ended, call the APIs in sequence to get the asset's playback ID and construct the archived stream's playback URL. # Supabase Setup > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/integrations/supabase/setup Learn how to set up Supabase in your FlutterFlow Studio app for database and authentication functionalities. You can either use [Supabase OAuth](#connect-with-supabase-oauth) for a quick and secure setup or [connect using API Keys](#connect-with-supabase-api-keys) for self-hosted setups. ## Connect with Supabase OAuth To connect with Supabase using the OAuth method, follow the steps below: 1. Open **Settings & Integrations** and go to the **Supabase** section. 2. Select the **Connect with Supabase OAuth** tab. 3. Click **Connect to Supabase** to start the connection flow. 4. Choose your Supabase organization and authorize access. 5. After authorization, either select an existing Supabase project or click **Create New Project** to make a new one. 6. If creating a new project, enter the project name and region, then click **Create**. 7. Copy and save the database password, since it will not be shown again. 8. Click **Done** to finish the setup. 9. Once connected, you can view and manage the Supabase project from the Supabase settings, switch projects, or open it in a new browser tab.

:::tip After [**creating**](#create-tables-in-supabase) or updating tables in your Supabase database, make sure to click **Get Schema** to refresh and sync the latest table structure in FlutterFlow Studio. ::: ## Connect with Supabase API Keys To connect using Supabase API Keys, you will manually link your Supabase project with FlutterFlow Studio by providing the required credentials. :::caution Please note that this method is only intended for **self-hosted Supabase databases**. ::: 1. First, create a project in Supabase from the Supabase dashboard. 2. In your Supabase project, navigate to [Project Settings > API](https://app.supabase.com/project/cwnjvtflygqlpxdpsujv/settings/api). Copy the **Project URL**. 3. Return to FlutterFlow Studio, navigate to **Settings and Integrations > Integrations > Supabase**. Turn on the toggle (i.e., enable Supabase) and paste the **API URL**. 4. Similarly, from the Supabase [API section](https://app.supabase.com/project/cwnjvtflygqlpxdpsujv/settings/api), copy the **anon key** (under **Project API keys**) and paste it inside the **FlutterFlow Studio > Settings and Integrations > Integrations > Supabase > Anon Key.** 5. Click on the **Get Schema** button. This will show the list of all tables with their schema (structure) created in Supabase. 6. (Optional) If you have defined an *Array* for any *Column Data Type* in Supabase, you must set its type here. To do so, tap the "**Click to set Array type**" and choose the right one. :::tip After [**creating**](#create-tables-in-supabase) or updating tables in your Supabase database, make sure to click **Get Schema** to refresh and sync the latest table structure in FlutterFlow Studio. :::
## Create Tables in Supabase If you haven't already, [create table(s)](https://supabase.com/docs/guides/database/tables#creating-tables). If you're just getting started, you can uncheck the **Enable Row Level Security (**[**RLS**](https://supabase.com/docs/guides/auth/row-level-security)**)** option to remove any restrictions on accessing the table data. :::caution[Note] It's important to note that while disabling Row Level Security (RLS) can be useful for testing and development purposes, **it's recommended that you re-enable RLS** and implement an access policy that aligns with your app's requirements before deploying your app. ::: Here's an example of creating an "assignments" table with a [foreign key relationship](https://supabase.com/docs/guides/database/tables#joining-tables-with-foreign-keys) from `created_by` column to `public.users.id` with `on delete cascade`. This ensures that if a user is deleted from the "public.users" table, any data related to that user stored in your "assignments" table will also be deleted.
:::note To use Supabase authentication, you must [**create a "users" table**](https://docs.flutterflow.io/integrations/authentication/supabase/initial-setup#1-creating-a-users-table). ::: # Directory Structure > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/generated-code/project-structure This guide uses example of the generated code of the EcommerceFlow demo app. To view the generated code directly, check out the Github repository. :::note[Prerequisites] This guide uses example of the generated code of the **[EcommerceFlow demo app](https://bit.ly/ff-docs-demo-v2)**. To view the generated code directly, check out the **[Github repository](https://github.com/FlutterFlow/sample-apps/tree/main/ecommerce_flow)**. ::: When you download the code generated by FlutterFlow Studio, you'll notice many additional files and folders beyond what you see in FlutterFlow Studio's Code Viewer. These files make up the complete project structure, organized according to a specific architecture. Understanding this structure is like having a detailed map, guiding you through the code and making it easier to navigate and customize your FlutterFlow Studio project later. So, let's dive in and explore this directory structure. ## Folder Structure ``` assets/ lib/ - actions/actions.dart - auth/ - firebase_auth/ - auth_manager.dart - base_auth_user_provider.dart - backend/ - api_requests/ - api_calls.dart - api_manager.dart - get_streamed_response.dart - cloud_functions/ - firebase/ - firebase_dynamic_links/firebase_dynamic_links.dart - supabase/ - schema/ - enums/enums.dart - structs/ - address_struct.dart - cart_struct.dart - ... - util/ - firestore_util.dart - schema_util.dart - carts_record.dart - ... - index.dart - backend.dart - pages/ ---// empty in this project - cart/ - cart_counter/ - cart_counter_model.dart - cart_counter_widget.dart ... - components/ - square_leading_model.dart - square_leading_widget.dart - styled_button_model.dart - styled_button_widget.dart - custom_code/ - actions/ - execute_search.dart ... - flutter_flow/ ---//FF generated files - custom_functions.dart - flutter_flow_animations.dart - flutter_flow_....dart - nav/ - app_constants.dart - app_state.dart - index.dart - main.dart pubspec.yaml ``` ### Pages & Components FlutterFlow Studio follows a layer-first approach to keep your app organized as it grows. Authentication and backend methods are neatly organized into their own sections **[auth](#auth)** and **[backend](#backend)**. Each page you create in FlutterFlow Studio will generate its own folder, containing the `widget` file and the corresponding `model` file. Shared components are placed in subfolders under `components/`. If you've created nested folders in the FlutterFlow Studio UI, these will directly translate into corresponding folders in the exported code. This gives you even more control to group and organize different features as you like. For instance, you could have separate folders for `products`, `user profile`, and `orders`. In the example above, `cart` is a folder explicitly created to hold all cart related pages and components. ### assets/ The `assets/` directory is where you store static files that your app uses, such as images, fonts, and other resources. These files can be accessed in your code through asset paths and are bundled with your app when it's built. ### lib/ The `lib/` directory contains all the Dart code that drives your Flutter app. This is where the main structure of your application resides. It's organized into several subdirectories to keep the codebase clean and manageable: ### actions/ The actions folder contains app-level **Action Blocks**. Each Action Block is created as a separate function within this directory. For example, in the case of eCommerce demo app, the `addToWishlist` function is an app-level Action Block that is included in the `actions.dart` file. ```js Future addToWishlist( BuildContext context, { required String? productId}) async { // Add productId to wishlist object FFAppState().addToLocalWishlist(productId!); FFAppState().update(() {}); } ``` ### auth/ Contains files and folders related to authentication logic, including integrations with Firebase or other authentication services. ### backend/ The `backend/` directory is responsible for handling all the backend logic and integrations for your Flutter app. This includes API requests, cloud functions, database interactions, and managing data schemas. Each subdirectory within backend/ serves a specific purpose: - **api_requests/**: The api_requests/ directory handles all communication between your app and external services via APIs. It centralizes and organizes the code for making and managing HTTP requests and responses. - **cloud_functions/**: This directory is used to store functions that interact with cloud-based services, such as Firebase Cloud Functions. These functions are used for operations that need to be performed on the server side, such as complex calculations, data processing, or sending notifications. - **schema/**: The schema/ directory is crucial for defining the structure of data used throughout your app. It contains the following subdirectories and files: - **enums/:** Stores enumeration types used across the app. - **structs/:** These are used to represent custom data types like `Address` or `Cart`. - **util/:** Contains utility functions like `firestore_util.dart` and `schema_util.dart`. ### custom_code/ Custom Actions and Custom Widgets created by the developer are stored in this folder, in their respective subdirectories: `custom_code/actions` and `custom_code/widgets`. ### flutter_flow/ This directory is generated by FlutterFlow Studio and contains various utility files that support the app's operation, such as custom functions, generated themes, navigation and more. ### app_constants.dart This class is used to store constant values that are used throughout the application. ### app_state.dart This file contains the [**FFAppState**](https://docs.flutterflow.io/generated-code/ff-app-state) class, which is responsible for managing the global App States created by the developer. ### main.dart The `main.dart` file serves as the entry point for your Flutter application. It begins by initializing the Flutter engine with `WidgetsFlutterBinding.ensureInitialized()`. Next, it sets up the URL strategy for the web application, initializes the `FlutterFlowTheme`, and sets up the `FFAppState` to manage the global state of your app. ### pubspec.yaml This file is the configuration file for your Flutter project. It defines the dependencies, assets, and other project settings. It also specifies which versions of Dart and Flutter your project uses, along with any third-party packages or plugins your app relies on. This structure makes it easier to manage and scale your app! # DataTypeStruct class > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/generated-code/custom-data-types This guide uses example of the generated code of the EcommerceFlow demo app. To view the generated code directly, check out the Github repository. :::note[Prerequisites] This guide uses example of the generated code of the **[EcommerceFlow demo app](https://bit.ly/ff-docs-demo-v2)**. To view the generated code directly, check out the **[Github repository](https://github.com/FlutterFlow/sample-apps/tree/main/ecommerce_flow)**. ::: When you create a custom data type in the FlutterFlow Studio editor, a corresponding class is generated in the code to act as a structured container for your data, similar to a `Struct`. This class includes simple getters and setters for each field. For example, if your data type in FlutterFlow Studio is named "Product", the generated class will be named `ProductStruct` and can be found in the `product_struct.dart` file. ![custom-data-type-gen-class.png](https://docs.flutterflow.io/assets/images/custom-data-type-gen-class-dada69e3fce9f4e9adb7fbba271143b9.png) # FlutterFlow Studio State Management > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/generated-code/state-management Learn about the state management used in FlutterFlow Studio's generated code. :::caution[Correct topic?] This document explains the generated code behind the state management approaches used in FlutterFlow Studio. If you're looking for guidance on adding state variables in FlutterFlow Studio, refer to the **[State Variables](https://docs.flutterflow.io/concepts/state-management)** documentation. ::: FlutterFlow Studio manages state in several ways, depending on the scope. Generally, state management is handled using the [Provider](https://pub.dev/packages/provider) package, which facilitates the provisioning of data models for components, pages, and the overall app state. state-management.avif ## Page & Component Models In FlutterFlow Studio, both component widget models and page models share a uniform structure, enhancing consistency throughout the framework. They include local state fields to store data specific to the component, such as sizes or user inputs. These models are also equipped with initialization and disposal methods: `initState` for setup when the widget initializes, and `dispose` for resource cleanup when the widget is no longer needed. Additionally, they provide space for action blocks, which are a set of actions that performs a specific task and can be reused in different parts of the app, and helper methods for extra functionalities needed by the component. This consistent structure across models helps efficiently manage the state and interactions of various components within the app. ## Page State [Variables](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle) used exclusively within a page — such as a text field validator or the value of a checkbox — are stored in the `Model` of each page. These variables can be accessed by other component children on the same page. For instance, on a page with a form, tapping a button in one component may need to access the value of a text field in a different component. Variables within a page are tracked through `StatefulWidget` and are encapsulated into that page’s Model. ## Component State Similar to page state, [**Component State variables**](https://docs.flutterflow.io/resources/ui/components/component-lifecycle) are accessible within the component where they are defined. Each component has a corresponding `Model` and `Widget` class. Variables may be passed in from their parent as parameters. Additionally, you can access component state values from its parent Page widget. This accessibility is possible because the Model of a component is instantiated within the parent Page model. It utilizes the Provider method `context.read()`, which returns any existing model in the tree before instantiating a new one. Thus, any updates to the state in the component model will reflect in the parent’s instance of that component model. One of the helper methods in `flutter_flow_model.dart` is `wrapWithModel()`. This method wraps the child in a Provider model to make it accessible to the child and sets a callback function, which is generally used to call `setState()` in the parent page and update any changed values. We use this wrapper around widgets that need to access the data included in the model. For example, if a page includes a component with a text field and later on the page there is a button needing access to the text field’s value, the button would be wrapped with ```wrapWithModel()```, including the text field component’s Model as a parameter. It’s important to note that components cannot directly access variables of other components on the same page. However, you can pass a variable from ComponentA as a parameter to ComponentB in their parent Page. This ensures that ComponentB receives all updates from ComponentA as expected. ## App State :::note[FFAppState] The generated code behind FlutterFlow Studio's App State class is explained in the **[FFAppState](https://docs.flutterflow.io/generated-code/ff-app-state)** documentation. ::: ## Variables Variables required across multiple pages of the app, such as a username, should be added to the App State. Refer to `lib/app_state.dart`. All defined variables within the app state are components of the `FFAppState` class, which functions as a ChangeNotifier. This means listeners can subscribe and receive notifications when any changes occur. On each page that requires access to app state variables, the method ```context.watch()``` is called to initialize a listener for that page. This ```watch()``` method, provided by the Provider package, facilitates access to inherited widgets and acts as an effective wrapper. ## Persisting App State When an app state variable is created, selecting the "Persisted" option enables FlutterFlow Studio to save it on the device using the [**Shared Preferences**](https://pub.dev/packages/shared_preferences) package. This ensures the variable remains available even after the app is restarted, making it ideal for persisting settings such as login status or a user's choice between light and dark modes. If the "**Secure Persisted Fields**" option is enabled in the app state settings, FlutterFlow Studio utilizes the [**Flutter Secure Storage**](https://pub.dev/packages/flutter_secure_storage) package to encrypt the data. :::tip[Platform Differences] If the platform is **Android**, then `flutter_secure_storage` stores data in [**`encryptedSharedPreference`**](https://developer.android.com/reference/androidx/security/crypto/EncryptedSharedPreferences), which are shared preferences that encrypt keys and values. It handles [**AES Encryption**](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) to generate a secret key encrypted with [**RSA**](https://en.wikipedia.org/wiki/RSA_(cryptosystem)) and stored in [**KeyStore**](https://developer.android.com/reference/java/security/KeyStore). For the **iOS** platform, it uses the [**KeyChain**](https://developer.apple.com/documentation/security/keychain_services) which is an iOS-specific secure storage used to store and access cryptographic keys only in your app. In the case of the **Web**, it uses the [**Web Cryptography**](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) (Web Crypto) API. ::: ## Global State Global state variables are pieces of information related to the device that are accessible throughout the FlutterFlow Studio app. These include: - Screen size - Platform (mobile, web, Android, iOS) - Keyboard visibility - Current time These variables are found in the "Global Properties" section and are automatically added by FlutterFlow Studio, not generated by users. Users can utilize App State variables for their own global use cases. Global properties are retrieved through methods defined in `flutter_flow_utils.dart`. Typically, these methods utilize built-in Flutter libraries, such as `dart:io`, to gather the necessary information. ## Constants For values that do not change throughout the app, such as API keys or environment flags, we utilize the `FFAppConstants` class, which can be found in `lib/app_constants.dart`. This is an abstract class, meaning it cannot be directly instantiated. Instead, it serves as a namespace for static constants, allowing these values to be organized and accessed consistently across the application. # FFAppState > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/generated-code/ff-app-state This guide uses example of the generated code of the EcommerceFlow demo app. To view the generated code directly, check out the Github repository. :::note[Prerequisites] This guide uses example of the generated code of the **[EcommerceFlow demo app](https://bit.ly/ff-docs-demo-v2)**. To view the generated code directly, check out the **[Github repository](https://github.com/FlutterFlow/sample-apps/tree/main/ecommerce_flow)**. ::: The `FFAppState` class in FlutterFlow Studio acts as a central hub for managing the application's global state. It's designed as a singleton, meaning there's only one instance of this class throughout the app's lifecycle. This class extends [**ChangeNotifier**](https://api.flutter.dev/flutter/foundation/ChangeNotifier-class.html), allowing widgets to listen and react to state changes. It includes methods for initializing and updating the app's persisted state and also defines various state variables with corresponding **getters and setters** for manipulating these values. Here is a basic template of the class, taken from the [**eCommerceFlow demo app**](https://bit.ly/ff-docs-demo-v2)'s generated code: ```js class FFAppState extends ChangeNotifier { static FFAppState _instance = FFAppState._internal(); factory FFAppState() { return _instance; } FFAppState._internal(); static void reset() { _instance = FFAppState._internal(); } void update(VoidCallback callback) { callback(); notifyListeners(); } // App State variable of primitive type with a getter and setter bool _enableDarkMode = false; bool get enableDarkMode => _enableDarkMode; set enableDarkMode(bool value) { _enableDarkMode = value; } } ``` The `_enableDarkMode` is an App State variable created by developer that creates its own corresponding getter and setter. ## Rebuild on Updating AppState When updating an `AppState` variable from the Action Flow Editor, you will be presented with several **[update type](https://docs.flutterflow.io/resources/data-representation/app-state#update-type)** options such as **Rebuild All Pages**, **Rebuild Current Page**, and **No Rebuild** in the Action Settings. Let's see how the generated code changes when these options are selected. ### Rebuild Current Page When a developer chooses to update App State with the update type set to **Rebuild Current Page**, the corresponding `setter` is called. Immediately after, `setState(() {});` is invoked, which updates only the current page. Here's an example of the generated code when we update the App State `enableDarkMode` in the `onInitialization` action trigger of the `ProductListPage`. ```js SchedulerBinding.instance.addPostFrameCallback((_) async { FFAppState().enableDarkMode = !(FFAppState().enableDarkMode ?? true); setState(() {}); }); ``` ### Rebuild All Pages In this case, the update type is set to **Rebuild All Pages**, meaning that the `setter` is called, followed by the `update()` method. This method internally calls `notifyListeners()`, which is crucial for updating any widgets that depend on this variable. ```js SchedulerBinding.instance.addPostFrameCallback((_) async { FFAppState().enableDarkMode = !(FFAppState().enableDarkMode ?? true); FFAppState().update(() {}); }); ``` :::tip[Updating App State from Custom Code] When updating App State variables from custom code, such as Custom Actions, it's crucial to call the update function to ensure that the changes are reflected across all pages. For example, you should use: ```js FFAppState().update(() => FFAppState().enableDarkMode = !(FFAppState().enableDarkMode ?? true)); ``` ::: ### No Rebuild Only the setter is called with no setState or update method invoked afterward. This means that only the variable is updated, with no state changes occurring after the data update. ## watch When you add an [**Update App State**](https://docs.flutterflow.io/resources/data-representation/app-state#update-app-state-action) action via the Action Flow Editor, the corresponding pages will include this line within the build method: ```js @override Widget build(BuildContext context) { context.watch(); ... ``` By using `context.watch()`, the widget effectively subscribes to any changes in the `FFAppState` class. Whenever there's a change in the `FFAppState` object, this widget automatically rebuilds to reflect those changes. This ensures that your widget always displays the most current data and state of the app, maintaining an up-to-date and responsive user interface. ## Managing AppState When you add an App State variable of `List` type in FlutterFlow Studio, several utility functions are automatically generated to help you manage this list. These functions include a getter, a setter, and methods for adding, removing, and updating items in the list. This setup ensures that you can easily interact with the list while keeping the app state consistent and responsive. Below is an explanation of these generated functions using the specific example of a LatLngList. ```js late LoggableList _LatLngList = LoggableList([LatLng(37.4071594, -122.0775312), LatLng(40.7358633, -73.9910835)]); List get LatLngList => _LatLngList?..logger = () => debugLogAppState(this); set LatLngList(List value) { if (value != null) { _LatLngList = LoggableList(value); } debugLogAppState(this); } void addToLatLngList(LatLng value) { LatLngList.add(value); } void removeFromLatLngList(LatLng value) { LatLngList.remove(value); } void removeAtIndexFromLatLngList(int index) { LatLngList.removeAt(index); } void updateLatLngListAtIndex( int index, LatLng Function(LatLng) updateFn, ) { LatLngList[index] = updateFn(_LatLngList[index]); } void insertAtIndexInLatLngList(int index, LatLng value) { LatLngList.insert(index, value); } ``` These functions are automatically generated to provide a convenient and consistent way to manage list-type App State variables, making it easier to maintain the app's state: - The list `LatLngList` is initialized as a private variable `_LatLngList` of type `LoggableList`, which helps in managing the list with additional logging capabilities. - The get `LatLngList` method allows other parts of the app to access the `LatLngList`. - The set `LatLngList` method allows you to replace the entire `LatLngList` with a new one. When a new list is assigned, it updates the private variable `_LatLngList` and logs this change using `debugLogAppState`. - The `addToLatLngList` function appends a new `LatLng` object to the LatLngList, dynamically updating the list as the app runs. - The `removeFromLatLngList` function removes a specific `LatLng` object from the `LatLngList`, ensuring the list remains accurate and up-to-date. - The `removeAtIndexFromLatLngList` function removes a `LatLng` object from the list based on its index position. - The `updateLatLngListAtIndex` function allows you to update a `LatLng` object at a specific index by applying an update function (`updateFn`) to it. - The `insertAtIndexInLatLngList` function inserts a new `LatLng` object into the `LatLngList` at a specific index, shifting the existing items as necessary. :::note[How to create App State variables] To learn more about creating and using App State variables in FlutterFlow Studio's UI, check out the[ **App State**](https://docs.flutterflow.io/resources/data-representation/app-state) guide. ::: # FlutterFlow Studio Model > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/generated-code/flutterflow-model The FlutterFlowModel class is an abstract class used in FlutterFlow Studio to provide a unified and extensible structure for managing state and behavior of widgets (both pages and components). It encapsulates initialization, state management, and disposal logic, making it easier to handle the lifecycle of widgets and their models. The `FlutterFlowModel` class is an abstract class used in FlutterFlow Studio to provide a unified and extensible structure for managing state and behavior of widgets (both pages and components). It encapsulates **initialization, state management,** and **disposal** logic, making it easier to handle the lifecycle of widgets and their models. FlutterFlow Studio automatically generates the `flutter_flow_model.dart` file, which contains the `FlutterFlowModel` class and utility methods like `wrapWithModel()` and `createModel()`. The diagram below illustrates how these utility classes and methods are utilized in a widget or model class: ![page-generated.png](https://docs.flutterflow.io/assets/images/page-generated-8c049279aadda77f6233554cca01deb8.png) When a component is added to your page (and every component you create [generates both a widget and a model class)](https://docs.flutterflow.io/generated-code/component-model), the flow below explains how the utility classes are used when there is a child component: ![page-component-generated.png](https://docs.flutterflow.io/assets/images/page-component-generated-f0a0aec0e4590657a5c9589fddf00b2f.png)

Here’s a breakdown of the lifecycle of `FlutterFlowModel` class: ## Initialization Ensures the model is initialized **only once** and is tied to the `BuildContext` and the widget it is associated with. ```js abstract class FlutterFlowModel { // Initialization methods bool _isInitialized = false; void initState(BuildContext context); void _init(BuildContext context) { if (!_isInitialized) { initState(context); _isInitialized = true; } if (context.widget is W) _widget = context.widget as W; _context = context; } ``` ## Widget & Context references Provides references to the associated widget and its `BuildContext`. ```js // The widget associated with this model. This is useful for accessing the // parameters of the widget, for example. W? _widget; W? get widget => _widget; // The context associated with this model. BuildContext? _context; BuildContext? get context => _context; ``` `_widget` and `_context` (private fields) store the widget and context references. `widget` and `context` (getters) are the public accessors for `_widget` and `_context`. ## Disposal Manages the cleanup of resources when the model or widget is disposed. ```js bool disposeOnWidgetDisposal = true; void dispose(); void maybeDispose() { if (disposeOnWidgetDisposal) { dispose(); } // Remove reference to widget for garbage collection purposes. _widget = null; } ``` The `disposeOnWidgetDisposal` determines whether the model should be disposed when the widget is removed. This defaults to `true` for **pages** and `false` for **components** (as parent models typically manage their child components). The `maybeDispose()` checks `disposeOnWidgetDisposal` before disposing. It removes the widget reference to aid garbage collection. ## Updates and Change Notification Allows the model to notify the associated widget or parent component/page when updates occur. ```js // Whether to update the containing page / component on updates. bool updateOnChange = false; // Function to call when the model receives an update. VoidCallback _updateCallback = () {}; void onUpdate() => updateOnChange ? _updateCallback() : () {}; FlutterFlowModel setOnUpdate({ bool updateOnChange = false, required VoidCallback onUpdate, }) => this .._updateCallback = onUpdate ..updateOnChange = updateOnChange; // Update the containing page when this model received an update. void updatePage(VoidCallback callback) { callback(); _updateCallback(); } ``` ## wrapWithModel() The `wrapWithModel()` method in FlutterFlow Studio links a model to a widget and its child widgets, allowing them to access and manage state. It wraps the widget with a Provider, making the model available throughout the widget tree. # Generated Code: Components > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/generated-code/component-model Similar to a Page, when creating a component in FlutterFlow Studio, it automatically generates two files: a Widget class and a Model class. Similar to a [**Page**](https://docs.flutterflow.io/generated-code/page-model), when creating a **[component](https://docs.flutterflow.io/resources/ui/components)** in FlutterFlow Studio, it automatically generates two files: a `Widget` class and a `Model` class. :::note[Prerequisites] This guide uses examples from the generated code of the **[EcommerceFlow demo app](https://bit.ly/ff-docs-demo-v2)**. To view the generated code directly, check out the **[Github repository](https://github.com/FlutterFlow/sample-apps/tree/main/ecommerce_flow)**. ::: ## ComponentModel class `ComponentModel` classes are responsible for managing the state and behavior of individual components used within a page. These classes extend the `FlutterFlowModel` class, providing a consistent structure and shared functionality across all component models. This ensures that each component's state is isolated and reusable, making the app easier to maintain and scale. The lifecycle of a `ComponentModel` and its associated widget class follows the same structure as a page. For more details, refer to the documentation on **[Generated Pages](https://docs.flutterflow.io/generated-code/page-model)**. ### onComponentLoad Action: Generated Code When you define actions for the `onComponentLoad` action trigger of a component, these actions are added inside an `addPostFrameCallback` method within the page's `initState` method. This ensures that the actions are executed only after the initial widget tree is built. ```js @override void initState() { super.initState(); _model = createModel(context, () => ProductListPageModel()); // On component load action. SchedulerBinding.instance.addPostFrameCallback((_) async { await _model.updateTotalCost(context); safeSetState(() {}); }); } ``` # Generated Code: Pages > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/generated-code/page-model When you create a new Page in FlutterFlow Studio, it automatically generates two files: a Widget class and a Model class. So if the name of the page you created is called ProductListPage, FlutterFlow Studio generation backend will automatically create ProductListPageWidget class and ProductListPageModel class. When you create a new Page in FlutterFlow Studio, it automatically generates two files: a `Widget` class and a `Model` class. So if the name of the page you created is called **ProductListPage**, FlutterFlow Studio generation backend will automatically create **ProductListPageWidget** class and **ProductListPageModel** class. :::note[Prerequisites] This guide uses examples from the generated code of the **[EcommerceFlow demo app](https://bit.ly/ff-docs-demo-v2)**. To view the generated code directly, check out the **[Github repository](https://github.com/FlutterFlow/sample-apps/tree/main/ecommerce_flow)**. ::: ## PageModel class The `PageModel` classes are responsible for managing the state of individual pages and initializing the components used in these Pages. These classes extend the `FlutterFlowModel` class, which provides a consistent structure and shared functionality across all page models. The following diagram shows how FlutterFlow Studio generates the model and widget class when you create a new Page in FlutterFlow Studio: ![page-generation-initial.png](https://docs.flutterflow.io/assets/images/page-generation-initial-e7846168b8b4019ead1e2ca9dc71ab64.png) :::tip[FlutterFlow Studio Model] To learn more about the utility classes and methods that FlutterFlow Studio generates for all pages & components, see [**the FlutterFlowModel document**](https://docs.flutterflow.io/generated-code/flutterflow-model). ::: #### Managing Local State A `PageModel` class typically holds local state fields specific to the page, which correspond to the **[Page State variables](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#page-state)**. For example, in the ProductListPage, user may create a Page State variable called `searchString`. Correspondingly, in the `product_list_page_model.dart` [file](https://github.com/FlutterFlow/sample-apps/blob/main/ecommerce_flow/lib/product/product_list_page/product_list_page_model.dart) (which is the `Model` file for the `ProductListPage`), the corresponding state field would be `_searchString`. This private field stores the current search string and includes a getter and setter to manage its value while logging any changes. ```js String? _searchString; set searchString(String? value) { _searchString = value; debugLogWidgetClass(rootModel); } String? get searchString => _searchString; ``` :::tip[Private variables in Dart] In Dart, variables that start with an underscore (`_`), such as `_searchString`, are private to the class. This means they cannot be accessed outside the class or its scope. ::: In addition to managing local state, the given `PageModel` class also contains fields for handling the state of widgets on the page. For instance, `_dropDownValue` is a private field that stores the current value of a dropdown widget (if it is added to the current Page). Similar to `_searchString`, it has a getter and setter that logs changes to this field. ```js String? _dropDownValue; set dropDownValue(String? value) { _dropDownValue = value; debugLogWidgetClass(rootModel); } String? get dropDownValue => _dropDownValue; ``` #### Initializing child component models The `PageModel` class is also responsible for initializing the models of components used on the page. For example, if the page includes a `CartCounter` component, the model for this component is initialized within the page's model class. ```js // Model for CartCounter component. late CartCounterModel cartCounterModel; @override void initState(BuildContext context) { cartCounterModel = createModel(context, () => CartCounterModel()..parentModel = this); } ``` :::note Only the model class of a child component is initialized inside the page or parent model class. In the case of page model classes, they are initialized within the widget’s state class itself. See the **[Widget class section](#pagewidget-class)** for more details. ::: When dealing with dynamic lists of components, such as those in a `ListView`, Row, or Column widget, the `PageModel` initializes a `Map` to manage the state of each component instance. For example, if the page includes a list of `CategoryAvatar` components, the initialization might look like this: ```js // Models for CategoryAvatar dynamic component. Map categoryAvatarModels = {}; ``` #### dispose() Finally, the `dispose` function in the `ProductListPageModel` class is used to clean up resources when they are no longer needed. This is a common practice in Flutter to prevent memory leaks. In this class, the `dispose` function is overridden to dispose of the `cartCounterModel`, `searchQueryFocusNode`, and `searchQueryTextController`. ```js @override void dispose() { cartCounterModel.dispose(); searchQueryFocusNode?.dispose(); searchQueryTextController?.dispose(); } ``` ## PageWidget class The `PageWidget` classes are responsible for creating the UI of individual pages and holding the widget tree as designed in the FlutterFlow Studio canvas. These classes always extend Flutter's `StatefulWidget` class utilizing Flutter's built-in state management through `setState` to handle dynamic updates and interact with the app's lifecycle. ```js class ProductListPageWidget extends StatefulWidget { const ProductListPageWidget({super.key}); @override State createState() => _ProductListPageWidgetState(); } ``` #### PageModel Initialization Within the State class, the `PageModel` object is initialized. [This class](#pagemodel-class) serves as a centralized place to manage the page’s state, handle business logic, and interact with the data layer. ```js class _ProductListPageWidgetState extends State { late ProductListPageModel _model; @override void initState() { super.initState(); _model = createModel(context, () => ProductDetailPageModel()); } ``` #### PageModel Dispose Similarly, the [`dispose` method](#dispose) of the `PageModel` class is invoked from the **overridden** `dispose` method of the widget's **State** class. This ensures that any resources managed by the `PageModel`, such as listeners or controllers, are properly released when the widget is removed from the widget tree. ```js @override void dispose() { _model.dispose(); super.dispose(); } ``` #### Global Scaffold Key Each page includes a `GlobalKey` for the `Scaffold`, which can be used to manage the scaffold's state, such as opening or closing drawers or snackbars programmatically. ```js final scaffoldKey = GlobalKey(); return Scaffold( key: scaffoldKey, ...) ``` #### Keyboard Dismissal Moreover, the root widget of every page is a `GestureDetector` with an `onTap` callback that unfocuses the current input field. This approach ensures that tapping anywhere outside an input field dismisses the keyboard or removes focus, creating a better user experience. ```js return GestureDetector( onTap: () { FocusScope.of(context).unfocus(); FocusManager.instance.primaryFocus?.unfocus(); }, ...) ``` These functionalities are automatically added by FlutterFlow Studio to ensure seamless navigation and proper keyboard handling across pages. ### onPageLoad Action: Generated Code When you define actions for the `onPageLoad` action trigger of a Page, these actions are added inside an `addPostFrameCallback` method within the page's `initState` method. This ensures that the **on Page Load** actions are executed after the widget is fully built and rendered. This avoids issues caused by trying to update the UI before it is ready. ```js @override void initState() { super.initState(); _model = createModel(context, () => ProductListPageModel()); // On page load action. SchedulerBinding.instance.addPostFrameCallback((_) async { _model.searchString = null; safeSetState(() {}); ... // more actions }); } ``` :::tip[safe Set State] The `safeSetState` method is a custom implementation built on top of Flutter's `setState` method. It ensures that `setState` is only called when the widget is currently mounted, preventing potential runtime errors. ::: # Subscriptions > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/subscriptions/subscriptions This section provides information on plan changes and other subscription-related questions. This section provides information on plan changes and other subscription-related questions. ## Upgrade Plan ### How do I upgrade my plan? If you would like to upgrade from a Basic plan, follow the steps to purchase a new Growth or Business plan, and then cancel your existing Basic plan if you no longer want it. To upgrade a team directly from a Growth plan to a Business plan, please follow these steps: 1. Click on “My Team” and select the team that has the Growth plan you wish to upgrade. 2. Click on “Upgrade to Business Plan” near the top right corner. 3. View the invoice and confirm that you are willing to be charged this amount for the upgrade. ### How do I upgrade my plan from the desktop app? In the FlutterFlow Studio desktop app for macOS and Windows, you choose a plan in the app and pay on Stripe's checkout page in your default browser. 1. Select **Upgrade** from your account page, from a feature that requires a higher-tier plan, or from the FlutterFlow Agent usage message. The plan chooser opens. 2. Select the plan, billing interval, and number of seats you want. If you're subscribing on behalf of a team, the app creates a team first if needed. 3. Complete the payment on the Stripe checkout page that opens in your browser. The plan chooser closes when the browser opens, and the app shows the message **Checkout opened in your browser. Your plan updates here when you come back.** If the app can't open your browser, it shows **Could not open your browser. Please try again.** and keeps the plan chooser open so that you can retry. After you pay, the checkout page returns you to the app: - If your browser asks for permission to open FlutterFlow, allow it. You can also select **Open FlutterFlow** on the page. - The app comes to the front, refreshes your plan, and shows **You're all set. Your plan is active.** If you cancel the checkout, the app comes to the front and your plan doesn't change. If you return to the app manually, it refreshes your plan once and updates your account page without requiring a reload. ### How do I check what plan I am subscribed to? To view your plan details, go to the [**FlutterFlow Studio Account Page**](https://app.flutterflow.io/account) and select **Manage Billing.** The **Current Plan** section will show which plan(s) you are subscribed to. ## Downgrade Plan ### How to downgrade? If you wish to downgrade from Growth to Basic or from Business to Growth or Basic, you should cancel your existing plan and then sign up for the new one after it expires. ### What happens when I downgrade to the free plan? Will my projects be deleted? On the free plan, you will be restricted to two projects. Any other projects won't be deleted, but will be archived and made accessible if you return to any paid plan. ## Cancel My Plan You can cancel your plan at any time. You will have access to the paid features until your next billing cycle date. Please follow these steps to cancel your account: 1. Log in to FlutterFlow Studio and click on your profile picture to go to the Account page. 2. Find the plan you want to cancel, and select **Cancel Plan**. 3. Complete the Cancellation Survey and select **Cancel Subscription.** :::caution Your FlutterFlow Studio account can have multiple team plans and a personal plan at the same time; you must cancel each plan manually. Canceling one plan does not automatically cancel any other active plan. ::: ## Other Subscription Questions ### When will my plan renew / When will I be charged? You can view the next billing cycle date in the "My Plan" section of the [Flutterflow Account Page](https://app.flutterflow.io/account). ![renew](https://docs.flutterflow.io/assets/images/renew-b7de713dccd5a228d37fb4534fd1cf72.png) The next billing cycle date for this plan is September 12, 2025. ### Do subscriptions renew automatically? Yes, our subscriptions renew automatically to avoid disrupting your app development. Monthly subscriptions renew on the same day each month (typically the day you subscribed). ### Can I pause my subscription? We do not currently offer the option to pause your subscription. ### Can I transfer my subscription to another user? We are unable to transfer a paid FlutterFlow Studio subscription to another FlutterFlow Studio account. ### If I have a paid plan, will project collaborators be able to use paid features? No. Having a paid plan yourself does not give your project collaborators access to paid features. Starting **September 17, 2025**, all collaboration must happen within a **Growth, Business, or Enterprise plan**, and every collaborator must have a **paid seat** in that team to have full edit access. Anyone not on your team will be switched to **view-only** until added as a paid team member. ### If I upgrade from the Growth Plan to the Business Plan in the middle of my billing cycle, will I be charged for both plans? Upgrades are automatic, so the system will count the remaining days from the Growth plan and reduce it from the Business Plan price. For example, if you paid $80 for Growth and you have 15 days remaining in the billing cycle, then on upgrading to Business (let's say priced at $150), you will eventually pay $(150-40) = $110. :::note FlutterFlow Studio provides different pricing options depending on your region. To see the exact prices for your area, visit the [**Plans & Pricing**](https://docs.flutterflow.io/accounts-billing/plan-pricing) page. ::: # Refunds > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/subscriptions/refunds If you're not happy with your FlutterFlow Studio subscription, you can cancel at any time. If you're not happy with your FlutterFlow Studio subscription, you can [cancel at any time](https://docs.flutterflow.io/accounts-billing/subscriptions/subscriptions#cancel-my-plan). However, there are no refunds for cancellation. In the event that the Company suspends or terminates your Account or these Terms, you understand and agree that you shall receive no refund, whether for any unused time on a subscription, any license or subscription fees for any portion of the Service, any content or data associated with your User Account, or for anything else. # Account Management > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/account-management This section contains information on changing your password, verifying your email, and deleting your account. This section contains information on changing your password, verifying your email, and deleting your account. ### I can't log in to my account / I forgot my login info. To reset your account password: 1. From `flutterflow.io` select Login in the top right corner. 2. On the login page, select **Forgot Password?**. 3. You will receive an email with a link to reset your password. 4. Click the reset link and enter your new password. If you can’t remember your username or are experiencing any other issues, please reach out to us at `support@flutterflow.io` ### How do I change my password? To change your password, please use the following steps: 1. Navigate to your [account page in FlutterFlow Studio](https://app.flutterflow.io/account). From the dashboard, you can also select your name at the bottom of the sidebar. 2. In the **Sign in** section, select **Change password**. 3. Follow the prompts to set your new password. ### How do I check if my account is verified? To check if you have verified your account: 1. Navigate to your [account page in FlutterFlow Studio](https://app.flutterflow.io/account). 2. If you have a green checkmark next to your email, your account is verified. ![check-account-verification.png](https://docs.flutterflow.io/assets/images/check-account-verification-6e149bec567f3535f1e7cd83630e6c91.png) ### I didn't get the email to verify my account, how do I resend the verification email? If you did not receive a verification email, please follow these steps: 1. Navigate to your [account page in FlutterFlow Studio](https://app.flutterflow.io/account). 2. Check that your email address is correct. If your email is incorrect, please reach out to `support@flutterflow.io` to correct this. 3. From the **Profile Information** section, select **Verify Email**. You should receive a new confirmation email. If you do not receive the verification email, please contact us at support@flutterflow.io. ![email-verification.png](https://docs.flutterflow.io/assets/images/email-verification-d0cf7266c2f94c0dd089788be25f97a8.png) ### How do I delete my account? To delete your FlutterFlow Studio account, please follow these steps: 1. Navigate to your [account page in FlutterFlow Studio](https://app.flutterflow.io/account). 2. If you own any teams, transfer or delete them first. 3. In the **Delete this account** section, select **Delete account**. :::danger This step can't be undone. Your personal projects are permanently deleted, and we can't recover them. ::: ### How do I change or update my email address? To change your login email in FlutterFlow Studio: 1. Navigate to your [account page in FlutterFlow Studio](https://app.flutterflow.io/account). 2. In the **Profile** section, select **Change email**. 3. In the **Update Email** dialog, enter your new email address and your current password, and then select **Confirm & Log Out**. 4. Verify the new email via the link sent to it. 5. Now, you need to create a new password for your new email address. To do so, on the login page, select **Forgot Password?** and enter your new email address. 6. You'll receive the password reset link at your new email address. Click the link and reset the password. Now, you are ready to log in with your new email address and password. ![The Change email button in the Profile section of the account page.](https://docs.flutterflow.io/assets/images/update-email-light-106822ad4a609d0e0f087c3b93f8392c.png) ### How do I generate an API Token? An API token is required to use the [CLI](https://docs.flutterflow.io/flutterflow-cli) and the [Visual Studio Code Extension](https://docs.flutterflow.io/concepts/custom-code/vscode-extension) . To create an API token tied to your account: 1. Navigate to your [account page in FlutterFlow Studio](https://app.flutterflow.io/account). 2. In the **API tokens** section, create a token. # Plans & Pricing > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/plan-pricing For our most up-to-date information, please visit FlutterFlow Studio pricing. :::note For our most up-to-date information, please visit **[FlutterFlow Studio pricing](https://flutterflow.io/pricing)**. Regional discounts are available, please **[log in to FlutterFlow Studio](https://app.flutterflow.io/)** to see the pricing for your region. ::: ## Pricing Update [June 2025] FlutterFlow Studio has evolved significantly, from a visual builder to a complete development environment with features like code export, GitHub integration, branching, AI agents, and app deployment tools. As the platform has matured, so have the ways people use it. To better reflect how teams build and scale today, we're introducing updated pricing plans. These updates will help us continue improving the platform, supporting your workflows, and delivering the advanced features needed for building production-ready apps. ### What's Changing? As part of broader improvements to the platform, FlutterFlow Studio is updating its pricing and packaging model effective **August 18, 2025**. The update introduces new plan tiers aligned with team size, simplifies billing, and ensures better alignment between user needs and platform capabilities. **Key Changes** - We're retiring our legacy plans: **Standard**, **Pro**, and **Teams** and introducing a new, simplified lineup: **Free**, **Basic**, **Growth**, **Business**. Our Enterprise offering will continue as is, providing advanced features and support for larger teams. - If you're already using FlutterFlow Studio, you'll be automatically moved to the new plan that best fits your current team size. No action needed on your part. - That said, feature access will look a little different. Some users will gain powerful new capabilities, while others might see a few features move to higher tiers. To understand how each new plan compares, **[view the detailed plan comparison](https://docs.flutterflow.io/accounts-billing/plan-comparison).** ## FAQS ### General / Timeline
Who is affected by this pricing change?

All current Free, Standard, Pro, and Teams plan users will move to the new structure. Enterprise customers on custom contracts are not affected by these changes.

When does the new pricing take effect for me?

- For new users, the pricing and packaging will apply immediately on August 18, 2025. After this date, no legacy plans (Standard, Pro, Teams) can be purchased or updated. - For existing Free, Standard, Pro, and Teams plan users, billing and feature access will remain unchanged during a **30-day transition period** where you will have the ability to select a new plan. On September 18, 2025, your account will be moved to one of the new plans if no action is taken. - **Important exception:** If you're currently on a Teams plan, you will no longer be able to use your team features on personal projects starting August 18, 2025. To maintain existing Teams plan feature access on those projects, you must either: - Move your personal projects into your Team, or - Convert your current Teams plan to a new Growth or Business plan and purchase a separate Basic plan for your personal work. - **Note:** All plan updates will take effect at 12:00 AM local time on the specified effective date.

![Pricing Update Timeline - 2025](https://docs.flutterflow.io/assets/images/pricing-timeline-2025-light-8cba34a0d150e869d9848ff396cf9721.png)

Why is FlutterFlow Studio updating its pricing?

When we launched FlutterFlow Studio, we had one goal: make it radically easier to build beautiful, powerful digital products. Four years later, we’re a full development platform that goes from idea to app store. We now have collaboration features, AI tools, lots of integrations, branching, development environments, and more, built in. Now our plans are evolving to reflect that growth. We’ve introduced new features across every tier and restructured our plans to better align with the way people build today and how their needs change as they move from MVP to scaling production apps.

### Plans
How do the new plans differ from the current plans?

The new plans introduce pricing by team size, differentiation between team and personal projects, and more structured feature access to support different types of users and teams as they grow.

Key changes include:

  • New plan tiers based on team size, with clearer limits of number of developers that can work together.
  • Collaboration primarily at the team level to support scalable workflows and controls, with a new option to enable single-project collaboration as an add-on.
  • Updated feature access, with certain advanced features now only available in higher tiers.
  • Plan-based Support levels, with availability varying by plan.
  • Revised pricing structure, with updated USD and INR rates.

For a detailed comparison of the current and new plans, including feature breakdown and pricing, please see the **[Detailed Plan Changes](https://docs.flutterflow.io/accounts-billing/plan-comparison)** table above.

What is the difference between team projects and personal projects?

**Team + Restricted Team Projects:**

  • Give you access to all the features of your Growth or Business plan
  • Can be shared with your whole team, or restricted to specific members
  • The team owner always has access to every project in the team

**Personal projects:**

  • Belong only to you; team owners cannot access them
  • Only include the features available in your personal plan
  • Note: If you want to use Growth or Business features by yourself, you can create a team of one

To update the collaboration type of a project, go to the Collaboration tab in your project settings and choose from one of the following options: Team Project, Personal Project, or Restricted Team Project

Which plan is best suited for different types of users?

The tiers are designed as a general guide to help highlight which plans tend to work best for different types of use cases, but we know that every user’s needs are different and you’re always welcome to choose the one that works best for you. That said, here’s how we generally recommend thinking about the tiers based on common usage patterns:

  • Free: App builders learning and prototyping.
  • Basic: Independent builders shipping production-ready apps.
  • Growth: Solo developers or small teams needing advanced functionality.
  • Business: Established teams (3–5 users) ready for advanced development workflows.
  • Enterprise: Larger teams needing advanced security, governance, and collaboration features.
How do I know which plan I will be moved to if I do not make a selection before September 18, 2025?

If you do not make a selection during the election period (August 18, 2025 - September 17, 2025), your new plan will be automatically determined based on your current **team size**. For example:

  • Users on the Free plan will remain in the Free plan, but with new feature restrictions.
  • Solo users in Standard will move to the **Basic** plan.
  • Pro plan users and Teams of 2 will move to the **Growth** plan.
  • Teams of 3-5 will move to the **Business** plan.
  • Teams with 6+ users will move to the Business plan and retain their current seat count as of September 18, 2025 for up to 12 months. During this period, no additional seats can be added. After 12 months, you will need to upgrade to an Enterprise plan to continue building with more than 5 team seats.
    • We highly encourage you to begin evaluating your team’s resourcing and expansion needs early, as this plan will not support usage growth beyond the feature limits of the Business tier. Early planning and engaging with our sales team can help ensure a smooth migration, avoid disruption, and prevent any risk of project or data access issues at the 12-month cut-off. To start the conversation, please reach out to sales@flutterflow.io to explore the best solution package for your team.
  • Expert Agencies (approved via **Contra**) will move to the Business plan with Agencies Expansion included.

We'll notify you directly in the app and by email before the September 18, 2025 migration, so you'll have a chance to review or adjust your plan if needed. If you're unsure, contact us and we'll help you confirm your new plan

Are there any benefits to electing into a new plan vs. being auto-migrated?

Yes! By proactively choosing to move to any of the new plans with annual billing during the election period (before September 18, 2025), you will receive **20% off your first year**.

Can I stay on my old plan?

No. All existing plans will be retired on September 18, 2025, and users will be automatically transitioned to the new plans based on their current team size. This helps us simplify billing, improve feature alignment, and deliver a more consistent experience across all teams.

If you’re currently a paying user and would prefer not to be part of the migration to one of the new paid plans, you have two paths:

  • **Continue building on the Free plan**: you can downgrade your plan to Free, where you will be able to view, edit, and run any 2 existing projects of your choosing inside the editor, but paid‑tier features, deployments, and team seats will be disabled until you upgrade.
  • **Export your code**: download the full Flutter source and assets for each project before September 18, 2025 and continue building locally to retain full ownership of your codebase.

If you’d like to review your options or adjust your usage ahead of time, our support team is here to help. You will receive an email confirming the plan your account will move to, but can also confirm by logging into your account after August 18, 2025 to see how your team maps to the new tiers.

What's included in the Enterprise plan?

The Enterprise plan is built for organizations that need advanced security, scale, and white-glove support while managing production-grade apps across teams. In addition to all features available in lower tiers, Enterprise includes:

  • Controlled FlutterFlow Studio upgrades through version pinning
  • Unlimited access to automated snapshot backups for project history and rollback
  • Single Sign-On (SSO) and Activity Logging for secure, centralized access
  • Unlimited development environments to mirror staging, QA, and production workflows
  • Advanced accessibility features to meet regulatory requirements
  • No automatic right for FlutterFlow Studio to use your logo
  • Live and dedicated technical support, plus access to custom engineering solutions when needed

To learn more or explore a custom Enterprise solution for your team, please reach out to sales@flutterflow.io – we'd be happy to walk you through options that match your scale and needs.

### Feature Access
Will my existing FlutterFlow Studio apps stop working?

1. No, your current apps will continue to function and remain deployed, though access to certain features may change depending on your new plan tier starting September 18, 2025\.
2. If you elect into a new plan during the election period before September 18, 2025, those feature changes will take effect as soon as your new plan becomes active.

What happens to features I already use but are not part of my new plan?
  • Access to features will be updated according to your new plan beginning September 18, 2025. If you're currently using a feature that is moving to a higher tier, there are two possible outcomes:
    • Build-time features (like activity logging, automated testing, or Figma Frame imports) will no longer be accessible. You’ll see an upgrade prompt if you attempt to use them.
    • Run-time features (like API endpoints, branching, GitHub integration, or dev environments) will be grandfathered and continue to work as-is, but you won’t be able to create additional instances beyond what you already have. For example:
      • If you are currently building on a Free plan with 3 API endpoints, you can continue editing them, but won’t be able to add a 4th without upgrading to a paid plan.
      • If you’ve used branching or added multiple development environments and currently exceed your new plan limits, those remain active but you’ll be prompted to upgrade if you try to add more.
  • This approach ensures existing work isn’t disrupted, while still aligning future access with your selected plan.
### Free Users
I am a Free user and I will lose access to technical support. Where else can I look to for help when building?
  • Starting August 18, 2025 for new users and September 18, 2025 for existing users, 1:1 support will no longer be included with the Free plan. However, we offer a collection of self-serve resources to help you continue building with confidence:
    • Our Help Center at docs.flutterflow.io offers a free collection of step-by-step guides on how to build, get started, and make the most of FlutterFlow Studio’s features.
      • We are also launching new troubleshooting guides to help you resolve common issues and workflows.
      • Plus, a new AI-powered assistant will help you quickly find answers and relevant resources within the Help Center.
    • You can turn to our Community Forum to ask questions, share learnings, and get help from other FlutterFlow Studio builders.
    • We also offer free educational content via our YouTube channel to support your learning and skill development.
  • These resources are designed to help all users succeed without needing to rely on 1:1 technical support.
    • Our Support team will still be available at support@flutterflow.io to all users to assist with billing or account-related issues.
I am a Free user and have more than 2 projects – what will happen to them?
  • Starting September 18, 2025, all personal Free plan projects will be archived until you actively select two to keep editable. This selection is permanent and cannot be changed afterwards. All other projects will be archived – they'll still appear on your dashboard, and published apps will remain live, but you won't be able to open, edit, or publish updates unless you upgrade.
    • **Marketplace exception:** Existing Free plan projects published to the Marketplace prior to August 18, 2025 will not count toward your 2-project limit. If a project is later removed from Marketplace and you exceed the limit, it will be automatically archived.
  • For users on a team-based plan but not on a personal paid plan, this 2-project selection requirement only applies to your personal projects. You will still be able to edit any projects that belong to your team.
  • We've set this policy to ensure everyone can explore FlutterFlow Studio for free while keeping heavy usage sustainable. We won't remove any of your existing projects. They're safe and accessible whenever you decide to upgrade.
Can I still deploy my existing FlutterFlow Studio apps if I stay on the Free Plan with >2 projects?

Any existing projects already live will remain deployed, even if you have more than 2 projects currently deployed. However, on the new Free plan, you’ll be limited to editing and publishing updates to at most 2 active projects. All other projects will remain deployed, but you won’t be able to make changes or redeploy them unless you upgrade to a paid plan.

What if I delete one of my 2 active projects?

If you delete one of your active projects, we’ll automatically unarchive your most recently edited archived project to replace it.

If you only had 2 projects total and delete one, you’ll be able to create a new project instead.

### Teams (Growth/Business)
What happens to projects with multiple collaborators?

Starting September 18, 2025, all project collaboration must occur within a team (Growth or Business). This means:

  • Team projects. Everyone on your team keeps full edit access. Any project collaborator who is not a paid seat on your team will be switched to view-only access at the project level until they’re added as a paid team member.
  • Projects not associated with a team. The project owner keeps full edit access and all other project collaborators become view-only members on that project. To keep editing together, move the project into a team and invite those collaborators as team members.
  • Solo projects: If you are the only editor, nothing changes. You retain full edit access.

Note: If you choose to migrate to a new paid plan before September 18, 2025, any collaborators not on your team will immediately move to view-only access at the time of conversion.

I’m currently on a Teams plan and want to change the number of users. Can I still do this on or after August 18, 2025?

No. As a part of the existing Teams plan retirement, team size will be locked on August 18, 2025. To adjust your team size after that date, please transition to one of the new plans (Growth or Business).

I am currently on a Teams plan with 6+ users and do not want to migrate to the Enterprise plan – how do I stay on the Business tier and how will I be charged?

- Teams with more than 5 users who do not wish to move yet to an Enterprise contract can continue on the Business tier under a transitional pricing structure. These teams will be billed at the standard Business tier seat pricing and then $85/seat/month for each additional seat over 5. Pricing will be based on the number of users in the team as of September 18, 2025 and billed on a monthly basis.

- This option allows larger retail teams to continue operating under the Business feature set without immediate contract negotiation, but will be available only to existing 6+ seat teams for 12 months from September 18, 2025 through September 18, 2026 to ensure continuity without immediate contract negotiation.

- Note: Your seat count will be locked based on your team size as of September 18, 2025. You may reduce seats later, but will not be able to add more or expand beyond the feature set and usage limits of the current Business tier (except for any run-time features already in use that are grandfathered).

However, if you would like to maintain a single account, collaboration across all of your team members, enterprise level features and support, please reach out to sales@flutterflow.io.

Can I belong to multiple teams? How will that be billed?

Yes, starting August 18, 2025, users will be able to belong to multiple teams in FlutterFlow Studio in the new plans – this is a new capability as part of our updated team and collaboration structure. Each team is treated as a separate billing entity, with its own plan, users, and usage limits.

If you are added as an editor on more than one team, you will count toward the seat total on each of those teams, and each team will manage your seat and billing as part of their own subscription. You will not be billed individually – all billing remains centralized at the team level.

Note: you can also be added as a view-only collaborator on projects that are a part of different teams. View-only collaborators do not count toward any seat limits or billing.

Can I share projects across multiple teams?

- No, projects cannot be shared across multiple teams. Each project belongs to at most one team, and access is managed within that team’s structure. - If you want someone from another team to collaborate on a project, they must be invited into your team as an editor or granted access using a Single Project Collaborator Pass.

What if I want to continue collaborating with project collaborators who are not on a Teams plan with me?

- With the new pricing model, collaboration is only supported within shared Teams plans. This means that to work together on a project, all collaborators must be part of the same Growth, Business, or Enterprise team. However, users can now be members of multiple teams at the same time, which allows you to create separate teams for different projects, depending on who you need to collaborate with. - Project-level collaboration (where individuals outside your team could be added to specific projects) is being phased out to simplify permissions, ensure security, and support shared billing. - If you would like to continue collaborating: - You can invite others to join your team (additional seats may require an upgrade depending on your plan). - Or, they can create a new team and invite you, depending on who should own billing and project access. - **New:** If you're on a Growth or Business plan, you may also purchase Single Project Collaborator passes, which allows you to grant another paid user access to a single project without adding them to your full team. Each pass is $15/month and can be reassigned to different collaborators or projects as needed. You can purchase up to 4 (Growth) or up to 10 (Business). This collaborator must also be on a paid plan to be eligible to be a single project collaborator. - This change ensures that every project has clear ownership, consistent permissions, and a scalable path for team-based collaboration.

I build apps for clients (agency/freelancer). What plan should I choose?
  • We will now offer multiple plan options to support agencies of all sizes – whether you’re a solo freelancer, a fast-growing studio, or an established consultancy. We believe the best path depends on your team size and how you prefer to work with your clients:
    • Solo freelancers or small agencies (1-5 developers)
      • We recommend the Business plan, which supports up to 5 team members with advanced features like branching and access control.
    • Agencies with more than 5 developers:
      • If your client plans to manage the code:
        • We recommend encouraging your client to purchase their own Business or Enterprise plan and then invite your agency developers to join, either as Team members or as collaborators (with a collaborator pass). To learn more about our Enterprise offering, they can reach out to sales@flutterflow.io.
      • If you intend to maintain the code on behalf of your client:
        • You may qualify for our new Agencies Expansion package, coming out with the Business plan and available to all verified FlutterFlow Expert Agencies.
          • As part of the add-on, you can:
            • Continue to purchase additional seats beyond the 5 included in Business at $85/seat/month
            • And, continue to invite additional paid users to specific projects without requiring them to be team members via Single Project Collaborator Passes.
          • To become eligible now, you can apply to be an Expert Agency on our Contra page. Existing Expert Agencies listed on Contra will be pre-approved to select the Agencies Expansion package starting August 18, 2025.

You can transfer ownership of projects between yourself and your client. To transfer a project to a client, simply add them as a collaborator using a pass, transfer ownership, and then remove them and the pass if no longer needed after the handoff.

### Billing
How will my billing cycle be affected when I move to the new plan?

To ensure a smooth transition, billing changes will align with your existing billing cycle:

  • You will stay on your current pricing until your next billing renewal (monthly or annual). For example:
    • If your monthly billing date is September 3, 2025, your features will switch to the new plan on September 18, 2025 (or earlier if you elect to switch), but new pricing will apply starting your next billing cycle on October 3, 2025.
    • If you’re on an annual plan, your price won’t change until your next annual renewal. After that, the new pricing will apply for the following 12 months.
  • You will have the option to upgrade early to the new pricing plan if you choose, with any remaining credit from your current plan applied toward the new plan.

If you are currently on an annual plan and choose to cancel your subscription during the transition period (August 18, 2025 - September 17, 2025), you will be eligible for a pro-rated refund. This is to account for any features you may have prepaid for under your current plan that will no longer be available once the new plans take effect.

If you have questions about your billing, please contact support at support@flutterflow.io

Will there still be a discount for paying annually on the new plans?

Yes, we will continue offering a meaningful discount on all new plans when billed annually instead of monthly – typically around 25%. This discount remains available regardless of your location or currency and reflects 12 months of service at a reduced monthly rate.

Note: Annual billing is not available for Business teams with greater than 5 seats on transitional pricing, as this is intended to support existing users during their migration period.

How will prices change with respect to country discounts?

Localized pricing will continue where applicable. If you’re in a supported region, your billing will reflect adjusted rates at existing discounts based on your location.

What if I am billed in INR right now?

If your account is billed in INR, your pricing will follow our localized rates:

  • **Basic Plan:** ₹1,300 INR per seat per month.
  • **Growth Plan:** ₹2,650 INR for the first seat, and ₹1,850 INR for the second seat per month.
  • **Business Plan:** ₹5,100 INR for the first seat, and ₹2,850 INR each for seats 2–5 per month.
    • Agencies Expansion: Each additional seat beyond 5 at ₹2,850 INR/month.

All INR pricing reflects the same features and plan structures as USD pricing, with adjustments for local purchasing power.

### Miscellaneous
I have special access. How will this change impact me?

- If you currently have Special Access (such as through a community program, academic use, or other exception), your FlutterFlow Studio experience will remain unchanged. You will continue to have the same benefits provided under your existing Special Access status, which is separate from the new plan structure. - **Note:** - Users with Special Access can collaborate with an unlimited number of users, but those collaborators must also have either Special Access or be on a paid teams (Growth or Business) plan. - Special Access may be granted at either the individual or team level. If only the individual has Special Access, they will not have full feature access when working on team projects unless the team also has Special Access.

I'm on the education plan. Does it include AI usage?

The education plan is still available for FlutterFlow Studio. It doesn't include FlutterFlow or FlutterFlow Studio AI Usage, but it does include the MCP, so you can bring your own agent (BYOA) to build with.

If you'd rather not bring your own agent, you can buy FlutterFlow or FlutterFlow Studio AI Usage alongside your education plan.

To manage your plans, go to your personal workspace settings page in FlutterFlow Studio.

Will the referral program still exist with the new plans, now that the Pro plan is going away?

- With the retirement of the Pro plan, our current referral program will also be sunset. This means any active referral discounts will end at your next renewal. However, any earned referral credits will remain in your account and can be redeemed for equivalent free months of the new Growth plan. - We’re actively exploring what a future referral or incentive program could look like under the new pricing model, with the goal of better supporting and rewarding our community as we grow.

Are there any changes to DreamFlow plans as well?

Dreamflow is a separate product and Dreamflow plans are not affected by this plan update.

# Plan Comparison > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/plan-comparison Compare FlutterFlow Studio plans and features to find the right plan for your needs Choose the plan that fits your development needs and team size. | Feature | Free: $0 a month | Basic: $39 a month | Pro: $80 a month (2nd seat: $55 a month) | Max: $150 a month (Seats 2-5: $85 a month each\*) | |---|---|---|---|---| | **Core platform** | | | | | | Visual development environment: Drag & drop builder for creating apps visually | ✅ | ✅ | ✅ | ✅ | | 1K+ prebuilt templates: Ready-to-use app templates and components | ✅ | ✅ | ✅ | ✅ | | Project count: Number of projects you can create | 2 | Unlimited | Unlimited | Unlimited | | AI usage: One allowance for FlutterFlow and Studio, shown as the percentage left | A free allowance | For a simple app | 2.5× Basic | 5× Basic | | **Collaboration features** | | | | | | Number of editors: Team members who can edit projects | 1 | 1 | Up to 2 | Up to 5 | | Single project collaborator add-ons: Allow non-team members to collaborate on a single project | ❌ | ❌ | Up to 4 (purchasable) | Up to 10 (purchasable) | | Real-time collaboration: Work together on projects simultaneously | ❌ | ❌ | ✅ | ✅ | | Project commenting: Add comments and feedback to projects | ❌ | ✅ | ✅ | ✅ | | Manual commits: Make explicit named commits for version control | ✅ | ✅ | ✅ | ✅ | | Number of branches: Create and manage multiple project branches (all plans include main branch) | Main only | Main only | Main and up to 2 more | Main and up to 5 more | | Automated snapshot backups: Automatic project backups and version control | Up to 1 hour prior | Up to 1 day prior | Up to 3 days prior | Up to 7 days prior | | Project level access control: Manage permissions for individual projects | View-only | View-only | ✅ | ✅ | | Centralized billing: Manage team billing from one account | ❌ | ❌ | ✅ | ✅ | | **Data and integrations** | | | | | | Firebase integration: Connect to Firestore, Firebase Auth, and more | ✅ | ✅ | ✅ | ✅ | | Supabase integration: Connect to Supabase for database and auth | ✅ | ✅ | ✅ | ✅ | | AI agents: Create AI agents with OpenAI, Anthropic, and Google | ❌ | 1 | Unlimited | Unlimited | | API endpoints: Connect to external APIs and services | Up to 2 | Unlimited | Unlimited | Unlimited | | Swagger/OpenAPI imports: Import API specifications automatically | ❌ | ✅ | ✅ | ✅ | | Development environment: Separate databases and config values for testing and production | Default only | Default only | Default and up to 1 more | Default and up to 2 more | | **Development features** | | | | | | Code extensibility: Add custom code to extend functionality | ✅ | ✅ | ✅ | ✅ | | Live debugging: Test your app in the browser and hot reload | ✅ | ✅ | ✅ | ✅ | | Test mode session expiration: How long a Test Mode session remains active before expiring | 20 minutes | No expiration | No expiration | No expiration | | Visual logic builder: Create app logic with a visual editor | ✅ | ✅ | ✅ | ✅ | | State management: Manage app data and user interface states | ✅ | ✅ | ✅ | ✅ | | Custom code expressions: Write custom expressions and logic | ❌ | ✅ | ✅ | ✅ | | One-click localization (i18n): Automatically translate your app using Google Translate API | ❌ | ❌ | ✅ | ✅ | | Push to GitHub: Push your project code to GitHub | ❌ | ❌ | ✅ | ✅ | | VS Code extension: Sync custom code files between FlutterFlow Studio and VS Code | ❌ | ❌ | ✅ | ✅ | | Automated testing: Run automated tests on your applications | ❌ | ❌ | 1 test per project | Up to 3 tests per project | | Test Pilot: Automated test generation and execution for your app | ❌ | ✅ | ✅ | ✅ | | Custom classes: Bring custom Dart classes into your app | ❌ | ✅ | ✅ | ✅ | | YAML editing: Refactor your project by editing the YAML representation | ❌ | ✅ | ✅ | ✅ | | Project API: Programmatic access to project data | ❌ | ✅ | ✅ | ✅ | | Cloud Functions: Write and deploy Firebase Cloud Functions from FlutterFlow Studio | ✅ | ✅ | ✅ | ✅ | | CLI: Command-line interface for downloading code and project management | ❌ | ✅ | ✅ | ✅ | | Configuration file snippets: Directly modify Info.plist, main.dart, Android manifest, and other config files | ❌ | ✅ | ✅ | ✅ | | Local Run desktop emulator: Run code locally with automatic environment setup | ❌ | ✅ | ✅ | ✅ | | MCP server (experimental): Model Context Protocol server integration | ❌ | ✅ | ✅ | ✅ | | **Design features** | | | | | | Design systems: Consistent color schemes, typography, icons, and more | ✅ | ✅ | ✅ | ✅ | | Animations and haptic touch: Add animations and haptic feedback to your app | ✅ | ✅ | ✅ | ✅ | | Custom fonts and icons: Upload and use custom fonts and icons | ✅ | ✅ | ✅ | ✅ | | Custom typography presets: Create reusable text styles and presets | ❌ | ❌ | ❌ | ✅ | | Screenshot generator: Generate app screenshots automatically for App Store review | ✅ | ✅ | ✅ | ✅ | | Figma theme import: Import color and typography themes from Figma | ✅ | ✅ | ✅ | ✅ | | Figma frame import: AI-powered import of Figma frames to FlutterFlow Studio | ❌ | ❌ | ❌ | 100 a month | | **Advanced app features** | | | | | | Push notifications: Send notifications to app users | ❌ | ✅ | ✅ | ✅ | | Payment integration: Integrate Stripe and other payment providers | ❌ | ✅ | ✅ | ✅ | | Ads integration: Monetize your app with advertisements | ❌ | ✅ | ✅ | ✅ | | Third-party package imports: Add pub.dev packages and GitHub dependencies | ❌ | ✅ | ✅ | ✅ | | Debug panel: Advanced debugging tools and console | ❌ | ✅ | ✅ | ✅ | | **Library features** | | | | | | Library imports: Add FlutterFlow Studio libraries to your projects | ✅ | ✅ | ✅ | ✅ | | Library publishing: Publish your projects as reusable libraries | ❌ | ✅ | ✅ | ✅ | | **Deployment** | | | | | | Web deployment: Deploy apps to the web | ✅ | ✅ | ✅ | ✅ | | Free subdomains: Number of free subdomains | Up to 2 | Up to 20 | Up to 20 | Up to 20 | | Custom domains: Connect custom domains | ❌ | 1 free, more purchasable | 1 free, more purchasable | 1 free, more purchasable | | Custom web favicon: Set custom favicon for web publishing | ❌ | ✅ | ✅ | ✅ | | FlutterFlow Studio watermark removal: Remove FlutterFlow Studio branding | ❌ | ✅ | ✅ | ✅ | | Code download: Download project source code | ❌ | ✅ | ✅ | ✅ | | APK download: Download Android APK | ❌ | ✅ | ✅ | ✅ | | One-click store deployment: Deploy to Apple & Google Play stores | ❌ | ✅ | ✅ | ✅ | | **Support** | | | | | | Account and billing support | ✅ | ✅ | ✅ | ✅ | | Community support | ✅ | ✅ | ✅ | ✅ | | Email support | ❌ | ✅ | ✅ | ✅ | | In-app support | ❌ | ❌ | ✅ | ✅ | ## Enterprise Enterprise plans add SSO, activity logs, private cloud options, and dedicated live support. To get pricing, [talk to sales](https://www.flutterflow.io/enterprise#contact). ## Max plan extensions ### \*Agencies expansion Includes all Max features, plus the ability to add up to 7 additional seats (12 total per team) at **$85/seat/month** (USD) or **₹2,850/seat/month** (INR) and collaborate with up to 20 other paid users at the project level via Single Project Collaborator Passes. Must be approved as an Expert Agency via [Contra](https://contra.com/opportunity/rWlmk2Yv-become-a-flutter-flow-agency). ### Localized Pricing INR pricing reflects localized rates adjusted for local purchasing power, providing the same features and plan structures as USD pricing. All plans include the same comprehensive feature set regardless of currency. # Manage Custom Domains > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/manage-custom-domains All paid plans include one free custom domain, with the option to purchase more if needed. All paid plans include one free custom domain, with the option to purchase more if needed. ### How do I purchase additional custom domains? To purchase domains, paid users can go to their [**account**](https://app.flutterflow.io/account) page, find the **Custom Domains** section, and click the **Add Domains** button. ![add-domain](https://docs.flutterflow.io/assets/images/add-domain-84a700e31e777337a9020b211d5d11e7.avif) The **Team** owner can purchase domains from the **My Team** page. Under the **Custom Domains** section, click **Add Domains** to add one for the team. ![add-domain-team](https://docs.flutterflow.io/assets/images/add-domain-team-67be7960a4784781dd35a82b46d31fd1.avif) ### How do I remove custom domains? To remove the custom domain, paid users can go to their [**account**](https://app.flutterflow.io/account) page, find the **Custom Domains** section, and click **Remove Domains** to remove the existing custom domain. The **Team** owner can remove domain from the **My Team** page. In the **Custom Domains** section, click **Remove Domains**. ![remove-domain-team](https://docs.flutterflow.io/assets/images/remove-domain-team-0e5a27ab84bb66dbba1da439fda3369c.avif) # Payments & Billing > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/payments-billing This section contains information on the payment methods we accept and how to change your payment method. This section contains information on the payment methods we accept and how to change your payment method. ## Invoices #### Can I Add A Tax ID (e.g. VAT) to my invoice? If you need to include VAT in your invoices, please reach out to our support team at support@flutterflow.io, and we’ll be happy to assist you with the process. ## Payment Methods ### What payment methods do you accept? We currently accept Visa, Mastercard, American Express, and JCB. ### Can I use a gift card in addition to my credit card? At this time we are unable to process Gift Card payments. ### My payment failed, how can I change to a different credit card? Failed subscription payments happen from time to time. These steps will help you troubleshoot the issue and update your payment method. :::note The most common causes for failed payments are insufficient funds, payment blocked by your credit card provider, or an expired card. If your payment fails, please reach out to your credit card provider for more details on why the payment failed. ::: You can use these steps to update your payment method on an open invoice (where your credit card has not been charged), you can change your payment method using these steps: 1. Head to the [My Account Page](https://app.flutterflow.io/account) 2. Select **Manage Billing** 3. Scroll to **Invoice History** 4. Locate the invoice that failed (should be at the top) and click the icon ![img_17.png](https://docs.flutterflow.io/assets/images/img_17-91a070fe48a576c3e4425fe28ae995e7.png) 5. Enter your updated payment information Once your updated transaction is successfully completed, your system access will be restored. ### I used the wrong credit card, can I change it? Once your subscription has been purchased, we unfortunately are unable to change your payment method for this month. You can change your default payment method for next month's purchase using these steps: 1. After logging into your FlutterFlow Studio, select [“Account”](https://app.flutterflow.io/account) from the top right. 2. In the **My Plan** section, select **Manage Billing.** 3. Scroll down to the **Payment Methods** section. 4. Select **+ New Payment Method,** enter your payment details, and then select **Add.** 5. Remove your old payment method by selecting the three dots to the right of your payment and then selecting **Delete.** :::note You can change the default payment method by selecting the three dots next to the payment method and then selecting **Make Default.** ::: # Privacy And Terms Of Service > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/privacy-terms-of-service How do I request the deletion of my personal data? ### How do I request the deletion of my personal data? To request deletion of your personal data, email privacy@flutterflow.io. ### How do I request a copy of my personal data? To request a copy of your personal data, email privacy@flutterflow.io. ### How do I unsubscribe from marketing emails? To unsubscribe from FlutterFlow Studio marketing emails, please click the “Unsubscribe” link in the footer of our emails. ### Where can I view your Privacy Policy? You can review the most recent version of our Privacy Policy [on the website](https://www.flutterflow.io/privacy). ### Where can I view your Terms of Service (ToS)? You can review the most recent version of our Terms of Service [linked on the website](https://www.flutterflow.io/tos). # Referral Program > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/accounts-billing/referral-program With the retirement of the Pro plan, the existing referral program has been discontinued. Any active referral discounts will end at your next renewal. However, referral credits you’ve already earned will remain in your account and can be redeemed for free months on the new Growth plan. :::caution[Discontinued] With the retirement of the Pro plan, the existing referral program has been discontinued. Any active referral discounts will end at your next renewal. However, referral credits you’ve already earned will remain in your account and can be redeemed for free months on the new Growth plan. We are also exploring new referral and incentive programs to better support and reward our community under the updated pricing model. ::: # Submit Bug Reports > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/misc/submit-bug-report Learn how to submit bug report. This page guides you on submitting the bug reports in the GitHub issue tracker. We have created a [**GitHub repository**](https://github.com/FlutterFlow/flutterflow-issues/issues) specifically for tracking bug reports from our user community. This initiative fosters a more open and collaborative relationship with our users, encouraging them to report any bugs or glitches they encounter while using FlutterFlow Studio. This will enable us to track, triage, and resolve issues in a timely and efficient manner. So, if you encounter any bugs or issues, please don't hesitate to report them on our GitHub repository! 🐛 :::note - You should use this only for reporting **FlutterFlow Studio bugs**. - Any new features, suggestions, and questions should be discussed in the [**community**](https://community.flutterflow.io/home) or submitted through our user feedback form. ::: Here is the simple flow you can refer to submit the bug report: ![Bug reporting flow](https://docs.flutterflow.io/assets/images/submit-bug-report-flow-5607bbbc75d9043356049ef34f4c03ed.avif) Before creating a new issue, it's recommended to search the issue tracker to avoid submitting duplicate reports. If you find an existing issue, show your support by upvoting it using the *Thumbs Up* icon. If you have additional information to share or clarifications to make, add them as comments on the original issue. In case you can't find the relevant issue, you can create a new one with all the necessary details. This will help us address the issue faster and more efficiently. Here are the step-by-step instructions: 1. Open the [issue tracker](https://github.com/FlutterFlow/flutterflow-issues/issues) and click on the **New Issue** button. Note: If you haven't already, you must [create a GitHub account](https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-home). ![new-issue](https://docs.flutterflow.io/assets/images/new-issue-098523880b1bf4743ced662721047370.avif) 2. On the right side of the **Bug Report**, click the **Get Started** button. ![get-started](https://docs.flutterflow.io/assets/images/get-started-392ee263d173c89078bd128c601e3056.avif) 3. When describing your issue in the **Title** box, be as specific and concise as possible. Use descriptive words that accurately convey the problem. For example, instead of simply writing "*DatePicker issue*," provide more details such as "*Disabled future dates in the Date/Time picker action, still shows*". This will help us and others quickly understand the issue and can also help with searchability in case someone else has experienced the same problem. ![disabled-future](https://docs.flutterflow.io/assets/images/disabled-future-1272298d3b1583efaa5a0311fc22b0a0.avif) 4. If your issue doesn't exist and you allow us to access your project for the sole purpose of investigation, you can tick both checkboxes. ![issue-doesnt-exist](https://docs.flutterflow.io/assets/images/issue-doesnt-exist-acd0cd9386d92c1e28ebb9b8e8e437c0.avif) 5. In the '**Current behavior**' section, provide as much detail as possible about the behavior you are experiencing. ![current-behaviour](https://docs.flutterflow.io/assets/images/current-behaviour-ed947ee62061f9766d7ccc338f775ac4.avif) 6. In the '**Expected behavior**' section and enter a clear and concise description of what you expected to happen. Make sure that the expected behavior is realistic and achievable. ![expected-behaviour](https://docs.flutterflow.io/assets/images/expected-behaviour-3a811f4311b24626d56bb7205afe2963.avif) 7. In '**Steps to Reproduce**' section, write the step-by-step instructions to reproduce the bug. Also, mention any specific settings or configurations that might be relevant. This will help us diagnose the issue. **Note**: Issues cannot be accepted if they are too vague. For example, "project fails to build." ![steps-to-reproduce](https://docs.flutterflow.io/assets/images/steps-to-reproduce-19d02f4c751ffeae4968c577c7540852.avif) 8. The '**Bug Report Code**' is a unique code that helps us assess your issue. To copy it, open the **Widget Tree** > **Right Click** > select **Get Bug Report Code** and paste it here. **Note** that if an error is related to a specific widget, select the widget, right click and get the code.

9. Use the '**Context**' section to describe how it has affected you and what you are trying to accomplish. 10. In '**Additional Info**' you can provide a screenshot or recording, links, references, or anything else that will give us more context about the issue you are encountering. :::tip You can attach any media by dragging it here.

::: 11. We must know the environment in which you experienced the issue. You can post such information under the '**Environment**' section. ![environment](https://docs.flutterflow.io/assets/images/environment-4d142e2107a005a0d1e7ec54f978a892.avif) 12. Click **Submit New Issue**. ![submit-new-issue](https://docs.flutterflow.io/assets/images/submit-new-issue-0556bf13483d804bc7c17ab64c87e51a.avif) Once done, your issue will be listed on the issues list, and our team will assign the appropriate label. ![submitted](https://docs.flutterflow.io/assets/images/submitted-56e7c458b66c92d76bad7e06f93fc9b6.avif) # Enterprise > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/misc/enterprise Learn how to use FlutterFlow Studio for Enterprise. ## Whitelist URLs Enterprise environments often restrict internet access to enhance security and compliance. For example, they may allow access only to approved URLs that are essential for work-related tasks. FlutterFlow Studio won't properly work in such restrictions because it accesses multiple services—Firestore, Cloud Functions, and various APIs—these URLs must be allowed in your corporate firewall for everything to function correctly. To find out which URLs need to be whitelisted, navigate to the URL Access page from the FlutterFlow Studio [dashboard](https://docs.flutterflow.io/flutterflow-ui/dashboard). Any URLs marked as **Inaccessible** are currently blocked by your network, which may prevent certain features from functioning properly. You can copy these URLs individually or use the Copy All Inaccessible URLs button in the top-right corner to collect them all at once. Then, share the list with your IT team for whitelisting. ![url-access](https://docs.flutterflow.io/assets/images/url-access-9b3813d91a4ed89f5d6244f16873664b.avif) ## Enterprise Support Policy We understand our Enterprise customers often rely on FlutterFlow Studio for mission critical applications. To that end, we have created a dedicated Enterprise support team to provide the highest level of service and support. This document outlines our support channels and scope for Enterprise customers. ### Support Channels Enterprise customers can reach our dedicated support team either through the chat widget in FlutterFlow Studio or by emailing us. Our Enterprise support team is available 24x7, and we do our best to respond to every support request as quickly as possible. Depending on the complexity of the issue and your Enterprise support subscription, our team can assist through chat, email or video calls. ### What We Can Help With Our goal is for every one of our Enterprise customers to be successful building in FlutterFlow Studio. Here are some of the areas covered by our Enterprise support team: * Guidance on what is possible within FlutterFlow Studio (e.g. can I use non-Firebase authentication) * General education on FlutterFlow Studio features and platform capabilities * Bugs and technical issues with core FlutterFlow Studio features * Team and user account administration Depending on your Enterprise support subscription, we may also provide advisory services in the following areas: * Feature Design & Implementation * Data Infrastructure Design * Integration & Troubleshooting of 3rd-party APIs * Implementation & Troubleshooting of Custom Widgets and Code ### FlutterFlow Studio Bug Policy We know that bugs can be frustrating and we work to fix these on an ongoing basis. If you think you've found a bug, please [submit an bug report](https://github.com/FlutterFlow/flutterflow-issues/issues). #### **Our Approach To Fixing Bugs** To ensure we fix the most critical issues first, we assess each bug based on the severity and number of users impacted. Our highest priority is fixing critical issues that impact a large number of users. Issues impacting a smaller number of users or that have a workaround are addressed after any critical issues are fixed. We provide updates on our bug fixes in our marketing emails and in our Release Tracker. # Hire FlutterFlow Developer > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/misc/hire-flutterflow-developer Learn how to hire a FlutterFlow Developer. You can hire a skilled FlutterFlow Developer to build your app at: https://flutterflow.io/work-with-developers. **FlutterFlow Developers** include agencies and freelancers skilled in building apps using FlutterFlow Studio. Many of them have the **FlutterFlow Expert** badge, awarded to those who demonstrate advanced technical proficiency. To earn this recognition, they must pass the FlutterFlow Expert training and submit a portfolio of their work for our evaluation. :::caution[Please Note] - FlutterFlow Developers are independent professionals, not employees, agents, or affiliates of FlutterFlow Studio. - Any services provided are solely the responsibility of the Developer, not FlutterFlow Studio. - We recommend signing a contract with the Developer before making any payments to ensure clarity on deliverables and timelines. ::: Visit https://flutterflow.io/work-with-developers to get started. ![hire-dev-page.png](https://docs.flutterflow.io/assets/images/hire-dev-page-4ce5c7a7bbc3ba59365e91a8e49d50d5.png) There are two ways to find a Developer: - **Get matched**: Receive recommendations based on your project requirements and preferences (*recommended*). - **Browse Developers**: Explore available Developers, view their details, and reach out to specific ones. In both cases, you’d need to make an account with FlutterFlow Studio, and fill out a project proposal about your project. Make sure to clearly convey your needs, objectives, and any specific requirements. This information is crucial for the Developer to provide you with an accurate timeline and quote. ## Get Matched With Developers To get matched with developers based on your project requirements, follow the steps below: 1. Create or log into your FlutterFlow Studio account. ![login-ff-2.png](https://docs.flutterflow.io/assets/images/login-ff-2-93ef4a99466cd0f58b909780d6aed489.png) 2. Fill out your project details, including features, budget, geo, and language preferences. ![project-details.png](https://docs.flutterflow.io/assets/images/project-details-77fc83a0d4b7fa6cfca1c8b169106d76.png) 3. Review your project proposal for accuracy and completeness. ![review-project-proposal.png](https://docs.flutterflow.io/assets/images/review-project-proposal-b1640398d5c73bce35a263adb518c0d9.png) 4. Confirm your project details to get matched with Developers based on your requirements. ![confirm-developers.png](https://docs.flutterflow.io/assets/images/confirm-developers-40dd0af548322cba1cd6b0acd967d264.png) :::note[Please Note] You can send your request upto 5 Developers at a time. ::: Alternatively, you can browse Developers, view their profiles, and use the **Hire** button to send a personalized project proposal. ![browse-devs.png](https://docs.flutterflow.io/assets/images/browse-devs-f00bb90d36ed1738aa1290273230c11b.png) ## FAQs
Do FlutterFlow Developers work for FlutterFlow Studio?

No, FlutterFlow Developers are independent professionals, including designers, developers, and consultants with expertise in FlutterFlow Studio.

How are Developers selected for my project?

Developers are matched based on your requirements, such as geo, language, budget, and project scope. Priority is given to Developers with the FlutterFlow Expert badge.

Am I obligated to work with a Developer after contacting them?

No, contacting a Developer does not obligate you to engage their services.

How are contracts and payments managed?

Contracts and payments are directly negotiated between you and the Developer. FlutterFlow Studio does not handle contracts or payments. All terms, including scope, costs, and timelines, are agreed upon by both parties. Payments are processed through the Developer’s preferred billing system.

# Additional Resources To Get Help > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/misc/additional-resources FlutterFlow community forum ### FlutterFlow community forum The [FlutterFlow Community](https://community.flutterflow.io/) is a place for you to share ideas, ask questions, and troubleshoot issues with other FlutterFlow Studio builders. The community shares a lot of amazing ideas! To join the FlutterFlow community, 1. Go to your account at [app.flutterflow.io](https://app.flutterflow.io) 2. Next Navigate to Resources tab on the left side 3. Click on "FlutterFlow Community". This will automatically log you in to the community. ![img_5.png](https://docs.flutterflow.io/assets/images/img_5-a0490e088034a42f5ae6b0a70eb16425.png) Alternatively, If you are already in your project view, you can also find the **Help Menu** and click on **Community Forum**. ![img_6.png](https://docs.flutterflow.io/assets/images/img_6-c8f43c9d55691803e9ab86d9965f0c18.png) ### YouTube Our [YouTube channel](https://www.youtube.com/channel/UC5LueiosDVInA6yXE_38i9Q/featured) contains a variety of tutorials and how-to videos. ### Flutter community Questions about Flutter? The [Flutter Community](https://flutter.dev/community) is a great resource! ### Flutter performance best practices [Here are some tips](https://docs.flutter.dev/perf/rendering/best-practices) on how to write the most performant Flutter app possible. # Application & Data Ownership > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/misc/application-data-ownership Intellectual Property ## Intellectual Property At FlutterFlow Studio, we champion the principle of "Own Your Code," reflecting our commitment to enabling creators to retain ownership of their work. As you develop using FlutterFlow Studio, you own the output of your work. FlutterFlow Studio incorporates open-source packages which are included in the code you export. We are diligent in our selection of packages, opting for those with commercially friendly licenses, and any FlutterFlow Studio-generated helpers or libraries will consistently adhere to permissive licenses such as MIT or BSD-3-Clause. Please be aware that third-party Flutter packages may undergo license changes or have dependencies that are not as commercially permissive. We recommend adhering to industry-standard practices to ensure compliance with all relevant licensing requirements. :::note Please read our [**Terms of Service**](https://flutterflow.io/tos) for full details on our Intellectual Property policies. ::: ## Data Handling and Privacy The mobile applications you create with FlutterFlow Studio are designed to operate independently of FlutterFlow Studio's services, ensuring that your end-users' data remains exclusively within your application's ecosystem and does not interact with our servers. In instances where you utilize FlutterFlow Studio's hosting services for web applications, either through our subdomain or your custom domain, we are responsible solely for delivering the frontend of the compiled Flutter web application to your end-users. FlutterFlow Studio maintains a strict policy of non-interference with your end-users' data; we do not access, store, or collect any such data through our hosting infrastructure. :::note Please read our [**Privacy Policy**](https://flutterflow.io/privacy) for full details. ::: # Customer Support Policy > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/misc/customer-support-policy We love connecting with our users and supporting you as you build your application! However, there are a few things that fall outside the scope of our support team. To avoid confusion, we've created this document to outline our Customer Support Policy. We love connecting with our users and supporting you as you build your application! However, there are a few things that fall outside the scope of our support team. To avoid confusion, we've created this document to outline our Customer Support Policy. Have a request for new documentation or tutorials we should create? You can share your ideas [here](https://flutterflow.typeform.com/to/hxg5nxbo). ### Support Hours Our support team is available from 5 AM to 5 PM Eastern Time, Monday through Friday. ### How To Reach Us Depending on your plan, there are multiple ways you can get support when using FlutterFlow Studio: - **Account and Billing Support**: Available for all plans. You can always reach out for help with managing your account or billing-related questions. - **Community Support**: All users have access to the FlutterFlow Community Forums, where you can ask questions, share knowledge, and connect with other builders. - **Email Support**: Available starting from the **Basic** plan and above. Get direct help from our support team via email. - **In-App Support**: Available starting from the **Growth** plan and above. Chat directly with support specialists from within FlutterFlow Studio for faster assistance. - **Dedicated Live Support**: Exclusive to the **Enterprise** plan. Gain direct access to dedicated support specialists for priority, hands-on help. ### What We Can Help With **We are happy to provide guidance on what is possible within FlutterFlow Studio (e.g. can I use non-Firebase authentication), but we don't provide instructions on how to design/build/troubleshoot these features (e.g., how do I implement authentication via Microsoft).** ### Feature Design & Implementation We'd love to help you build your dream app, but there are some topics that are outside of the scope of our support team. If you aren't sure how to implement something, we recommend reaching out to the [FlutterFlow Community](https://community.flutterflow.io/) or connecting with a [FlutterFlow Expert.](https://experts.flutterflow.io/) The following topics are out of the scope of our support team: * Feature Design & Implementation * Data Infrastructure Design * Integration & Troubleshooting of 3rd-party APIs * Implementation and troubleshooting of Custom Widgets and Code ### Additional Resources **Tutorials & How-To Guides** Our [YouTube channel](https://www.youtube.com/channel/UC5LueiosDVInA6yXE_38i9Q/featured) contains a variety of tutorials and how-to videos. In addition to our documentation, our [blog](https://blog.flutterflow.io/) also contains a number of how-to guides. **Troubleshooting Guides**Our documentation contains a number of [troubleshooting guides](#) to help you diagnose and fix common issues. Additionally, our [Community Forum](https://community.flutterflow.io/) is a great place to get ideas and troubleshooting tips from fellow FlutterFlow Studio builders. Lastly, you can connect with a [FlutterFlow Expert](https://experts.flutterflow.io/) to help you troubleshoot an issue or implement a complex new feature. ### Bug Reporting Process We regularly release feature updates and bug releases. To make sure you are on the most recent version of FlutterFlow Studio select Ctrl/Cmd + R. If you think you've found a bug, please submit an [in-app bug report](https://docs.flutterflow.io/flutterflow-ui/toolbar#help-menu) or let us know via chat (Growth, Business and Enterprise users only). Please make sure to include: * A link to your project * The page(s) effected * The expected behavior and the behavior you are experiencing #### Our Approach To Fixing Bugs To ensure we fix the most critical issues first, we assess each bug based on the severity and number of users impacted. Our highest priority is fixing critical issues that impact a large number of users. Issues impacting a smaller number of users or that have a workaround are addressed after any critical issues are fixed. # Security > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/misc/security At FlutterFlow Studio, we consider security to be our utmost priority. We understand the importance of safeguarding your data and ensuring a secure environment for our users. Below, we provide an overview of our security measures to give you confidence in the safety of your information. At FlutterFlow Studio, we consider security to be our utmost priority. We understand the importance of safeguarding your data and ensuring a secure environment for our users. Below, we provide an overview of our security measures to give you confidence in the safety of your information. ## Commitment to Security Security is our top priority. We employ a comprehensive approach to ensure the protection of our users' data, and we continuously strive to enhance our security measures. ## Custom Data Safety Your custom data is in safe hands. We implement robust security protocols to prevent unauthorized access, disclosure, alteration, and destruction of your data. Our systems are designed to ensure the confidentiality and integrity of the information you trust us with. ## SOC2 Type 1 Certification FlutterFlow Studio is proud to be SOC2 Type 1 certified. This certification attests to our commitment to maintaining strict security controls and measures, providing assurance to our users that their data is handled with the highest standards of security. ## GCP Best Practices We follow Google Cloud Platform (GCP) best practices to ensure the security of our infrastructure. By leveraging GCP's advanced security features, we aim to create a resilient and secure environment for our users. ## Security and Monitoring Services FlutterFlow Studio utilizes a range of GCP security and monitoring services to enhance our overall security posture. These services include: * **Cloud Armor:** Protects against DDoS attacks by providing defense at the edge of the GCP network. * **Cloud IDS (Intrusion Detection Service):** Monitors and detects potential intrusions or security threats. * **Key Management Service (KMS):** Manages cryptographic keys used for encryption and decryption. * **Secret Manager:** Safely stores and manages sensitive information such as API keys, passwords, and certificates. * **Cloud Monitoring:** Monitors the performance, uptime, and overall health of our systems. These services collectively contribute to a robust security framework, ensuring that our users' data remains secure and our systems are actively monitored for any potential security incidents. At FlutterFlow Studio, we believe in transparency and accountability when it comes to security. Rest assured that we are dedicated to maintaining the highest standards of security to protect your valuable information. # Detecting Issues > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting A guide to troubleshoot or debug issues that occur within FlutterFlow Studio project. This is a general troubleshooting guide for detecting any issues that occur within FlutterFlow Studio projects. We've improved our issue detection capabilities and added features to provide clearer insights into what might be causing these problems. Here are some options you can use to troubleshoot the issue. ### Using Debug Info panel (Test Mode) The Debug info panel is a powerful tool that provides a real-time view of all the variables in your app along with their current values. This feature is particularly useful for developers who need to track the state of their apps without navigating through different parts of the project and diagnose issues efficiently. It allows you to search for specific variables and filter them based on their type or nullability. By observing how variables change, you can pinpoint where unexpected values or behaviors are occurring and take appropriate action to resolve them. To use the Debug info panel: 1. Run your app in the **Test mode**, and you'll see the **Debug info** panel on the left side. 2. As you interact with your app, the Debug info panel will update variable values in real time. You can monitor these changes to understand how different interactions affect the state of your app. #### Example Suppose you are working on an e-comm app, and while testing, you notice that the variable is unexpectedly set to `null`. This is causing the app to display incorrect information to the user. ![null](https://docs.flutterflow.io/assets/images/null-48cdf051a091f3a23e30be28c48d1c9f.png) Using the Debug Info panel, you can easily trace that the dropdown variable is set to `null` until the user changes the dropdown value. After identifying the root cause, you can make the necessary changes to ensure the variable is correctly initialized. Then, re-test the app to verify that it displays the correct information.

### Opening debug logs To open the debug logs, run your app in Run/Test mode and select: **For Google Chrome** - **Windows**: F12 or Ctrl+Shift+J - **Mac**: F12 or ⌘+Option+J **For Safari** Go to Preferences/Settings > Advanced and enable the "Show Develop menu". Then, use ⌘+Option+C to open the console. This will open the console log, and any errors will be highlighted in red color.

### Desktop app's device logs If you're using our Desktop App and running the app with a local run, you might encounter issues that are logged in the [device logs](https://docs.flutterflow.io/testing/local-run#access-device-logs-in-local-run). These logs can help you understand why something isn't working as expected. For example, if a user enters a character instead of a numeric value for the product quantity, which is not allowed, the error will be logged in the device logs, highlighting the exact issue. :::tip If you're unsure about the meaning of an error message, you can copy and paste the entire error text into ChatGPT and ask for an explanation or solution. ::: For this specific error, [we asked ChatGPT](https://chat.openai.com/share/77f3ceb5-6b2f-4f94-b85c-e01a1fce002a) to explain and guide us on fixing the issue, and the fix was super simple! ![Desktop app's device logs](https://docs.flutterflow.io/assets/images/desktop-app-device-logs-3a09caafb7eeba316ecf567136db7f68.avif) ### Error popup If you see a popup, open the red-colored section (click *Read More*), and at the bottom, you will see the exact widget or error causing the build or download failure. Let's see a couple of examples of what you might encounter while building your app: #### Example 1 Suppose you have a Text widget and added an action that is incomplete. When you try to download the project in such a situation, you might see the following: ![Detecting issue -1](https://docs.flutterflow.io/assets/images/detecting-issue-1-6c9836e3f5e729a284f8050c83fe5ec9.avif) To track down the error-causing widget in the widget tree, start reading the widget list (from top to bottom in a popup) and locate the widget using its child number. For example, when a widget is displayed as *Child 1*, it will be the first child of its previous widget (see the widget in a popup). And when it is shown as *Child 2,3*, and so on, it will be the sibling widget of *Child 1*. If you have a practice of naming the widget, it will be straightforward to track it down (as we'll display the exact widget name). Here is how it looks: ![Detecting issue -2](https://docs.flutterflow.io/assets/images/detecting-issue-2-2db6a3c8cb736754ed0ac65c3deb2e48.avif) :::note To find out what caused the widget to fail, you can check errors in the [project issues](https://docs.flutterflow.io/flutterflow-ui/toolbar#project-issues). ::: #### Example 2 Let's say you have added a custom widget that works fine. But while modifying it, you made some typo in the code, and now it shows this: ![Error while building the app](https://docs.flutterflow.io/assets/images/error-while-building-app-f00db2ecdd9cf55125239a3b725b9b04.png) The second "**Error:"** line clearly mentions that there is some issue with a method name in a custom code. ## Runtime errors (Run mode-only notification) Runtime errors in app development are errors that occur during the execution of the app. Unlike the errors that we display while you build the app, runtime errors occur while the app is running. For instance, if Firestore security rules aren't properly configured, the app might run into permission issues at runtime, leading to failures in data retrieval or display. This kind of error might not be evident during app building but becomes apparent only when the app interacts with the Firestore database during actual operation. We display such errors as *Run mode-only notification* in a snack bar. Here's what it might look like: ![Runtime errors](https://docs.flutterflow.io/assets/images/runtime-errors-d3d2a4d091f5a94fe7d744742986d423.avif) # Enterprise > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/enterprise A guide to troubleshoot FlutterFlow Studio enterprise projects. ## Unable to access FlutterFlow Studio Few enterprise customers might have restrictions in accessing the internet. For example, allowing only safe URLs that are related to their work. If you have such restrictions, you might not be able to access FlutterFlow Studio. To use FlutterFlow Studio and get the best experience, you need to allow all the URLs FlutterFlow Studio uses to operate. Allowlist of URLs: - [app.flutterflow.io](http://app.flutterflow.io/) - [flutterflow-io-6f20.firebaseapp.com](http://flutterflow-io-6f20.firebaseapp.com/) - [https://flutterflow-io-6f20.firebaseio.com](https://flutterflow-io-6f20.firebaseio.com/) - [flutterflow-io-6f20.appspot.com](http://flutterflow-io-6f20.appspot.com/) - [https://storage.googleapis.com](https://storage.googleapis.com/) - https://firestore.googleapis.com/ - https://us-central1-flutterflow-io-6f20.cloudfunctions.net/ - https://www.google-analytics.com/ - https://fonts.gstatic.com/ - https://cdn.jsdelivr.net/ - https://r.wdfl.co/ - [https://maps.googleapis.com](https://maps.googleapis.com/) - https://www.googletagmanager.com/ - https://www.gstatic.com/ - https://docs.flutterflow.io/ # Initialize GitHub Repository > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/github/initialize-github-repository When pushing code to GitHub, the following error may occur: When pushing code to GitHub, the following error may occur: ```js Error pushing repository. Make sure your repository is initialized ``` This typically happens if the GitHub repository was not initialized correctly or if the project exceeds GitHub’s file size limits. :::note[Prerequisites] - Access to your GitHub account. - A FlutterFlow Studio project with GitHub integration enabled. ::: Follow the steps below to initialize a GitHub repository: 1. **Create a New Repository** - Go to **[GitHub](https://github.com/)** and click **New** to create a repository. - Enable the option **Add a README file** during creation. 2. **Connect Repository to FlutterFlow Studio** - Open your FlutterFlow Studio project. - Navigate to **GitHub Integration** and follow the instructions to connect the new repository. ![](https://docs.flutterflow.io/assets/images/20250430121522561282-0a96b3cf65667cd8570589b9b0ca700a.gif) 3. **Download and Inspect Your Project** - Download the full source code from FlutterFlow Studio. - Navigate to the `assets` folder. - Identify any files larger than **25MB**. :::caution[Check Your Asset Size] GitHub does not allow individual files larger than 25MB. Large image or video files may cause push failures. ::: :::tip[Tips to Reduce Project Size] - Use **network assets** instead of uploading large media files directly to FlutterFlow Studio. - Optimize images using tools like TinyPNG or ImageOptim before uploading. ::: :::note[Additional Resources] - **[Connect a GitHub Repo](https://docs.flutterflow.io/exporting/push-to-github#connect-a-github-repo)** - **[State Management](https://docs.flutterflow.io/concepts/state-management)** ::: # Repository Head Deployment Failure > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/github/repository-head-deployment-failure This error may occur when deploying your FlutterFlow Studio app to GitHub using Codemagic. The message Failed to set the repository head indicates a problem with repository access, configuration, or connectivity. This error may occur when deploying your FlutterFlow Studio app to GitHub using Codemagic. The message `Failed to set the repository head` indicates a problem with repository access, configuration, or connectivity. :::note[Prerequisites] - A connected GitHub repository with appropriate access permissions. - GitHub deployment enabled within FlutterFlow Studio. ::: **The Error Message** ```js Failed to set the repository head ``` This message typically appears in the build log during deployment. Below are the possible causes of this error: - The GitHub repository does not exist or was deleted. - The branch specified in build settings does not exist. - Insufficient permissions to push or write to the branch. - GitHub API or network connectivity issues. - Local build errors in the codebase. **Steps to Fix the Deployment Error:** 1. **Confirm the Repository Name** Ensure the repository name in your FlutterFlow Studio deployment settings exactly matches the name in GitHub. 2. **Verify the Branch** Check that the branch exists in the repository and is correctly specified in your build settings. Avoid typos or casing mismatches. 3. **Review Repository Permissions** Confirm that your GitHub account or connected GitHub App has push/write access to the repository and branch. 4. **Check Network Access** Make sure your environment is not blocking GitHub via VPN, firewall, or DNS restrictions. 5. **Validate the Codebase Locally** Run the downloaded Flutter project locally to confirm that it builds without errors. :::note[Additional Resources] - **[GitHub Deployment Overview](https://docs.flutterflow.io/deployment/deploy-from-github#steps-to-deploy)** - **[Codemagic Deployment Error Identification](https://docs.flutterflow.io/troubleshooting/deployment/codemagic-deployment-error-identification)** ::: # API Charset and Encoding Fix Guide > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/api/api-charset-and-encoding-fix-guide When working with API calls in FlutterFlow Studio, you might encounter issues where the response returns with strange characters, incorrect formatting, or unreadable content. These problems are often caused by improper charset or encoding settings either in the API request or the server response. When working with API calls in FlutterFlow Studio, you might encounter issues where the response returns with strange characters, incorrect formatting, or unreadable content. These problems are often caused by improper charset or encoding settings either in the API request or the server response. This guide shows you how to resolve such issues and ensure your API outputs are correctly displayed in your FlutterFlow Studio project. Follow the steps below: 1. **Set Proper Request Headers** Make sure your API call includes the appropriate headers to instruct the server on how to format the response. Add the following headers to your API configuration: - `Content-Type: application/json` - `Charset: utf-8`​ These headers tell the server to return the data in JSON format using UTF-8 encoding, which is compatible with FlutterFlow Studio. ![Setting Content-Type and Charset headers](https://docs.flutterflow.io/assets/images/20250430121409119593-f9abb5e3b9054634e35b7478b2c4ae30.png) 2. **Enable UTF-8 Decoding in FlutterFlow Studio** If the server does not specify encoding—or if you're still getting corrupted text—you can configure FlutterFlow Studio to decode the API response as UTF-8 manually. To do this: 1. Go to your API call setup in FlutterFlow Studio. 2. Scroll to **Advanced Settings**. 3. Enable **Force response decoding as UTF-8**. This setting helps FlutterFlow Studio correctly interpret the API response, especially from servers that don’t return standard headers. ![Force decode response as UTF-8](https://docs.flutterflow.io/assets/images/20250430121409391507-ffa5d343b7e960f80dc91eb8e3d9af2a.png) :::tip[Final Tips] - Always test your API calls in FlutterFlow Studio’s API Test tab to ensure the response is properly formatted. - Confirm that the external API supports UTF-8 and returns a valid JSON response. - Review your server settings if you control the backend, to ensure it sends the correct headers. ::: :::note Incorrect API call outputs due to charset or encoding can be quickly resolved by: - Adding proper headers like `Content-Type: application/json` and `Charset: utf-8`. - Enabling **Force response decoding as UTF-8** in FlutterFlow Studio’s API advanced settings. These simple steps will help you get accurate and readable data from your APIs, resulting in a smoother app development experience. ::: If you still face challenges, don't hesitate to reach out to our support team through Live chat or by emailing support@flutterflow.io # Client-Server Errors During the API Call > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/api/client-server-errors-during-the-api-call When calling an API in FlutterFlow Studio, you may run into client-server errors. These typically come as status codes that indicate what went wrong, either on your end (the client) or on the server you're requesting data from. When calling an API in FlutterFlow Studio, you may run into client-server errors. These typically come as status codes that indicate what went wrong, either on your end (the client) or on the server you're requesting data from. This guide will help you understand the most common API error codes and how to fix them. To learn more about APIs, check out our **[API documentation guide](https://docs.flutterflow.io/resources/backend-logic/rest-api)**. ## Common Client-Side Status Codes These errors are usually caused by incorrect requests from the client side. - **400 – Bad Request** The 400 error is a generic response indicating that the server could not understand the request due to malformed syntax. Common causes include incorrect query parameters or missing fields in the request body. Ensure your request is correctly formatted and all required information is included. :::tip Check the API's own documentation to ensure you're including the correct fields and headers. ::: 400 Example - **401 – Unauthorized** This status code appears when authentication has not yet been provided. To resolve this, ensure you have signed up for the API and included your API key in the HTTP header of your request. 401 Example - **403 – Forbidden** Receiving a 403 error means you're authenticated but do not have permission to access the requested resource. This could be due to using the wrong API key or attempting to access features not available in your subscription plan. 403 Example - **404 – Not Found** The 404 error indicates that the requested URL does not exist on the server. This could be due to a typo in the URL or changes in the API endpoints. Always verify the URL and check for any recent API updates. :::tip Always double-check your request URL before troubleshooting further. ::: 404 Example - **407 – Proxy Authentication Required** You haven't authenticated with the proxy server. This is less common but can happen in restricted network environments. - **422 – Unprocessable Entity** Your request was well-formed but couldn’t be processed. For example, passing a `latlng` without a comma. - **429 – Too Many Requests** This error occurs when too many requests are sent in a short period, exceeding the API's rate limits. To avoid this, implement request throttling or review your API subscription plan to ensure it meets your needs. :::tip Check your API plan limits and consider throttling requests from your app. ::: ## Common Server-Side Status Codes These errors occur on the API server side. - **500 – Internal Server Error** A 500 error can occur for various reasons, often indicating that the API server has crashed. Check your request for accuracy and consult the API documentation for any known issues. - **501 – Not Implemented** This error occurs when the HTTP method used in the request is not supported by the server. Trying a different HTTP method or checking the API documentation for supported methods can resolve this issue. - **502 – Bad Gateway** This error means that the server, acting as a gateway or proxy, received an invalid response from the upstream server. It's usually a temporary issue that should be resolved by the API provider. - **503 – Service Unavailable** The 503 status code indicates that the server is temporarily unable to handle the request due to overload or maintenance. Waiting before sending another request is often the best approach. - **504 – Gateway Timeout** A 504 error suggests that the server, acting as a gateway, did not receive a timely response from the upstream server. This could be due to network latency or the API server processing the request too slowly. **Troubleshooting Steps** - **Clear Browser Cache and Cookies** If you're encountering a 400 Bad Request error, clearing your browser's cache and cookies can resolve issues related to expired or invalid data. - **Verify the Requested URL** Ensure the URL or endpoint is correct. Remember, domain names are case-sensitive. - **Adjust Request Parameters** For 400 errors, check if the file size is too large (for POST requests) or if there are any other incorrect parameters. - **Consult API Documentation** Always refer to the API's official documentation for specific requirements and troubleshooting tips. - **Contact API Support** If you continue to face issues, reaching out to the API's support team can provide further assistance and insights into resolving the problem. Understanding these common API error status codes and their solutions can significantly smooth the development process, ensuring more efficient and effective communication between your application and the APIs you rely on. :::tip[Final tips] - Always check the API's own documentation, inspect your request, and look up error messages. If the issue persists, contact the API provider. - Once you fix the issue, your calls should return a `200 OK`, which means everything is working as expected! ::: # Securing Your API Keys in Private API Calls > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/api/securing-your-api-keys-in-private-api-calls Ensuring the security of API keys is a critical aspect of building and maintaining a safe and reliable application. In the realm of private API calls, it's especially important to make sure your API keys are not exposed. This article aims to provide a best-practices guide on where to place your API keys to increase security in a FlutterFlow Studio environment.​ Ensuring the security of API keys is a critical aspect of building and maintaining a safe and reliable application. In the realm of private API calls, it's especially important to make sure your API keys are not exposed. This article aims to provide a best-practices guide on where to place your API keys to increase security in a FlutterFlow Studio environment.​ **The Misconception: Private API Calls Secure Everything** Many users assume that simply marking an API call as 'private' is enough to protect all associated data. However, this is not the case. Private API calls run in a Cloud Function, which means any keys or sensitive data in the body will be secure, as long as they're not passed in from the frontend. Even in private API calls, if you're loading an API key from the frontend (like from Firebase remote configs), then you're still exposing it.​ ## Secure Placement of API Keys in Your Project The ideal way to secure an API key is to include it in a request header or directly within the API endpoint URL. This ensures that it is never passed in from the client, thereby maintaining its confidentiality.​ For example, you can hard-code the key directly into your API call header like this:​ ```js { "Authorization": "Bearer YOUR_API_KEY_HERE" } ``` Or directly within the API endpoint URL:​ ```js https://api.example.com/resource?api_key=YOUR_API_KEY_HERE ``` The key should never be a variable that gets passed in from the frontend, as that would make it accessible via the client-side code, defeating the purpose of using private API calls for secure operations. ## Verifying the Security of Your API Key After implementing these changes, a straightforward way to verify that your key is secured is by downloading your application code and checking to make sure the API key doesn’t appear in any frontend files.​ Example: Not Secure ![](https://docs.flutterflow.io/assets/images/20250430121157297846-558fb203f7daca2d47d53c7c2ee5fd77.png) Example: More Secure ![](https://docs.flutterflow.io/assets/images/20250430121157601185-d840701955c3ab46620abe83a9ff66df.png) By adhering to these best practices, you can increase the safety of your API keys even while making private API calls. :::note The goal is to keep all sensitive data, including API keys, away from the client side of the application to ensure optimal security. ::: ​ # Codemagic Install Pods Failure > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/apple-store-deployment/codemagic-install-pods-failure During Codemagic deployment, errors may occur at the Install Pods step due to iOS dependency conflicts, unstable code branches, or pod version mismatches. This guide outlines steps to identify and resolve these issues effectively. During Codemagic deployment, errors may occur at the **Install Pods** step due to iOS dependency conflicts, unstable code branches, or pod version mismatches. This guide outlines steps to identify and resolve these issues effectively. :::note[Prerequisites] - You are deploying an iOS app using Codemagic. - Your project includes custom code or third-party packages. ::: ## Fix Dependency Conflicts from Custom Code Custom code or third-party packages may introduce conflicting versions of dependencies that prevent CocoaPods from resolving successfully. **Steps to Resolve Install Pods Failure:** - **Check for Dependency Conflicts from Custom Code** Custom or third-party packages may cause version mismatches with FlutterFlow Studio-supported dependencies. - Review documentation to ensure package compatibility. - Adjust versions in your `pubspec.yaml` file accordingly. - Run: ```bash flutter pub get ``` ![](https://docs.flutterflow.io/assets/images/20250430121132533922-3b7325e726f04e089085f7f88e024042.png) - **Use a Stable GitHub Branch for Deployment** Deploying from unstable branches can introduce unexpected errors during pod installation. - Ensure you're using a branch that passed previous Codemagic deployments. - Remove untested or experimental code. - Revert or refactor recent commits that might break dependencies. ![](https://docs.flutterflow.io/assets/images/20250430121132883140-a6f00f21f57ef2ada91b0b1126ba9db3.png) - **Fix Pod Version Compatibility Issues** CocoaPods may fail to resolve dependencies due to incompatible versions or incorrect iOS deployment targets. - Update packages like `app_settings` in `pubspec.yaml` to versions compatible with your Flutter version. - Raise the iOS minimum deployment target in Xcode if necessary. ![](https://docs.flutterflow.io/assets/images/20250430121133219967-a817d6dd70abcb7fc46406c95445af11.png) :::tip[Deployment Best Practices] - Confirm dependency compatibility before pushing changes. - Always deploy from tested GitHub branches. - Verify your deployment target supports all pods used. ::: # Codemagic Signing Certificate Limit > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/apple-store-deployment/codemagic-signing-certificate-limit During iOS deployment, Codemagic attempts to create distribution certificates in your Apple Developer Account. If the maximum number of certificates has already been reached, the build will fail with a certificate creation error. During iOS deployment, Codemagic attempts to create distribution certificates in your Apple Developer Account. If the maximum number of certificates has already been reached, the build will fail with a certificate creation error. ## Error Message ```bash Build failed :|Step 3 script `Fetch signing files` exited with status code 1 Returned 409: There is a problem with the request entity - You already have a current Distribution certificate or a pending certificate request. ``` This message indicates that Codemagic cannot proceed because no additional distribution certificates can be created. :::note[Prerequisites] - You are deploying an iOS app using Codemagic. - Your Apple Developer Program account is active and linked. ::: **Steps to Resolve Certificate Limit Error:** 1. **Access Your Apple Developer Account** Log into your Apple Developer account to manage certificates: - Go to the **[Apple Developer Certificates List](https://developer.apple.com/account/resources/certificates/list)**. 2. **Navigate to the Certificates Section** In the **Certificates, Identifiers & Profiles** section: - Click on **Certificates**. - Locate all existing **Distribution Certificates**. 3. **Remove Unused or Expired Certificates** Review and delete any unused, expired, or redundant distribution certificates to free up space. 4. **Re-run Deployment** After deleting the certificates, initiate the build process again in FlutterFlow Studio. Codemagic will automatically generate a new certificate as needed. :::note The deleted distribution certificates will be recreated automatically by Codemagic during the next build. ::: # iOS Deployment Authentication Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/apple-store-deployment/ios-deployment-authentication-error During iOS deployment using Codemagic, an authentication credentials error can occur due to misconfigured or expired API tokens for App Store deployment. During iOS deployment using Codemagic, an authentication credentials error can occur due to misconfigured or expired API tokens for App Store deployment. The API token used for App Store Connect may be invalid or expired. :::note For details on generating valid tokens, see the **[Apple API Token Documentation](https://developer.apple.com/go/?id=api-generating-tokens)**. ::: Here is the error message: ```bash Failed Step: Fetch signing files GET https://api.appstoreconnect.apple.com/v1/bundleIds?limit=100&sort=name&filter%5Bidentifier%5D=appname.com&filter%5Bplatform%5D=IOS returned 401: Authentication credentials are missing or invalid. Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens ``` :::note[Prerequisites] - Access to your Apple Developer App Store Connect account. - Permission to manage API keys under **Users and Access**. ::: **Steps to Resolve the Authentication Error:** 1. Open **App Store Connect** and navigate to **Users and Access → Keys**. 2. If prompted, click **Request Access**. 3. Select **Generate API Key** or click the **Add (+)** button. 4. In the popup, provide the following details: - **Name**: Enter a descriptive name for the API Key. - **Access**: Choose the appropriate access level for the key. 5. Click **Generate** to create the API Key. 6. Download the newly created API Key by selecting **Download API Key**. :::note If the download option does not appear immediately, refresh the page. ::: 7. In **FlutterFlow Studio**, go to **Settings & Integrations → Deployment**. 8. Under **Private Key**, click **Upload Private Key**, select the downloaded API Key file, and click **Open**. 9. Retry your iOS deployment. ![](https://docs.flutterflow.io/assets/images/20250430121336383410-4e20c9a876b7745e7dc870012bb098c6.gif) :::note If the error persists after completing these steps, contact FlutterFlow support via in-app messenger or email at [support@flutterflow.io](mailto:support@flutterflow.io). ::: # Download dSYM File from App Store Connect > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/apple-store-deployment/download-dsym-file-from-app-store-connect To download the dSYM file from the App Store Connect Developer Console, follow these steps. To download the dSYM file from the App Store Connect Developer Console, follow these steps. :::note[Prerequisites] - Access to your Apple Developer account. - Your app has at least one build uploaded to App Store Connect. ::: **Steps to Download the dSYM File:** 1. **Sign in** to **[App Store Connect](https://appstoreconnect.apple.com/)** with your Apple Developer account. 2. Open your app. 3. Select a build from the **TestFlight** tab on your project page. 4. Open the **Build Metadata** tab. 5. Under **Include Symbols**, download the dSYM file. ![](https://docs.flutterflow.io/assets/images/20250430121257965718-1878d33e7c1b9d3378179fd47de1e14c.png) :::note The dSYM file is only available for builds that have been successfully uploaded to App Store Connect and are in a "processing" or "ready for submission" state. ::: If the **Download dSYM file** link is not visible, it indicates that the build submission did not complete successfully. In this case: 1. Redeploy the build to the App Store. 2. After successful processing, return to the **Build Metadata** tab and download the dSYM file. ![](https://docs.flutterflow.io/assets/images/20250430121258232331-c39d5ac905c1a85d35b4487febae227c.png) # ImageNotification Development Team Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/apple-store-deployment/imagenotification-development-team-error This error occurs when the ImageNotification entitlement is missing in your Apple Developer account. To resolve it, create a new Identifier for ImageNotification in your Apple Developer account. This error occurs when the **ImageNotification** entitlement is missing in your Apple Developer account. To resolve it, create a new Identifier for `ImageNotification` in your Apple Developer account. :::note[Prerequisites] - Access to your **Apple Developer account**. - Permission to manage **Certificates, Identifiers & Profiles**. ::: **Steps to Create the Identifier:** 1. Sign in to your **[Apple Developer account](https://developer.apple.com/)**. 2. Navigate to **Certificates, Identifiers & Profiles**. 3. Select **Identifiers**. 4. Click the **Add (+)** button. 5. Choose **App IDs** and click **Continue**. 6. Under **Type**, select **App** and click **Continue**. 7. In the **Description** field, enter `ImageNotification` (case-sensitive). 8. In the **Bundle ID** field, enter your full bundle ID followed by `.ImageNotification` (for example: `com.example.app.ImageNotification`). 9. Click **Continue** and then **Register** to complete the setup. Once this Identifier is added, the signing process should proceed without requiring a development team selection. # Custom Domain Connection Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/apple-store-deployment-issues/custom-domain-connection-error If you encounter the error shown below after clicking Connect, follow these steps to resolve it: If you encounter the error shown below after clicking **Connect**, follow these steps to resolve it: ![](https://docs.flutterflow.io/assets/images/20250430121243410633-49bbbf9e371e3a93e2d327ea974c0f87.png) :::note[Prerequisites] - Access to your domain registrar or DNS provider dashboard. - DNS management permissions to add or modify DNS records. ::: **Steps to Resolve the Error:** 1. **Verify DNS Records** - Ensure that you have correctly configured the DNS records required for your custom domain connection. - Add the keys provided by FlutterFlow Studio to your domain’s DNS settings. :::note For A records, if your DNS provider requires a name, you can use `"@"`. When you see an empty value, it typically refers to `"@"`. ::: ![](https://docs.flutterflow.io/assets/images/20250430121243684493-7be68a61e4a14bfdd10b65c006f2def2.png) 2. **Check for Conflicting Records** - Review your DNS configuration to ensure there are no extra or unnecessary records that conflict with the FlutterFlow Studio-provided keys. - For example, if you already have an A record using `"@"`, remove it to avoid conflicts. :::note Before removing any existing DNS records, take screenshots and save them for reference. ::: Below are examples of correct configurations in FlutterFlow Studio and your DNS provider: ![](https://docs.flutterflow.io/assets/images/20250430121243982678-b87737146da4c860ffe03a1fb4672195.png) ![](https://docs.flutterflow.io/assets/images/20250430121244255037-0b78e57dc8fce0a8ff528ae03e8fd28b.png) By following these steps, you can ensure your custom domain is connected correctly. # Custom Domain Connection Issues > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/apple-store-deployment-issues/custom-domain-connection-issues This article provides solutions for common problems encountered when connecting custom domains. This article provides solutions for common problems encountered when connecting custom domains. :::note[Prerequisites] - Access to your domain registrar or DNS provider dashboard. - DNS management permissions to add or modify DNS records. - Familiarity with DNS record types (A, CNAME, CAA). ::: **Steps to Resolve DNS Record Errors:** 1. **Verify DNS Records** - Use tools like **[nslookup.io](https://www.nslookup.io)** to verify that your DNS A and CNAME records match the configuration provided in FlutterFlow Studio. - Ensure no conflicting A, AAAA, or CNAME records exist. ![](https://docs.flutterflow.io/assets/images/20250430121150651702-795c4d0a85619abadc9fcd060e3c2771.png) 2. **Allow Time for DNS Propagation** - DNS updates may take up to 24 hours. - Wait at least one hour after making changes before attempting to reconnect your domain. 3. **Retry Connection** - After verifying DNS settings and allowing propagation, attempt to reconnect your domain. 4. **Contact Registrar Support If Necessary** - If settings are correct and the issue persists after 48 hours, contact your domain registrar to confirm DNS configuration. **Handling Difficulty Creating DNS Records:** - Different registrars require different formats for DNS record names: - For root domains (e.g., `example.com`), some require an empty name, others `"@"`, or the full domain name. - For subdomains (e.g., `test.example.com`), some require just `"test"`, others `"test.example.com"`. - Consult your registrar’s documentation for exact instructions. **Resolving 404 Errors After Domain Connection:** - Publish the project again after connecting the domain. - This usually resolves most 404 errors related to domain connections. **Fixing DNS Restrictions for SSL Certificates:** 1. **Check for CAA Records** - Use **[nslookup.io](https://www.nslookup.io/domains/your-site-name/dns-records/caa/)** (replace `your-site-name` with your domain) to check CAA records. 2. **Adjust CAA Records** - Add `"letsencrypt.org"` to your allowed certificate authorities. - Remove any conflicting CAA records. :::note Once CAA records allow `"letsencrypt.org"`, FlutterFlow Studio will be able to generate SSL certificates and complete the domain connection. ::: If issues persist after following these steps, contact FlutterFlow support via Live Chat or email at [support@flutterflow.io](mailto:support@flutterflow.io). # Web Publishing FAQs > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/apple-store-deployment-issues/web-publishing-faqs This article provides answers to frequently asked questions related to web publishing. This article provides answers to frequently asked questions related to web publishing. :::note[Prerequisites] - Basic understanding of FlutterFlow Studio and Flutter web projects. - Access to FlutterFlow Studio exported web project files. - Familiarity with web hosting concepts. ::: - **What certifications does FlutterFlow Studio web hosting comply with?** FlutterFlow Studio web hosting runs on Google Compute Engine. For detailed information about compliance and certifications, see **[Google Cloud Compliance](https://cloud.google.com/security/compliance)**. - **What are the system requirements for self-hosting a FlutterFlow Studio web project?** FlutterFlow Studio exports standard Flutter code. To compile and host Flutter web apps yourself, review the **[Flutter Web Deployment Guide](https://docs.flutter.dev/deployment/web)**. Compiled Flutter projects produce static files that can be hosted on most web servers without backend technology like Node.js or PHP. - **Do I need backend technologies to host my FlutterFlow Studio web project?** No, compiled Flutter web projects are static content. You can host them on any server capable of serving static files with proper MIME types. - **What should I consider when hosting on a custom domain?** You need to configure DNS settings correctly and ensure SSL certificates are in place for HTTPS. See domain connection guides for more information. For further questions, contact FlutterFlow support via in-app messenger or email at [support@flutterflow.io](mailto:support@flutterflow.io) # App Starts from HomePage in Run Mode > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/authentication/app-starts-from-homepage-in-run-mode If your app always redirects to the HomePage in Run Mode, even after a previous login, it's likely caused by retained authentication state or cached session data in your browser. If your app always redirects to the **HomePage** in **Run Mode**, even after a previous login, it's likely caused by **retained authentication state** or **cached session data** in your browser. ## Troubleshooting Steps - Clear your browser cache and history. ![How to clear browser cache](https://docs.flutterflow.io/assets/images/20250430121300291232-3cadce68e528afe990e06d47b2558512.png) - Try a different browser or use incognito/private browsing mode to see if the issue persists. If the problem continues, consider checking your authentication flow and session management in your app settings. :::tip[Reset Authentication State in Run Mode] When using **Run Mode**, FlutterFlow Studio preserves your **authentication state** across sessions. To test your app from a clean state, add a **"Log Out"** button on your HomePage that triggers the `Sign Out` action. This ensures the app starts from the login screen during your next test. ::: # Check Firebase Login Method > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/authentication/check-firebase-login-method Understanding which authentication method a user has used can be useful for several reasons. For example, it can be leveraged for analytics, user support, and to customize the user's experience based on their login method. This method, however, is specific to Firebase Authentication.​ Understanding which authentication method a user has used can be useful for several reasons. For example, it can be leveraged for analytics, user support, and to customize the user's experience based on their login method. This method, however, is specific to Firebase Authentication.​ In our Flutter app, we can find out which method a user used to authenticate by leveraging Firebase's `User.providerData` property. Let's take a closer look at how this works in the code: ```js import 'package:firebase_auth/firebase_auth.dart'; String getUserSignInMethod() { final user = FirebaseAuth.instance.currentUser; String signInMethod; for (var info in user!.providerData) { signInMethod = info.providerId; } return signInMethod; } ``` Here's a breakdown of the code: - We first import the [Firebase Auth](https://pub.dev/packages/firebase_auth) package which gives us access to Firebase's authentication methods. - Next, we define a function `getUserSignInMethod`. This function will return a string indicating the sign-in method the user used. - Inside the function, we obtain the current user from FirebaseAuth using `FirebaseAuth.instance.currentUser`. - We then declare a string `signInMethod` that will store the name of the provider used for sign-in. - `user.providerData` is an iterable that provides UserInfo for each sign-in method used by the user. We loop over this iterable using a `for` loop. - In each iteration, we assign the `providerId` to our `signInMethod` string. The `providerId` can be 'google.com' for Google, 'facebook.com' for Facebook, and 'password' for email and password. - After the loop is done, the function returns `signInMethod` string which indicates the sign-in method the user used. - The function `getUserSignInMethod()` returns a String value which corresponds to the providerId of the user's sign-in method. Here are examples of how the return value might look like: - If the user has signed in using Google, the function will return: **`'google.com'`** - If the user has signed in using Facebook, the function will return: **`'facebook.com'`** - If the user has signed in using Email and Password, the function will return: **`'password'`** These are the identifiers used by Firebase to represent different sign-in methods. Please thoroughly test this function to ensure it fits your specific requirements :::tip[Use Sign-In Method to Drive Dynamic UI in FlutterFlow Studio] In FlutterFlow Studio, if you want to display or use the user's sign-in method in your UI logic (example, showing different UIs for Google vs. email login), you can create a custom function using the `providerId` approach shown in the article and **connect it to a custom action**. This allows you to make dynamic decisions inside your app based on how the user authenticated. Remember to return the result from the custom function and store it in an App State variable for easy access throughout your app. ::: # Deleting Firebase Users and Related Data > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/authentication/deleting-firebase-users-and-related-data Understanding the Delete Action ![](../assets/20250430121300815719.png "Screenshot showing the delete user action") ## Understanding the Delete Action The delete action in Firebase is designed to remove the user from the authentication table only. This means the user's document in the database will not be affected. If you want to delete the user's document from the database as well, you'll need to create a custom action with some custom code. ### Logging Out After Deletion After completing the delete action, it is important to log out the user. Since the user no longer exists in the authentication system, logging out ensures the app routes the user back to the login page, which is typically the initial page of your project. ## Steps for Proper User Deletion 1. **Delete related data first:** Before calling the delete user action, delete any related data such as Firestore documents or Storage files associated with the user. Once the user is deleted from Firebase Auth, their UID will no longer be accessible in the app session, making it difficult to reference their data afterward. 2. **Handle re-login behavior:** Keep in mind that if the same user signs in again using the same signup method, Firebase will create a new document in the database for them. This happens because Firebase links the new login information to the old user document. :::tip[Important Tips for Deleting Users] - Always delete associated user data from Firestore or Storage **before** deleting the user from Firebase Auth. This prevents orphaned data and issues with data referencing. - Remember that after deletion, the user will need to be logged out to avoid session errors. - If the user signs in again with the same signup method, Firebase creates a new document for them, reconnecting the new login to the old user document. ::: ![](../assets/20250430121301101693.png "Screenshot illustrating user deletion flow") :::note The delete user action in FlutterFlow Studio performs the same operation as manually deleting a user from the Firebase Authentication table. ::: # Fix Google Sign-In Issues > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/authentication/fix-google-sign-in-issues If Google Sign-In isn’t working after exporting your FlutterFlow Studio app, follow these steps based on how you’re deploying your app. If Google Sign-In isn’t working after exporting your FlutterFlow Studio app, follow these steps based on how you’re deploying your app. 1. **If Deployed to the Play Store via CodeMagic** If you published your app to the Play Store using FlutterFlow Studio's CodeMagic integration: - In the **Google Play Console**, open your app from the **All apps** list. - Go to **Setup → App Integrity**. - Under the **App Signing** tab, copy the **SHA-1 certificate fingerprint**. ![](https://docs.flutterflow.io/assets/images/20250430121440426479-9f2c4340a46f05d29580a4763c4ba7f3.png) - In the **Firebase console**, open the same project, scroll to **Your Apps**, and select your Android app. - Click **Add fingerprint**, paste the SHA-1, then click **Save**. ![](https://docs.flutterflow.io/assets/images/20250430121442863891-013b7c6532c00e98fee3f90c4d1f4fbd.png) - In FlutterFlow Studio, go to **Settings → Firebase** and click: - **Regenerate Config Files** - **Generate Files** Re-test your app. Google Sign-In should now work correctly. 2. **If Not Yet Published or Using Manual Signing** If you’re not using Play Store App Signing: - Use **Keytool** or **Gradle's Signing Report** to generate your SHA-1. - In **Firebase**, open your project settings. - Under **Your Apps**, select the Android app and add the SHA-1 fingerprint. - In FlutterFlow Studio, go to **Settings → Firebase**, then: - **Regenerate Config Files** - **Generate Files** Test the app again to confirm Google Sign-In works. *Refer to the [Google Play Services documentation](https://developers.google.com/android/guides/overview) for more information.* :::tip[Add Debug SHA-1 for Local Testing] - When testing Google Sign-In in FlutterFlow Studio before publishing, add your **debug SHA-1** in Firebase. - Then go to `Settings → Firebase` in FlutterFlow Studio and regenerate your config files. ::: # Permission Denied: Code 403 > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/authentication/permission-denied-code-403 This error typically occurs when your application or service account does not have the required permissions to access a resource in Google Cloud or Firebase. This error typically occurs when your application or service account does not have the required permissions to access a resource in Google Cloud or Firebase. ## Code 403 Error Message You may encounter this error due to one or more of the following reasons: - **Invalid or misconfigured service account JSON file** - **Insufficient permissions** assigned to the service account - **Missing or incorrect IAM roles** for the service account - **API not enabled** in the Google Cloud project Do the following to fix this error: - **Check Your Service Account JSON File** Ensure you are using the correct `service-account.json` file and that it is not corrupted or expired. - **Verify IAM Roles and Permissions** Make sure the service account has the necessary roles like `Editor`, `Owner`, or other specific roles required for your use case. - **Enable Required APIs** Go to the [Google Cloud Console](https://console.cloud.google.com/apis/library) and ensure all necessary APIs are enabled for your project. - **Regenerate the Service Account Key if Needed** If you suspect the key is invalid, generate a new one and update your application configuration accordingly. :::tip[Always Use Least Privilege Principle] When assigning IAM roles to your service account, follow the **principle of least privilege**—only grant the minimum permissions necessary for the task. This not only reduces the risk of misconfiguration but also enhances the overall security posture of your app. ::: If you continue to experience issues, consult the [Google Cloud IAM documentation](https://cloud.google.com/iam/docs/troubleshooting-access) or contact [FlutterFlow Support](mailto:support@flutterflow.io) for further assistance. # SafetyNet Phone Sign-In Issue on Android Devices > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/authentication/safetynet-phone-sign-in-issue-on-android-devices If you're experiencing issues with Firebase Phone Authentication on Android devices, especially when using emulators or testing in release mode, this guide will help you identify and resolve common problems. If you're experiencing issues with Firebase Phone Authentication on Android devices, especially when using emulators or testing in release mode, this guide will help you identify and resolve common problems. Firebase uses either **SafetyNet** or **reCAPTCHA** to verify that phone number sign-in requests originate from your app. Issues typically arise when one of these verification methods is not correctly configured. ## Troubleshooting Checklist Ensure the following configurations are in place: - **Firebase Setup** - Your project is correctly set up in the [Firebase Console](https://console.firebase.google.com/). - Firebase Authentication is enabled. - The Phone Sign-In method is activated. - **Phone Authentication Flow** - Prompt the user to enter their phone number. - Send a verification code to the user's phone. - Accept and verify the code entered by the user. - **SafetyNet / reCAPTCHA Configuration** - Your app includes the required Firebase and Play Services dependencies. - SHA-1 and SHA-256 fingerprints are added to your Firebase project settings. - Your API key is either unrestricted or allowlisted. - **Testing Environment** - If you're using an emulator, test on a physical device instead. Emulators may bypass or fail certain integrity checks. ## Firebase Verification Methods Firebase uses one of the following methods to confirm the authenticity of phone sign-in requests: 1. **SafetyNet (Deprecated)** If the device supports Google Play Services, Firebase uses **SafetyNet Attestation** to confirm the device’s legitimacy. :::caution[Deprecated API] The SafetyNet Attestation API is deprecated and has been replaced by the [Play Integrity API](https://developer.android.com/google/play/integrity). After **January 31, 2023**, you can no longer enable the SafetyNet API for new projects in the Google Cloud Console. ::: To use SafetyNet (if still active for your project): - Enable **Android Device Verification (Deprecated)** in the [Google Cloud Console](https://console.cloud.google.com/). - Ensure your app's **SHA-256** is added in the Firebase Console under **Project Settings > General > Your Apps**. - Use the default Firebase API key or request onboarding for SafetyNet if needed. - Monitor your quota [here](https://developer.android.com/google/play/safetynet/quotas). ![](https://docs.flutterflow.io/assets/images/20250430121259958091-c6869a1ed27cc114df371bef037c90f6.png) 2. **reCAPTCHA Verification** If SafetyNet is unavailable (e.g. device without Google Play Services or running on an emulator), Firebase falls back to **reCAPTCHA verification**.The reCAPTCHA challenge usually completes without user interaction. This flow requires: - A valid **SHA-1** fingerprint added to your Firebase project. - An **unrestricted** or **domain-allowlisted** API key (e.g. `your-project-name.firebaseapp.com`). - Ensure both SafetyNet and reCAPTCHA flows are working to support a wider range of Android devices. :::note[Release Mode Configuration] When releasing your app to the Google Play Store, ensure you include the **SHA-1** and **SHA-256** keys from your **Play Console**. Here is how to do that: - Navigate to **Play Console → Your App → Release → Setup → App Signing** - Then copy both **SHA-1** and **SHA-256** fingerprints and add them to Firebase Console under **Project Settings > General > Your Apps**. ::: ![](https://docs.flutterflow.io/assets/images/20250430121300291238-1e1512108bd55771c4c7bc2f003507bd.png) :::note[Learn more] - [Firebase Phone Authentication (FlutterFire)](https://firebase.flutter.dev/docs/auth/phone/) - [Using Firebase Auth in FlutterFlow Studio](https://docs.flutterflow.io/authentication) - [Play Integrity API Migration](https://developer.android.com/google/play/integrity) Still stuck? Check Firebase logs, test on a physical device, and ensure your API keys and fingerprints are correctly added. Proper configuration of SafetyNet or reCAPTCHA is critical to ensuring phone number sign-in works reliably across devices. ::: # Sign in With Apple (for Web) > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/authentication/sign-in-with-apple-for-web To enable Sign in with Apple on the web, you must complete additional steps in both your Apple Developer Account and Firebase Console. These steps allow Apple to identify your website and authorize the use of Apple login on web platforms. To enable **Sign in with Apple** on the web, you must complete additional steps in both your **Apple Developer Account** and **Firebase Console**. These steps allow Apple to identify your website and authorize the use of Apple login on web platforms. :::caution The **Sign in with Apple (Web)** functionality cannot be tested in Test/Run Mode. You must **deploy** your app to a live domain before testing. ::: Take the following steps to set up Sign in with App (for Web): 1. **Configure Apple Developer Account** Follow these steps in your [Apple Developer Account](https://developer.apple.com/account/): 1. **Register a New Identifier** - Select **App IDs** and fill in the required details. - Enable the **Sign in with Apple** capability. 2. **Create a New Service ID** - Provide a name and a unique identifier. - This will be used as the **Service ID** in Firebase. 3. **Configure Sign in With Apple** - Add your domain and return URL (from Firebase). - Save the configuration. 4. **Create a New Key** - Enable **Sign in with Apple**. - Download the generated private key (`.p8` file). 2. **Set Up in Firebase Console** After downloading the private key, configure your Firebase app by doing the following: 1. Go to **Authentication → Sign-in method → Apple**. 2. Enter the following details: - **Apple Team ID** - **Key ID** - **Private Key** (from the `.p8` file) 3. Set the **Service ID** to match the one created in the Apple Developer account. Once these steps are completed, your **Sign in with Apple (Web)** setup should be active. :::note[Still Not Working?] If the sign-in process fails after completing these steps, please contact [FlutterFlow Support](mailto:support@flutterflow.io) via Chat or Email. ::: :::note[Helpful Resources] - [Apple Developer - Sign in with Apple](https://developer.apple.com/sign-in-with-apple/) - [Firebase Authentication - Apple Provider](https://firebase.google.com/docs/auth/web/apple) - [FlutterFlow Studio Authentication Docs](https://docs.flutterflow.io/authentication) ::: # Troubleshooting Custom Authentication > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/authentication/troubleshooting-authentication - Ensure you have a custom server with login and sign-up endpoints that return a JWT token upon success. :::note[Prerequisites] - Ensure you have a **custom server** with login and sign-up endpoints that return a JWT token upon success. - **Custom authentication** must be enabled in FlutterFlow Studio, with entry and logged-in pages correctly set. ::: Here's an example: ![](https://docs.flutterflow.io/assets/images/20250430121149388590-eb05f8e20642cd740ae49b917fb2a8ab.png) ## How to Fix Custom Authentication Issues 1. **Verify Server and API Endpoints** - Confirm that your server correctly returns JWT tokens for login and sign-up requests. The server's response should include the **authentication token**, **refresh token**, **expiration time**, and **user ID (UID)**. - Double-check the API endpoint configurations in FlutterFlow Studio to ensure they match your server’s requirements. 2. **FlutterFlow Studio Configuration** - Make sure **Custom Authentication** is enabled in your project settings. - Verify that the **Entry Page** and **Logged In Page** are correctly set. 3. **UI Configuration** - Ensure your app includes the essential pages for the authentication flow: **Login**, **Sign Up**, and **Home Page** (the page shown when a user is authenticated). 4. **API Integration and Authentication Flow** - Test API calls from FlutterFlow Studio to your custom server to confirm responses are working as expected. - Use the **Backend Call** action to trigger login/signup, then handle the **Custom Login** action using the response data. 5. **Handling Tokens and User Data** - Parse the API response properly to extract and store: - `auth token` - `refresh token` - `expiration time` - `user ID (UID)` - Store these values in local state or secure app storage. ![](https://docs.flutterflow.io/assets/images/20250430121149749937-2f080ea6b813107d114451f2edd8ffa4.png) 6. **Navigation** - If navigation does not occur automatically after login/signup: - Disable automatic navigation. - Use a **manual navigation** action to route users to the appropriate page. :::tip[General Tips] - Test your flow with **dummy credentials** before using real user data. This helps debug token handling, API responses, and navigation. - Add **logging** on both the server and in FlutterFlow Studio (example, using snack bars or alerts) to monitor each step of the flow. - Verify the full flow—from login to protected pages—to ensure everything works as expected. ::: :::note[More Resources] - [FlutterFlow Studio Custom Authentication Video](https://www.youtube.com/watch?v=hnX3CvBtGvI) - **Sample project:** [Custom Auth Checklist](https://app.flutterflow.io/project/custom-auth-checklist-fdjkno) - [FlutterFlow Studio Custom Authentication Documentation](https://docs.flutterflow.io/data-and-backend/custom-authentication) ::: # ListView Gray Box and Red Screen Errors > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/backend/listview-gray-box-and-red-screen-errors When loading a list of items from the database, you might encounter a gray box or red error screen. This article explains the possible causes and how to resolve them. When loading a list of items from the database, you might encounter a gray box or red error screen. This article explains the possible causes and how to resolve them. :::note[Prerequisites] - Ensure your query is correctly connected to a Firestore collection or CMS. - Confirm that your app builds and runs correctly in **Run** and **Test** modes. ::: **Understanding the Error:** A **gray box** usually indicates that the backend query failed to return results. A **red screen** in Test mode suggests a runtime error caused by invalid data or query failure. **Step-by-Step Troubleshooting:** 1. **Verify Query Results** - If the query is successful and returns items, the list will populate as expected. - If there are no records matching the query, you will see the **empty state** you configured. - If the query fails, a gray box (in Run mode) or a red error screen (in Test mode) will appear. ![Empty State](https://docs.flutterflow.io/assets/images/20250430121239249713-c31c0a76d2143af7fdcaeccc648d63b0.png) :::tip Always configure an empty state for lists. This helps distinguish between a failed query and an empty dataset. ::: 2. **Behavior by Mode** - **Run mode**: Displays a gray box when the query fails. - **Test mode**: Shows a red screen with a specific error message. **Example: Working Query with No Results** ![Working Query](https://docs.flutterflow.io/assets/images/20250430121239492027-aa83575a453036ca7dec97a5c5d07c0f.png) **Example: Failed Query** ![Failed Query](https://docs.flutterflow.io/assets/images/20250430121239708989-9f07c45b1dd9e9906e2fe6f44ce93fa5.png) 3. **Check for Null Values in the Data** Null values in critical fields may cause queries or widgets to fail. Here is how to check for null values: 1. Inspect your data in **Firebase** or **CMS** for any fields with `null` values. 2. Pay attention to fields used in filters, formatting, or conditional visibility. 3. For example, if `created_time` is null and you are formatting a date from this field, the query may fail. **Example: Null Field Causing Error** ![Null Field Example](https://docs.flutterflow.io/assets/images/20250430121240227391-6af12dfe0048a0ac5e35266444292525.png) ![Date Formatting Error](https://docs.flutterflow.io/assets/images/20250430121240508011-5f32e3b00fe8ffad5396024a01edb6e4.png) :::note Use **visibility rules** to hide widgets that depend on potentially null values. ::: 4. **Handle Document-From-Reference Queries Safely** If you use document references inside a list item widget, and the reference is null or missing, it will break the query. ![Broken Reference Example](https://docs.flutterflow.io/assets/images/20250430121240818334-9d09c42d5d3bc820c9cbae3b3bdb69d9.png) :::note Always add a visibility rule to any widget performing document-from-reference queries. This ensures the widget is only visible when the reference is valid. ::: :::note[Summary] - A **gray box** means the backend query failed. - A **red screen** indicates a runtime error in **Test mode**. - **Null values** in your database are a common cause of failure. - Always configure **empty states** and apply **visibility rules** to handle null or missing data gracefully. ::: # Fix ListView Only Returning One Item > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/backend/listview-returning-only-one-item If your ListView is only showing one item, this guide will walk you through the common reasons and how to resolve the issue. If your **ListView** is only showing one item, this guide will walk you through the common reasons and how to resolve the issue. :::note[Prerequisites] - A working Firebase or CMS integration. - A dynamic layout widget such as `ListView`, `GridView`, or `Column`. - At least two documents in your Firestore collection for testing. ::: Follow the steps below to resolve the issue: 1. **Use a Dynamic Widget** Make sure you're using a widget like `ListView`, `GridView`, or `Column` that supports dynamic content. 2. **Confirm the Query Type** Ensure the query is set to return a **list of documents**, not a single document. 3. **Review Applied Filters** If you are using filters, check that multiple records in your database satisfy those filter conditions. 4. **Check Firestore Data** Open your Firestore collection and verify that it contains **multiple records**. 5. **Verify List Type Fields** If querying a single field, confirm it's defined as a **List** in both Firebase and FlutterFlow Studio. :::tip To test your setup, remove all filters temporarily and use a basic list query. This helps isolate whether the issue is with filtering or the query type. ::: # Resolving Firebase Configuration Issues > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/backend/resolving-firebase-configuration-issues If you're experiencing backend errors, failed schema validation, or data sync issues, this guide will help you verify and fix your Firebase setup in FlutterFlow Studio. If you're experiencing backend errors, failed schema validation, or data sync issues, this guide will help you verify and fix your Firebase setup in FlutterFlow Studio. :::note[Prerequisites] - You must have already connected your Firebase project to FlutterFlow Studio. - You should have access to your Firebase console with admin rights. ::: Follow the steps below to fix firebase configuration: 1. **Grant Required Permissions** Assign the following permissions to `firebase@flutterflow.io` in your Firebase project: - Editor - Cloud Functions Admin - Service Account User Learn how to **[assign Firebase permissions](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#allow-flutterflow-studio-to-access-your-project)**. 2. **Update Firestore Rules** Update your Firestore security rules to allow access for FlutterFlow Studio. After making changes: - Remove `firebase@flutterflow.io` from your authenticated users. - Redeploy your Firestore rules. - Validate your schema again. ![](https://docs.flutterflow.io/assets/images/20250430121532523511-793bd6baac529fb45002bc73df1636a0.png) 3. **Match Field Types and Names** Check that data field types and names match between Firestore and FlutterFlow Studio exactly. Mismatches will cause query errors. 4. **Validate Firestore Schema in FlutterFlow Studio** Use the **Validate** button under **Firestore → Settings** in FlutterFlow Studio to confirm that your collection schema matches your Firestore structure. 5. **Reset Firebase Setup (If Needed)** If issues persist after following the steps above: - Revoke the current setup. - Reconnect your Firebase project using the **[Firebase setup instructions](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase)**. 6. **Add Authorized Domains** In the Firebase console, go to **Authentication → Sign-in Method → Authorized Domains** and add: `app.flutterflow.io` 7. **Refresh FlutterFlow Studio** Make sure you're using the latest version of the platform: - Press `Ctrl`/`Cmd + Shift + R` - Clear your browser cache - Log out and back in to FlutterFlow Studio 8. **Upgrade to Blaze Plan (If Using Cloud Functions)** Cloud Functions such as Push Notifications and Payments require a billing-enabled Firebase project. Make sure you’re on the **Blaze Plan**. :::tip After updating Firestore rules, always validate the schema using the **Validate** button before proceeding with other fixes. ::: # Update Document Action Fails During Backend Call > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/backend/update-document-action-fails-during-backend-call When performing the Update Document action, you may encounter a situation where the loading indicator appears but then stops without completing the action. This indicates that the update was unsuccessful. If the update succeeds, the next steps in your action flow, such as displaying an alert dialog, should execute automatically. When performing the **Update Document** action, you may encounter a situation where the loading indicator appears but then stops without completing the action. This indicates that the update was unsuccessful. If the update succeeds, the next steps in your action flow, such as displaying an alert dialog, should execute automatically. ![](https://docs.flutterflow.io/assets/images/20250430121241690449-72728d8ac64b57f905a10b2867d628dc.gif) ![](https://docs.flutterflow.io/assets/images/20250430121241899370-d79442f878599856692251154e0ddb36.png) :::note After performing the update action, always verify that the data has been correctly updated in your database. If your document is not streamed in real-time within your app, the updated data may not immediately appear. Check the data in FlutterFlow Studio CMS or directly in Firebase to confirm the update. ::: **Causes of Document Update Failures:** When the update action fails, the action flow stops, preventing any subsequent actions from executing. There are two common reasons why the update action may fail: - **Permission Issue in Firestore** The user may not have the necessary permission to write to the document. ![](https://docs.flutterflow.io/assets/images/20250430121242149430-fd479a11417ff877bd79c30bd2bb66d2.png) **Cause:** The Firestore security rules may not allow the current user to write (edit) documents. **Solution:** Review and configure your Firestore rules to grant write permission. For example, allowing write access to authenticated users is often sufficient if your app requires user authentication. - **Data Type Mismatch** The values you are attempting to write may not match the expected field types. For example, assigning a string value to a field that expects an integer will result in failure. ![](https://docs.flutterflow.io/assets/images/20250430121242530889-edd1b26adbf2601edf31c23cf3647e94.png) **Cause:** Attempting to write a value of the wrong type, such as assigning text to a number field. **Solution:** Verify that the values being written match the expected data types for each field. If the data comes from an API call or form input, consider using custom actions to convert the value to the appropriate type before performing the update. :::note If you want to save a text field value as a number, ensure that the text field input type is set to **Number**. ::: :::note[Additional Troubleshooting] You can check for error details in your browser's developer console (F12). For example, permission errors will typically appear in the console logs, as shown below: ![](https://docs.flutterflow.io/assets/images/20250430121242814005-79f185001a0291f523c966be512c7557.png) ::: # Fix Cloud Functions Deployment > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/cloud-functions/fix-cloud-functions-deployment - You must have a Firebase project connected to FlutterFlow Studio. :::note[Prerequisites] - You must have a Firebase project connected to FlutterFlow Studio. - Ensure your project is on the Blaze Plan. ::: Cloud Functions allow you to execute backend code in response to events triggered by Firebase features or HTTPS requests. Various situations might cause Cloud Functions to malfunction, often stemming from setup problems or coding mistakes within the Cloud Function's script. This article guides you through common challenges with Cloud Functions in FlutterFlow Studio and how to resolve them. **Errors Shown in FlutterFlow Studio Builder** You may encounter the following errors in the FlutterFlow Studio Builder: - `Out of Date (Error)` - `Not Deployed (Error)` These errors can arise from various situations. Below are screenshots of these errors: **Out of Date Error** ![](https://docs.flutterflow.io/assets/images/20250430121126719355-82d03fcbe771f63c6224d5397506917a.png) **Not Deployed Error** ![](https://docs.flutterflow.io/assets/images/20250430121126936614-d515543411b3756f0ff1a0e03156dfb0.png) ## Key Checks for Resolving Deployment Errors 1. **Verify [firebase@flutterflow.io](mailto:firebase@flutterflow.io) Has Necessary Permissions** To ensure FlutterFlow Studio works smoothly with your project, ensure that `firebase@flutterflow.io` has the following permissions in your Firebase project: - Cloud Functions Admin - Editor - Service Account User Follow the steps below to add these permissions: - Go to the Firebase Console and log into your account. - Open your project and go to **Project Settings > Users and Permissions**. - Under **Advanced Settings Permissions**, locate `firebase@flutterflow.io`, click **Edit**, and add the required roles. ![](https://docs.flutterflow.io/assets/images/20250430121127218829-addc39229a055565157b00d29fa41251.png) ![](https://docs.flutterflow.io/assets/images/20250430121127501343-5f6dbb7491d1ddb5d008eb09a0d39245.png) 2. **Check for Function Name Mismatch** Ensure the function name in your code exactly matches the function name defined in FlutterFlow Studio. For example, in this case, FlutterFlow Studio expects `logoMaker`, but the code incorrectly uses `data`. ![](https://docs.flutterflow.io/assets/images/20250430121133833159-5303c0c6008b98cba4972c4d28150935.png) 3. **Validate Custom Code for Cloud Functions** Small mistakes in your custom Cloud Functions code can prevent deployment. - Double-check your code for errors. - Test locally using an IDE or Firebase CLI. ![](https://docs.flutterflow.io/assets/images/20250430121127844921-2a56c94139ae832cc5f01f809a6a424c.png) 4. **Verify Firebase Billing Plan (Blaze Plan Required):** - Ensure your Firebase project is on the **Blaze Plan**, not Spark Plan. - Check billing status on GCP. Even if Firebase shows Blaze, GCP billing issues may still block deployments. 5. **Check if Other Cloud Functions Are Deploying:** - If some Cloud Functions (like Push Notification or Stripe) are deploying successfully, it indicates your Firebase setup is mostly correct. - Focus on inspecting your specific function code and configuration. 6. **Ensure Region Selection Matches Firebase Project:** - The region set for your Cloud Function in FlutterFlow Studio should match your Firebase project's region. - Do not leave the region as `[default]`. ![](https://docs.flutterflow.io/assets/images/20250430121128170242-7e143cda4b0438bc0763b049bb4e6ba1.png) ![](https://docs.flutterflow.io/assets/images/20250430121128453683-c8ce143b6022ca86729958388bf01ca9.png) :::tip If you previously deployed functions in the wrong region, delete them, set the correct region, and re-deploy. ::: 7. **Protocol Conflicts: HTTP vs Callable Functions** If you initially deployed a function as HTTP and later try to redeploy it as Callable (or vice versa), you'll get this error: `[makeUserAdmin(us-central1)] Changing from an HTTPS function to a callable function is not allowed. Please delete your function and create a new one instead.` Follow the steps below to fix this error: - Delete the existing function in Firebase Console. - Modify the protocol type in FlutterFlow Studio. - Redeploy the function. 8. **Verify `package.json` Integrity** - Use the generated `package.json` file as-is unless you need to add extra packages. - Ensure it’s not blank and doesn’t contain invalid characters. **Recommended structure:** ```js { "name": "functions", "description": "Firebase Custom Cloud Functions", "engines": { "node": "22" }, "main": "index.js", "dependencies": { "firebase-admin": "^11.8.0", "firebase-functions": "^4.3.1" }, "private": true } ``` **Node.js runtime errors:** Google retires old Node.js runtimes on a published schedule, and Cloud Functions deploys fail after a runtime is decommissioned. Node.js 18 was decommissioned on October 30, 2025, and Node.js 20 is decommissioned on October 30, 2026. FlutterFlow generates new Cloud Functions with Node.js 22, but a custom Cloud Function's `package.json` is stored with your project, so FlutterFlow can't update it for you. If your `package.json` pins a retired or soon-to-be-retired runtime, FlutterFlow reports a **Cloud Function Runtime** error that doesn't block running, publishing, or exporting your app. A deployment that fails with a message about the Node.js version also means you need to update the runtime. To fix it: - Open **Custom Code > Cloud Functions > package.json**. - Under `engines`, set `node` to `"22"`. - Deploy your Cloud Functions again. 9. **Ensure Packages Are Included in `package.json`** If you are using third-party packages (e.g., `axios`), make sure they are properly added to the `dependencies` section in `package.json`: ![](https://docs.flutterflow.io/assets/images/20250430121128741407-9e4e60bdb55bc4f475e16ffc418576dd.png) 10. **Validate Third-Party Package Versions** The versions specified in your `package.json` should match available versions listed on **[npmjs.com](https://www.npmjs.com/package/axios?activeTab=versions)**. ![](https://docs.flutterflow.io/assets/images/20250430121129014430-550f4af2873fbfeab570f5289e3f4cc0.png) 11. **Check for Undeployed Firebase Rules and Indexes:** - Incomplete Firestore rules or indexes can block function deployment. - Make sure all rules and indexes have been deployed from FlutterFlow Studio. **Additional Troubleshooting and Optimization:** - **Trigger Configuration Issues** If your Cloud Functions are not being triggered: **Review Event Triggers:** - For Firestore triggers: verify document paths and collection names. - For HTTP functions: ensure correct setup in FlutterFlow Studio. **Check Permissions and Rules:** - Firebase security rules and project permissions must allow the Cloud Function operations. - **Execution Timeouts** - Cloud Functions may fail if execution time exceeds limits. - Set a custom timeout duration in FlutterFlow Studio: ![](https://docs.flutterflow.io/assets/images/20250430121134186956-dd7a3ea01e0cbbd3b9e85a7913ce88f4.png) For longer processing tasks, increase the timeout duration in your Cloud Function configuration. Configuring Cloud Function regions in FlutterFlow Studio can also optimize performance: ![](https://docs.flutterflow.io/assets/images/20250430121134509618-5cc01a26e7e36f1760c722f41c26a33a.png) :::note Longer timeouts may increase Firebase costs. ::: - **Cold Start Delays** Cloud Functions may respond slower after periods of inactivity: - Use **Cloud Scheduler** to periodically invoke functions and keep them warm. - Minimize dependencies to reduce cold start delays. Following this comprehensive troubleshooting guide should help you resolve most issues encountered when working with Cloud Functions. # Custom Actions Errors > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/custom-actions/custom-actions-errors - A basic understanding of how custom actions work. :::note[Prerequisites] - A basic understanding of how custom actions work. - A FlutterFlow Studio project with a custom action already created. ::: Custom actions are powerful, but troubleshooting them can be tricky. This guide will help you systematically resolve common issues. - **Read the Error Message** Always read the error message printed during test mode, compilation, or local build. The message often provides a clue about the potential issue. - **Common Troubleshooting Checklist** - **Action Name Mismatch** Ensure the name in the action matches the custom action in your code. ![](https://docs.flutterflow.io/assets/images/20250430121138021235-b2a84894e26e51c308d8165327e7429c.png) :::tip Use the `Add BoilerPlate Code` option to generate code with the correct action name. ::: - **Imports and Arguments** - Check that all required imports are present. - Ensure arguments are defined in both the action settings and your code. ![](https://docs.flutterflow.io/assets/images/20250430121138830209-e031679e2bcca11bc6ec7ce09fe26dbe.png) Example: - Argument 1: Missing definition in settings panel - Argument 2: Correctly imported - Argument 3: Nullable selected, but not specified as nullable in code Follow the steps below to fix this issue: 1. Manually update arguments in both the settings panel and your code. 2. Use the `Add BoilerPlate Code` option (on web, copy only what you need; on desktop, it may replace all code). ![](https://docs.flutterflow.io/assets/images/20250430121139816551-758c54ef51a14b4f6fc2012ea6588d24.gif) - **Name Conflicts** - Avoid using the same name for an action and its argument. ![](https://docs.flutterflow.io/assets/images/20250430121142594662-94f9b7f5c350fec098cb25851c074efc.png) - **Reserved Keywords** - Do not use Dart/Flutter reserved keywords as argument names. **Examples:** `abstract`, `else`, `import`, `show`, `as`, `enum`, `in`, `static`, `this`. *FlutterFlow Studio usually warns you, but double-check!* - **Return Type Mismatch** - Ensure the custom action returns the correct data type as defined in the settings. ![](https://docs.flutterflow.io/assets/images/20250430121143268592-1f07b2e96bfa688e76f7e800463421b9.png) *The function should return the type specified in the settings panel.* - **Internal Library Imports** - If importing internal libraries (example, `../../flutterflow`), set **Exclude from compilation** to `true` if needed. - **Pubspec Dependencies** - Ensure your dependencies are declared in your code and are compatible with FlutterFlow Studio. ![](https://docs.flutterflow.io/assets/images/20250430121143614166-de2881be9794e6225e63e65781a10a65.png) Check for: - Version conflicts (check on **[pub.dev](https://pub.dev)**) - Multiple versions of the same dependency - Conflicts with FlutterFlow Studio's auto-imported dependencies ![](https://docs.flutterflow.io/assets/images/20250430121143935249-28fbc1d922eb729fa65f328f42233253.png) ![](https://docs.flutterflow.io/assets/images/20250430121144228150-4b655f3fe4751bc7cf795ca8a02bd9e5.png) - **Code Errors:** - **Null values:** Handle null values safely. ```js int example = passingIntWhichMayBeNullable ?? 0; ``` - **Correct data types:** Convert data types explicitly. ```js String str = "5"; int result = int.parse(str); // ✅ ``` Use `.toString()`, `.toInt()`, `.toDouble()` as needed. - **Single elements** vs **arrays:** Ensure you are not passing a single element where a list is expected, or vice versa. - **Exclude from Compilation** If this option is enabled, the code won’t be checked during build but can still run during test.. ![](https://docs.flutterflow.io/assets/images/20250430121144509497-570186a33271937e74fe0b06fe081a55.png) - **Duplicate Data Types/Structs** Do not redefine data types or structs already defined in the data schema panel. ![](https://docs.flutterflow.io/assets/images/20250430121144853131-5e03acb547d4795fece1d7396bf9848c.png) - **Callback Data Types** Ensure callback actions return the correct data type. ![](https://docs.flutterflow.io/assets/images/20250430121145202849-bb345fa114bbdf9028e9ac06984923fc.png) :::note[Additional Resources] - **Debugging with the Browser Console:** Use the browser debug console for logic errors. - **FlutterFlow University Video**: [Custom Actions Video](https://www.youtube.com/watch?v=rKaD9eKuZkY). - **Official Docs:** [Custom Actions | FlutterFlow Docs](https://docs.flutterflow.io/concepts/custom-code/custom-actions) ::: :::tip When in doubt, regenerate the boilerplate and compare with your code. Consistency between settings and code is key! ::: # Testing Custom Actions using Debug Console > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/custom-actions/testing-custom-actions-using-debug-console Sometimes, the compiler does not show any errors in the custom action, but the custom action still won't work as expected. This might be due to the code logic or the implementation. In order to test the implementation and the flow, you can use the debug console to test the custom action in different scenarios. Sometimes, the compiler does not show any errors in the custom action, but the custom action still won't work as expected. This might be due to the code logic or the implementation. In order to test the implementation and the flow, you can use the debug console to test the custom action in different scenarios. :::note[Prerequisites] - You have created a custom action in FlutterFlow Studio. - You are familiar with using Run Mode and viewing the browser console. ::: The core function that you can use to test the custom actions on the console is the `debugPrint` function in Flutter. To use that in the custom actions, follow the steps below: 1. **Add `debugPrint` Statements in the Code** Use `debugPrint` to print some error on the debug console in case of a specific result. You can use if-else statements or try-catch statements in order to test the success of the scenario. ![](https://docs.flutterflow.io/assets/images/20250430121216632942-63960ad02159d34e7a6e652d1cb4c7c3.png) Example: ```js try { final result = someFunction(); debugPrint('Function result: $result'); } catch (e) { debugPrint('Error occurred: $e'); } 2. **Run the App and Open Console** After the correct implementation in the code, use the action inside the app. On the run mode, open the console. Now you should be able to see the errors in the console upon performing the action. ![](https://docs.flutterflow.io/assets/images/20250430121216962021-90ed68f4858e11cecae8b90992a7de16.png) :::note[Still having issues?] If you continue to experience issues after testing your logic with debugPrint, please contact support at support@flutterflow.io.​ ::: # Codemagic Deployment Error Identification > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/deployment/codemagic-deployment-error-identification Follow the steps below to identify your codemagic error: Follow the steps below to identify your codemagic error: - Press **Cmd/Ctrl + k**, type **"deployment"** and hit enter. It will take you to the deployment page.​ ![](https://docs.flutterflow.io/assets/images/20250430121346608131-6051c8ea2ed39c336fb416c77c21edd9.png) - Navigate to the Deployment section by clicking **Project Settings** > **Deployment** (under App Settings).​ ![](https://docs.flutterflow.io/assets/images/20250430121346890273-bd3b94558011c64dfb0021518ec0be4a.png) ​ - Click on the **Failed (VIEW LOGS)** text to see the logs. ​ ![](https://docs.flutterflow.io/assets/images/20250430121347217644-55dff2897e82db223506ec239460e025.png) In this step, you'll need to note the Failed Step that been displayed by CodeMagic error log. ​ ![](https://docs.flutterflow.io/assets/images/20250430121347593094-8827607888b9888bcf0478b4223d6c1e.png) ​ - Now, press **Cmd/Ctrl + F** to search for the term **"error"** in the logs to find the root cause of the issue. Keep pressing **"Enter"** till you find the error ( this is usually at the bottom of the logs ). If you search for "error" and still don't find an error message that makes sense to you then you can also try with the following keyword: "message". ![](https://docs.flutterflow.io/assets/images/20250430121347925706-7968ab925bd39390fc5f6701162d0f4e.png) - Now select and copy this error message and paste it in the Help Center search in the chat icon in the bottom-right corner to search the error. This will help you find the help article for this issue and then you can find the fix for it. ![](https://docs.flutterflow.io/assets/images/20250430121348293622-e59b4593b13524be85bdee95d0b752ca.gif) # CodeMagic Deployment Tips > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/deployment/codemagic-deployment-tips Here are some tips to avoid Deployment issues: Here are some tips to avoid Deployment issues: :::tip - Make sure you've followed all the steps for **[setting up deployment](https://docs.flutterflow.io/deployment/deploy-for-environments#mobile-deployment)** in your project. - If you choose a deployment source from a GitHub Repository then please make sure that it's associated with FlutterFlow Studio's GitHub integration. - If you are deploying to the Play Store from a GitHub repo, make sure to modify your build.gradle file to sign in release mode. - Setting a version number is optional but may be required for specific cases. If you are updating an existing app that has not been deployed using FlutterFlow Studio yet, you will want to specify a version number. ::: # Deployment Issues with Stripe Integration > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/deployment/deployment-issues-with-stripe-integration Integrating Stripe in your FlutterFlow Studio project can help you accept payments efficiently. However, some common deployment issues may arise. This article outlines key steps and best practices to ensure a smooth Stripe integration and deployment experience. Integrating Stripe in your FlutterFlow Studio project can help you accept payments efficiently. However, some common deployment issues may arise. This article outlines key steps and best practices to ensure a smooth Stripe integration and deployment experience. 1. **Firebase Connection** Stripe integration requires a connected Firebase project. Before running through this checklist, it's important to ensure your FlutterFlow Studio project is linked to Firebase, a crucial step for successful payment processing. Detailed guidance can be found at **[FlutterFlow Studio's Firebase Setup Guide](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#step-1-set-up-your-project)**. 2. **Upgrade to Firebase Blaze Plan** Stripe functionality requires a Firebase Blaze Plan for operational capabilities. To avoid disruptions, you will need to upgrade from the Firebase Spark plan to the Blaze plan. Learn more about **[Google's process for upgrading](https://firebase.google.com/docs/projects/billing/firebase-pricing-plans)**. 3. **Set the Google Cloud Platform (GCP) Location** A defined Google Cloud Platform (GCP) location for your Firebase project ensures the correct regional operation of services. The absence of a set location can hinder the deployment process.​ 4. **Firebase Project Permissions** Ensure you have the necessary permissions enabled for your Firebase project. Two critical permissions involve access management and service configuration. You can also reference the **[setup guide](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#step-1-set-up-your-project)** as well.​ ![](https://docs.flutterflow.io/assets/images/20250430121145949036-0d7529a28637317e6b080a6dfde3dce7.png) 5. **Correct Merchant Code** Use the correct 3-letter merchant country code (e.g., "GBR" for the United Kingdom vs. "UK"). Incorrect codes can lead to failed transactions. For accurate codes, refer to **[IBAN Country Codes](https://www.iban.com/country-codes)**.​ ![](https://docs.flutterflow.io/assets/images/20250430121146161973-ce254157c126b63ba4f6d28b18407876.png) ![](https://docs.flutterflow.io/assets/images/20250430121146400049-7bd69ca688add81b57c2786e5c82167a.png) 6. **Test and Live Keys** For deployment, both Test and Live Stripe keys must be configured in your project settings, regardless of the development stage. This ensures Stripe's API can properly interact with your application.​ ![](https://docs.flutterflow.io/assets/images/20250430121146604033-9d93238a034787161270b25ce87ec7b8.png) 7. **Consistent Region Settings** Align your Firebase project's region with that of your FlutterFlow Studio settings to prevent deployment failures. Inconsistencies can cause function deployment issues.​ ![](https://docs.flutterflow.io/assets/images/20250430121146854018-b344665d460afd8118a7232a42fad81a.png) ![](https://docs.flutterflow.io/assets/images/20250430121147068781-e3650708a342858946ee640eb2349795.png) If you find that this article hasn't fully addressed your concerns or if you have more questions, please don't hesitate to reach out to us at support@flutterflow.io ​ # Fixing Razorpay Deployment > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/deployment/fixing-razorpay-deployment Razorpay is a major payment processor in India. Integrating Razorpay can allow users to make payments using their app. This article outlines some common scenarios and troubleshooting instructions for Razorpay deployment issues. Razorpay is a major payment processor in India. Integrating **[Razorpay](https://razorpay.com/)** can allow users to make payments using their app. This article outlines some common scenarios and troubleshooting instructions for Razorpay deployment issues. 1. **Firebase Integration and Auth** FlutterFlow Studio uses Firebase integration and cloud functions to facilitate Razorpay payments. Ensure you have Firebase configured in your FlutterFlow Studio project and that Firebase Auth is enabled. ![](https://docs.flutterflow.io/assets/images/20250430121119193097-a438f40c7cdfcb6f5d1835d2ec6f5fc7.png) ![](https://docs.flutterflow.io/assets/images/20250430121119493481-f8b5d61a1b92ca72e37c18aab36a3c1c.png) 2. **Firebase Blaze Plan** Razorpay uses cloud functions behind the scenes to facilitate payments. Cloud functions are a part of Firebase's "Blaze" plan. You must upgrade from the Firebase Spark plan to the Blaze plan to avoid disruptions. Learn how to upgrade here. On the bottom left side of your Firebase console, you will see which plan you are on ![](https://docs.flutterflow.io/assets/images/20250430121119754142-f2fe2017ace7abe5aff8a39815eb0f66.png) 3. **Set Google Cloud Location** Ensuring your Firebase project is pinned to a specific Google Cloud Platform (GCP) location is key for optimal service functionality across regions. Skipping this step could result in errors.​ ![](https://docs.flutterflow.io/assets/images/20250430121145711998-04519b51a0219b97efed58e9cb8f6302.png) 4. **Firebase Project Permissions** Make sure your Firebase project has the required permissions activated. Access management and service configuration are two essential permissions to focus on. For guidance on setting these up, look at the instructions in the **[FlutterFlow Studio Project Setup](https://docs.flutterflow.io/resources/projects/settings/project-setup)**. 5. **Razorpay Keys Check** Make sure to copy and paste the correct Key ID and Key Secret from Razorpay for testing and production, respectively. For testing, make sure "Is Production" is turned off. ![](https://docs.flutterflow.io/assets/images/20250430121120324713-954f9bacfc758924edb56feaf8d03874.png) ![](https://docs.flutterflow.io/assets/images/20250430121120614698-427f7e6d97ef154687e5c52d418bade7.png) ![](https://docs.flutterflow.io/assets/images/20250430121120833797-47659c8138d19168b2aa7de8c2f896c3.png) 6. **Razorpay Business Name** Finally, ensure you have entered the proper "Business Name" in the Razorpay additional settings in FlutterFlow Studio. Make sure this business name matches your business name in Razorpay records. ![](https://docs.flutterflow.io/assets/images/20250430121121100378-562380f0010a8034013ffb62e8768126.png) :::note[Other Considerations] Razorpay currently works only on mobile (Android and iOS). This is due to a limitation from Razorpay's Flutter Package. If you are planning to collect payments on a web app - consider using Stripe. ![](https://docs.flutterflow.io/assets/images/20250430121121294657-9281e98e690de9a3fbc9f3190be20cd5.png) ::: If you are still facing issue with deploying Razorpay on Flutterflow, please feel free to reach out to support@flutterflow.io # Fixing Stripe Deployment & Payment Errors > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/deployment/fixing-stripe-deployment-and-payment-errors Integrating Stripe for payment processing in FlutterFlow Studio can significantly simplify monetization. However, developers may encounter issues during deployment or while managing transactions. This guide outlines common deployment and payment issues—and how to fix them—to help ensure a seamless Stripe integration experience in FlutterFlow Studio apps. Integrating Stripe for payment processing in FlutterFlow Studio can significantly simplify monetization. However, developers may encounter issues during deployment or while managing transactions. This guide outlines common deployment and payment issues—and how to fix them—to help ensure a seamless Stripe integration experience in FlutterFlow Studio apps. ## Deployment Checklist for Stripe Integration 1. **Firebase Connection** Stripe integration requires a connected Firebase project. Before running through this checklist, it's important to ensure your FlutterFlow Studio project is linked to Firebase, a crucial step for successful payment processing. Detailed guidance can be found at **[FlutterFlow Studio's Firebase Setup Guide](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase)**. 2. **Upgrade to Firebase Blaze Plan** Stripe functionality requires a Firebase Blaze Plan for operational capabilities. To avoid disruptions, you will need to upgrade from the Firebase Spark plan to the Blaze plan. Learn more about **[Google's process for upgrading](https://firebase.google.com/docs/projects/billing/firebase-pricing-plans)**. 3. **Set the Google Cloud Platform (GCP) Location** A defined Google Cloud Platform (GCP) location for your Firebase project ensures the correct regional operation of services. The absence of a set location can hinder the deployment process.​ 4. **Firebase Project Permissions** Ensure you have the necessary permissions enabled for your Firebase project. Two critical permissions involve access management and service configuration. You can also reference the **[setup guide](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase)**.​ 5. **Correct Merchant Code** Use the correct 3-letter merchant country code (example., "GBR" for the United Kingdom vs. "UK"). Incorrect codes can lead to failed transactions. For accurate codes, refer to **[IBAN Country Codes](https://www.iban.com/country-codes)**.​ 6. **Test and Live Keys** Both Test and Live Stripe keys must be configured in your project settings, regardless of the development stage. This ensures Stripe's API can properly interact with your application.​ 7. **Consistent Region Settings** Align your Firebase project's region with that of your FlutterFlow Studio settings to prevent deployment failures. Inconsistencies can cause function deployment issues.​ ## Addressing Payment Transaction Issues 1. **Authentication Requirement** Stripe payments **require an authenticated user session**. Before initiating payment processes, ensure your application logic includes user login or account creation. 2. **Payment Modal Variations** It's important to note that web and mobile platforms present different payment modal presentations. These UI differences are out-of-the-box for Stripe and cannot currently be customized within FlutterFlow Studio. 3. **Price Format** Prices should be submitted to Stripe in **cents**, not **dollars**. Utilize a custom function to convert dollar values to cents for accurate transaction processing.​To set a price in cents to Stripe, you can simply use a custom function that takes the price in dollars and returns it as cents.​ Here is a custom code you can use to make this calculation in a custom function: ```js int dollarToCent(double amount) { // Convert the amount to a string String st = amount.toString(); // Remove any dots or commas st = st.replaceAll('.', ''); st = st.replaceAll(',', ''); // Convert the cleaned string to an integer return int.parse(st); } ``` // Input: 14.99 // Output: 1499 cents 4. **CORS Error Resolution** A CORS error during payment initiation often indicates a permissions issue with your Firebase function. Verify and adjust the `allUsers` permission for your Stripe function in the Firebase console to resolve this error.​ ![](https://docs.flutterflow.io/assets/images/20250430121147385978-51634e1a435a358149efcdd9361de1bf.png) ![](https://docs.flutterflow.io/assets/images/20250430121147683388-db162fbb7e44ca3923b1521c56743149.png) 5. **Subscriptions** Currently, Apple and Google restrict Stripe subscriptions on mobile platforms. To expand your subscription capabilities, you can use alternative solutions like RevenueCat for mobile apps and direct API calls for web applications.​ :::note[**For further information and troubleshooting:**] - [Stripe Documentation](https://stripe.com/docs) - [Stripe Payments](https://stripe.com/payments) - [FlutterFlow University](https://university.flutterflow.io/) - [Payments - Intro | FlutterFlow University](https://university.flutterflow.io/courses/flutterflow-payments) ::: # Resolve Errors in Downloaded Code > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/deployment/resolve-errors-in-downloaded-code When you download your project from FlutterFlow Studio and run it locally in your IDE, you may encounter errors due to Flutter version mismatches. This guide outlines how to resolve these issues by ensuring your local Flutter version matches the version supported by FlutterFlow Studio. When you download your project from FlutterFlow Studio and run it locally in your IDE, you may encounter errors due to Flutter version mismatches. This guide outlines how to resolve these issues by ensuring your local Flutter version matches the version supported by FlutterFlow Studio. 1. **Check FlutterFlow Studio’s supported Flutter version** To find the Flutter version currently supported by FlutterFlow Studio: - Open the FlutterFlow Studio dashboard. - Navigate to your project settings or export screen. - Locate the displayed Flutter version used for your project. ![](https://docs.flutterflow.io/assets/images/20250430121137152872-9f928bf5f226f815cf41220d9edc1795.png) 2. **Verify the Flutter version on your machine** To check the Flutter version installed locally, run the following command in your terminal: ```js flutter --version ``` Here's an example of how you can do that: ![](https://docs.flutterflow.io/assets/images/20250430121137421780-b885347a16240cdd13b780ae93f2b68a.png)​ 3. **Upgrading or Downgrading to the correct Flutter version** If the current version on your machine is different than what is currently supported by FlutterFlow Studio, you can downgrade or upgrade to the supported version. You can learn more about [**upgrading Flutter**](https://docs.flutterflow.io/testing/local-run#4-running-app-on-device). ​By following these steps, you can fix the errors that you face after downloading the code and run locally. If you continue to experience issues, contact the FlutterFlow support team via live chat or email at support@flutterflow.io. # Run Mode: Build Failure > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/deployment/run-mode-build-failure Encountering a "Run mode: Build failed" error can be frustrating when you're eager to see your app in action. This error typically signifies a project issue that prevents a successful build. Addressing these errors promptly ensures your app's functionality and performance. Encountering a "Run mode: Build failed" error can be frustrating when you're eager to see your app in action. This error typically signifies a project issue that prevents a successful build. Addressing these errors promptly ensures your app's functionality and performance. This guide provides a structured approach to troubleshooting and resolving "Run mode: Build failed" errors, ensuring a smooth development process for your projects. - **Recognizing the Error** Here's what the "Run mode: Build failed" error looks like inside of FlutterFlow Studio: ![](https://docs.flutterflow.io/assets/images/20250430121148301014-4d413e5fef4fbe4880435e75c2edf4ee.png) - **Understanding Test Mode vs. Run Mode** Here's a little background on run mode vs. test mode in FlutterFlow Studio. Test mode runs as a "test" to help you identify errors before deployment. These features include a debugger and display warnings. Alternatively, run mode attempts to run the app in **release mode** to better mimic what your users can expect in production. In release mode, **warnings are mostly suppressed**, meaning it's important to ensure you are acknowledging and addressing warnings in debug mode before you enter run mode. The "Run mode: Build failed" error can occur under various circumstances, during: - Run mode - APK download - Code download - GitHub push - And more ## Common Scenarios and Solutions - **Custom Code Failures** - **Issue**: Your project's custom code doesn't show errors within the editor, but errors appear when you try to run the app. - **Example**: A custom widget lacks web support. - **Solution**: Verify on pub.dev or equivalent platforms that the custom code supports the necessary platforms (example, web, iOS, Android). - **Best practice**: Consider running the code locally on a sample Flutter project before implementing the custom code inside FlutterFlow Studio to identify possible errors logged. - **Widget Failures** - **Issue**: A widget within your app causes the build to fail due to errors. - **Example**: Actions assigned to a widget are incomplete or improperly configured. - **Solution**: Locate the error-causing widget (usually identified in the error message) To correct the issue: - Ensure the widget tree is correctly formatted - Verify that widgets are named clearly for easy identification - **Build Fails Without Error Messages** - **Issue**: The build process fails without displaying an error message, making it challenging to diagnose the problem. - **Solution**: Download and run the project code locally with a debugger to identify and resolve the issue. If downloading the code is problematic, check your browser's console for errors that might indicate the cause. ![](https://docs.flutterflow.io/assets/images/20250430121148811672-4c769af193fd8c00576f42eb585c2658.png) - **Grey Screen in Run Mode** - **Issue**: Encountering a grey screen in run mode usually indicates an error suppressed by the release mode. - **Solution**: Run the app in test mode to potentially reveal the error for troubleshooting. If test mode does not display errors, use the browser's developer console for clues. ## Checklist for Troubleshooting - **Identify when and where the error occurs**: Determine if the error is specific to run mode, test mode, or other instances like APK download or code download. - **Locate the source of the error**: The error message often provides clues about where the problem lies, whether in custom code, a specific widget, or elsewhere. - **Check for platform support**: For issues related to custom code, ensure compatibility with your target platforms. - **Examine widget configuration**: Verify that all actions and configurations associated with widgets are complete and correct. - **Utilize local debugging**: If the error is elusive, running the debugger locally on your downloaded code can help identify the issue. - **Leverage browser tools**: The browser's console and developer tools can offer insights, especially when dealing with errors that don't manifest in traditional debug outputs. :::note[Additional Resources] [Basic Troubleshooting Guide – FlutterFlow Documentation](https://docs.flutterflow.io/troubleshooting/basic-troubleshooting-guide) ::: # Client Access to Firestore Expired > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/client-access-to-firestore-expired You may receive an email from Firebase with the subject: You may receive an email from Firebase with the subject: **"Client access to your Cloud Firestore database expired"** This message typically appears when your Firestore database is in **Test Mode** and the access duration has expired. You are seeing this error message because of the following: When setting up Firestore for the first time, Firebase offers two rule options: 1. **Test Mode** – Temporarily allows open access (expires after 30 days). 2. **Production Mode** – Starts off restricted and requires secure rules. ![](https://docs.flutterflow.io/assets/images/20250430121224235710-89e69fcdc91e04a8e895f061065d4b91.png) If you selected **Test Mode** during setup, Firestore access will automatically expire after the preset period. To continue using Firestore, you'll need to update the rules using one of the following options: - **Option 1: Manage Firestore Rules From FlutterFlow Studio** You can **[manage and deploy Firestore rules](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules)** directly from FlutterFlow Studio. - **Option 2: Manually Update Firestore Rules in Firebase Console** Follow these steps to manually update the rules: 1. Go to the **[Firebase Console](https://console.firebase.google.com/)**. 2. Open your project and navigate to **Firestore Database**. 3. Select the **Rules** tab. From here, you have two options: - **Option A: Extend Test Mode** Update the expiration timestamp to a future date if you're still in development. ![](https://docs.flutterflow.io/assets/images/20250430121224547832-a2a051061854b7c100d8a54f3f166710.png) - **Option B: Secure Your Rules for Production** Update your rules to enforce proper authentication and access controls. ![](https://docs.flutterflow.io/assets/images/20250430121224874215-be277d57d8c10ead3f30dd39c3cd5b43.png) If the issue persists, contact us at [support@flutterflow.io](mailto:support@flutterflow.io) for further assistance. # Configuring CORS for Firebase Storage > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/configuring-cors-for-firebase-storage When you deploy your web app to a custom domain, the domain and the Firebase Storage bucket are hosted on different servers. This means that the browser will block requests to the Firebase Storage bucket from your web app, because the origins (the domains and ports) of the two servers are different. When you deploy your web app to a custom domain, the domain and the Firebase Storage bucket are hosted on different servers. This means that the browser will block requests to the Firebase Storage bucket from your web app, because the origins (the domains and ports) of the two servers are different. **What is CORS?** CORS stands for **Cross-Origin Resource Sharing**. It allows you to specify which origins are allowed to access your resources. By configuring CORS, you can tell the browser that your web app is allowed to make requests to the Firebase Storage bucket, even though the two servers are hosted on different domains. Follow these steps to configure CORS for your Firebase Storage bucket: 1. Open **[Google Cloud Console](https://console.cloud.google.com)**. 2. **Launch the Cloud Shell**: Click the **Activate Cloud Shell** icon in the top-right corner. ![](https://docs.flutterflow.io/assets/images/20250430121203371000-ae959dd8cb3f0d459ec1a3c85478fac5.png) Wait for the terminal to load. ![](https://docs.flutterflow.io/assets/images/20250430121203911156-0d82267ed36a199657a864eeb231151d.png) ​ 3. **Run the following Command:** ```jsx gcloud config set project your-firebase-project-id; ``` 4. **Define and upload your cors.json file:** The `cors.json` file contains a list of origins that are allowed to access your resources. Each origin is a string that identifies a domain or port. For example, the following origin allows access from the domain `www.example.com`: ```jsx "origins": ["https://www.example.com"] ``` You can also specify a list of allowed headers. The following example allows access to the `Content-Type` and `Authorization` headers: ```jsx "origins": ["https://www.example.com"], "allowedHeaders": ["Content-Type", "Authorization"] ``` To allow any origin to access your resource, you can use `*`. The `cors.json` file below allows any origin to access, but not modify your resources. ```jsx [ { "origin": ["*"], "method": ["GET"], "maxAgeSeconds": 3600 } ] ``` Once you have defined your `cors.json` file, upload it to Google Cloud Console. ![](https://docs.flutterflow.io/assets/images/uploadToGCC-97604280ce723bb14f8c458427ed74c4.png) To confirm that you have uploaded it correctly, you can run `ls` in your console and you should see your `cors.json` file listed. 5. **Run the `cors` Command to Configure CORS:** ```jsx gcloud storage buckets update gs://your-google-storage-bucket-name --cors-file=cors.json ``` 6. **(Optional) Confirm success by viewing the CORS of your bucket** Run the following command to confirm that the rules from your `cors.json` file were applied. ```jsx gcloud storage buckets describe gs://your-google-storage-bucket-name --format="default(cors_config)" ``` You should see the same allowed origins and any other info defined in your `cors.json` file. For more information on configuring CORS in Firebase Storage, please see the **[official documentation](https://firebase.google.com/docs/storage/web/download-files#cors_configuration)**. # Content Manager Firestore Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/content-manager-firestore-error You may see the following error message when accessing the FlutterFlow Studio Content Management System (CMS): You may see the following error message when accessing the **FlutterFlow Studio Content Management System (CMS)**: ![](https://docs.flutterflow.io/assets/images/20250430121517855306-24e97004e33cce6167bdd47037e1263a.png) This error typically occurs when Firebase permissions or authentication settings are not properly configured. Follow the steps below to resolve it. 1. **Enable Email/Password Sign-In** 1. Open the **[Firebase Console](https://console.firebase.google.com/)**. 2. Select your project. 3. From the left-hand menu, click **Authentication**. 4. Click **Get started** (if not already started). 5. Go to the **Sign-in method** tab. 6. Ensure **Email/Password** is listed and marked as **Enabled** ✅. ![](https://docs.flutterflow.io/assets/images/20250430121518159572-c74b9cb5cb2f2eb2ebac07205fcbe1c4.png) :::note If Email/Password is not enabled, turn it on by clicking the pencil icon and toggling the setting. ::: 2. **Add Required Firebase Project Permissions** FlutterFlow Studio requires the following roles to be granted to `firebase@flutterflow.io` for proper functionality: - Editor - Cloud Functions Admin - Service Account Admin To add these permissions: 1. In the **[Firebase Console](https://console.firebase.google.com/)**, open your project. 2. Navigate to **Project Settings** > **Users & Permissions**. 3. Check if `firebase@flutterflow.io` has the roles listed above. :::note If these roles are missing, the integration is incomplete. Make sure to add all three roles. ::: 3. **Update Firestore Rules in FlutterFlow Studio** 1. In your FlutterFlow Studio project, go to **Firestore** > **Settings**. 2. Scroll down to the **Firestore Rules** section. 3. Click **Deploy/Redeploy** to apply your latest rules. 4. **Define Your Firebase Schema** Make sure your Firebase schema is fully defined. The Content Manager only displays fields that are already defined in your Firebase schema. 5. **Ensure You're Using the Latest FlutterFlow Studio Version** Press `Ctrl + R` (on Windows) or `Cmd + R` (on macOS) to refresh and ensure you’re on the latest version of FlutterFlow Studio. 6. **Clear Cache and Re-Login** After completing the above steps: - Clear your browser cache. - Log out and log back into FlutterFlow Studio. :::note[Still not working?] Try reconfiguring permissions from scratch. If none of the steps resolve the issue: 1. Remove existing Firebase permissions. 2. Re-add all necessary roles from scratch. 3. Follow the full setup instructions in the **[official FlutterFlow Studio Firebase integration guide](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase)**. ::: By following the steps above, you should be able to resolve the error and continue using FlutterFlow Studio CMS without interruptions. # Firebase Android Config File Missing > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/firebase-android-config-file-missing You may see the following warning in FlutterFlow Studio, as shown in the image below: You may see the following warning in FlutterFlow Studio, as shown in the image below: ![](https://docs.flutterflow.io/assets/images/20250430121357585709-174b3b73ac2cca43e887898b6590d2d3.png) This typically means that the Firebase Android configuration file (`google-services.json`) has not been generated or uploaded to your FlutterFlow Studio project. Follow the steps below to fix the issue: 1. **Verify your Firebase Setup** Make sure that Firebase has been fully configured for your project. Follow the **[Firebase setup guide](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase)** to ensure all required steps have been completed. 2. **Open Project Settings in FlutterFlow Studio** - Navigate to your FlutterFlow Studio project. - From the left menu, select **Settings > Firebase**. ![](https://docs.flutterflow.io/assets/images/20250430121357870887-9a8bd8979530cdb39ac0650f847d866f.png) 3. **Regenerate your Firebase Configuration Files** - In the Firebase Settings screen, click **Regenerate Firebase Files** to create new configuration files and upload them automatically. 4. **Contact Support if Needed** If you continue to experience issues, reach out to [FlutterFlow Support](mailto:support@flutterflow.io) for further assistance. :::note The configuration file is required for successful builds and deployment on Android. Make sure it remains up-to-date if you make changes in your Firebase project. ::: # Firebase Storage Limits in FlutterFlow Studio > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/firebase-storage-limits-in-flutterflow Managing Firebase Storage properly is essential for controlling your app's file storage and associated costs in FlutterFlow Studio. This article summarizes the current limits and best practices following Firebase’s September 2024 changes. Managing Firebase Storage properly is essential for controlling your app's file storage and associated costs in FlutterFlow Studio. This article summarizes the current limits and best practices following Firebase’s September 2024 changes. ## Firebase Storage Plans and Limits - **Blaze Plan (Pay-as-you-go)** - Firebase Storage (Cloud Storage for Firebase) is only available on the Blaze plan for new Firebase projects. - Storage charges are based on usage volume. - The price per GB/TB decreases as your usage increases. - Refer to the **[Firebase Pricing page](https://firebase.google.com/pricing)** for current rates. - **Spark Plan (Free Tier)** - For projects created after September 2024, Cloud Storage for Firebase is **no longer available** on the Spark plan. - To use file storage (uploads, images, videos, etc.) with Firebase Storage, you must upgrade to the Blaze plan. :::note If your Firebase project was created before the September 2024 policy change, you may still have limited access to Firebase Storage under legacy conditions. However, new projects must follow the updated Blaze-only policy. ::: ## Firebase Storage Operations Limits - Firebase imposes limits on the number of operations (uploads, downloads, deletes) based on your plan. - With Blaze, these limits are generally higher but still subject to quotas depending on your usage volume. - Monitor your app’s usage patterns to avoid unexpected failures or costs. ## Best Practices for Managing Firebase Storage - Regularly delete unused or unnecessary files. - Compress large files (especially images and videos) before uploading. - Actively monitor storage usage in the Firebase Console. - Set up automated cleanup processes for apps with large or growing data volumes. :::tip Proactive storage management helps control costs and maintain app performance. ::: :::note[Additional Resources] - [Firebase Pricing](https://firebase.google.com/pricing) - [Firebase Storage FAQ (September 2024 Changes)](https://firebase.google.com/docs/storage/faqs-storage-changes-announced-sept-2024) - [Firebase Storage Documentation](https://firebase.google.com/docs/storage) - [FlutterFlow Docs: Storage](https://docs.flutterflow.io/integrations/firebase-storage/storage-rules) ::: Always review your Firebase plan details to ensure you're aligned with the most current pricing model and storage policies. # Get the Sum of Firebase Document or API Values > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/get-the-sum-of-firebase-document-or-api-values Sometimes you need to display a total, such as a subtotal or count based on data fetched from Firebase or an API. This guide walks you through the steps to calculate and display that sum in FlutterFlow Studio. Sometimes you need to display a total, such as a subtotal or count based on data fetched from Firebase or an API. This guide walks you through the steps to calculate and display that sum in FlutterFlow Studio. :::note[Prerequisites] - A working Firebase collection or API that returns numeric values. - A FlutterFlow Studio UI component (example, **Text**) where the sum will be displayed. ::: **Steps to Calculate the Sum of Firebase Document or API Values** 1. **Identify where to Display the Total** Decide where in your app the total will appear. For example, insert a **Text** widget that will show the computed sum. ![](https://docs.flutterflow.io/assets/images/20250430121219360101-421db570635b0004a33c0e3c102580ba.png) 2. **Prepare your Data Type** Next, you need to specify what kind of data you're adding up. For example, if you're working with numbers with decimal points, you'll classify your data as double. Make sure to indicate that you're dealing with a list of these values. ![](https://docs.flutterflow.io/assets/images/20250430121219606895-00021a4fa8e3ae17e474ff9060a63370.png) 3. **Retrieve and Map your Data** When fetching data from Firebase or an API, extract the values you want to sum. Use the `map()` function to create a list of those values. ![](https://docs.flutterflow.io/assets/images/20250430121219871237-fcb0c28690750863a8af6ed74f10c3a4.png) 4. **Calculate the Sum** With your list of values ready, store them in a variable (let's call it `var1`). Then, decide on the format you want for your result. Use the `reduce` function to add up all the values in your list, `var1`, to get your total sum. ![](https://docs.flutterflow.io/assets/images/20250430121220084430-5a459b5c85db423fa188d82a944de37f.png) 5. **Checking Your Results** After completing these steps, you should have the total sum displayed where you need it. If it looks right, you've successfully calculated the sum! [](https://docs.flutterflow.io/files/troubleshooting/assets/20250430121220338400.png) :::tip[Trobleshooting] - Use `.isNotEmpty` to prevent errors when the list is empty. - Format the output using `.toStringAsFixed(2)` to show 2 decimal places if needed. - Optional: Store the sum in a global variable for use across multiple pages. ::: # Missing Firebase Storage in FlutterFlow Studio Settings > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/missing-firebase-storage-in-flutterflow-settings When setting up Firebase Storage in your FlutterFlow Studio project, you may notice that the Firebase Storage option is missing from the Firebase Settings tab. When setting up Firebase Storage in your FlutterFlow Studio project, you may notice that the **Firebase Storage** option is missing from the **Firebase Settings** tab. ![](https://docs.flutterflow.io/assets/images/20250430121309740417-bf1c5b27e75fe10c002115df6be9b0b0.png) This usually happens when Firebase Storage has not been enabled for your project in the Firebase Console. Until it’s enabled there, the option won’t appear in FlutterFlow Studio. Follow these steps to enable Firebase Storage and make it available in your FlutterFlow Studio settings: 1. In your FlutterFlow Studio project, click **Firebase** from the left menu, then click **Open Firebase Console**. ![](https://docs.flutterflow.io/assets/images/20250430121310019673-e0ccc993e764abdf269d95415452c112.png) 2. In the Firebase Console, go to the **Build** menu and select **Storage**. ![](https://docs.flutterflow.io/assets/images/20250430121310317285-985cd6624de61ad14b28b6394eb4db6b.png) 3. Click **Get started** and complete the setup process. ![](https://docs.flutterflow.io/assets/images/20250430121310619096-a543a7ff241ac8ddb0501a78ef2ba3b3.png) 4. After successfully creating the storage bucket, return to FlutterFlow Studio. You should now see the **Rules** option under **Firebase Settings**. ![](https://docs.flutterflow.io/assets/images/20250430121310959552-a17de5817984012a100fce3db8ec70bd.png) :::note After setting up Firebase Storage, it may take up to one hour for the changes to appear in FlutterFlow Studio. ::: # Resolving Firestore Index Deployment Issues > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/resolving-firestore-index-deployment-issues If your Firestore indexes are not being deployed as expected, follow these troubleshooting steps to resolve the issue and ensure your app performs correctly. If your Firestore indexes are not being deployed as expected, follow these troubleshooting steps to resolve the issue and ensure your app performs correctly. ![](https://docs.flutterflow.io/assets/images/20250430121118024255-a20f447be6780a9a23eba9e9c53d3240.png) 1. **Enable Email Sign-In** - Open your Firebase project. - Go to **Authentication** > **Sign-in method**. - Enable **Email/Password** sign-in. 2. **Grant Proper Permissions** - In your Firebase project, open **Project Settings** > **Users and permissions**. - Add firebase@flutterflow.io as a member. - Assign the following roles: - **Editor** - **Cloud Functions Admin** - **Service Account User** ![](https://docs.flutterflow.io/assets/images/20250430121118320891-4875e5f70a7f07f81cffd302e3f013bb.png) 3. **Update Firestore Rules** - Update your Firestore rules in both Firebase Console and FlutterFlow Studio. - Ensure they match your app’s data access requirements. - Follow the detailed steps in the **[Firestore Rules documentation](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules)** to correctly configure your rules. ![](https://docs.flutterflow.io/assets/images/20250430121118592064-f6712af4376f88d2e1ef9f00fbd75b82.png) 4. **Verify Index Deployment** - In the Firebase Console, go to **Firestore Database** > **Indexes**. - Check that your indexes have been deployed. :::note Deployment may take a few minutes. Refresh the page if you don’t see updates immediately. ::: :::tip[Additional Tips] - Make sure you completed all the steps above before retrying deployment. - For advanced troubleshooting, check Firebase logs and permissions in Google Cloud Console. ::: Following these steps should help resolve Firestore index deployment issues in FlutterFlow Studio. # Unable to Validate Firestore Schema > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/unable-to-validate-firestore-schema When trying to validate your Firestore Schema, you may encounter the error as seen in the image below: When trying to validate your Firestore Schema, you may encounter the error as seen in the image below: ![](https://docs.flutterflow.io/assets/images/20250430121304770472-d33d51d68090bdbed7a8eb1502d7ef8d.png) **Troubleshooting Steps:** 1. **Verify that you have Created a Firestore database** Ensure that you have already created a Firestore database in your Firebase project. ![](https://docs.flutterflow.io/assets/images/20250430121305056379-894e3e17d43df54fe13ad23cf585188a.png) 2. **Check the Database Mode** A database in Test Mode may not work properly for FlutterFlow Studio integration. :::note After creating the database in Test Mode, there is no direct visual option to switch to Production Mode. You need to update the Firebase security rules manually. However, if you deploy the rules from FlutterFlow Studio, this step is handled automatically. ::: **Steps to Update your Database Rules**: 1. Go to your Firebase project. 2. Select **Cloud Firestore**. 3. Navigate to **Rules**. You will see something like this: ![](https://docs.flutterflow.io/assets/images/20250430121305295728-e7dc52922d82931db1e441a76c95ebb7.png) Update the rules as needed. :::note Ensure that you specify the correct `rules_version` and verify your configuration. ::: ![](https://docs.flutterflow.io/assets/images/20250430121305526883-dbdfc8d387727dfdb162fbcbae39ce53.png) 4. Click **Publish** to apply the changes. 3. Assign the necessary permissions to `firebase@flutterflow.io` You must grant the required cloud permissions to `firebase@flutterflow.io`: - **Editor** - **Cloud Functions Admin** - **Service Account** In the Firebase Console: 1. Open your project. 2. Go to **Project Settings** > **Users & Permissions**. 3. Confirm that the required roles are assigned to `firebase@flutterflow.io`. If you don't see these roles assigned, you need to complete this step: ![](https://docs.flutterflow.io/assets/images/20250430121305771267-b4c1e1d6d592a4e892881d4779c781fc.png) 4. Ensure you have at least one collection created in FlutterFlow Studio In FlutterFlow Studio, select the **Firestore** tab from the left menu. If no collections are listed, create at least one collection. ![](https://docs.flutterflow.io/assets/images/20250430121306066982-32b6ddf68c8679c186f91bb82de66a84.png) 5. **Confirm that your collections have documents** Use FlutterFlow Studio's CMS to verify that your collections contain at least one document: - Select **Manage Content**. - Check each collection to confirm that data exists. If no documents exist, add at least one: ![](https://docs.flutterflow.io/assets/images/20250430121306294908-0e97d67ca6ccfbd57582ecd175bad8f7.png) ![](https://docs.flutterflow.io/assets/images/20250430121306553330-f80c6041d593bc2e43f17bbfd8783d9f.png) 6. **Deploy Firestore rules from FlutterFlow Studio** In your FlutterFlow Studio project: 1. Select **Firestore** > **Settings**. 2. Scroll down to **Firestore Rules**. 3. Select **Deploy** (or **Redeploy** if needed). ![](https://docs.flutterflow.io/assets/images/20250430121306835223-e3de6e45ed89ba05cbd17d52431f83cd.png) # Updating Firestore Security Rules > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/firebase/updating-firestore-security-rules Most backend issues are generated by the misconfiguration of the Firestore Security Rules. These backend issues may include Grey Screen errors, Infinite Loading screen, Firestore record creating error, Data mismatch errors, etc. Most backend issues are generated by the misconfiguration of the Firestore Security Rules. These backend issues may include Grey Screen errors, Infinite Loading screen, Firestore record creating error, Data mismatch errors, etc. To solve these issues, the Firestore rules have to be updated, for which you can follow the given series of steps: - **Update Your Firestore Rules** From within your FlutterFlow Studio project, select **Firestore** > **Settings** > Scroll down to **Firestore Rules** > select **Deploy**/**Redploy**. ![](https://docs.flutterflow.io/assets/images/20250430121518594245-1fa5ba0cf70fb84c236da5b1a6e8d77d.png) - **Update Firestore Indexes** The next step is to see if the Firestore Rules and Indexes are **Out of Date** or **Not Deployed** (as shown in the image below). If yes, click on the blue **Deploy** button to push the latest rules. ![](https://docs.flutterflow.io/assets/images/20250430121508288240-4b57b60ef6edf955155ef962a6136c99.png) After clicking on the **Deploy** button, a confirmation dialog would be shown, highlighting the changes in the rules that are being made from the deployment. This compares the existing rules in Firestore and highlights what changes are being made in the Firestore rules. These changes are required when a new collection is created or is been edited or if the rules are Out of Date. ![](https://docs.flutterflow.io/assets/images/20250430121508604665-43762681cfc53b60ebe21a52469d8b49.png) You can review the changes, and then you can click on the **Deploy Now** button. An orange loading indicator would be shown, which means that the rules are getting deployed (This step usually finishes within less than a minute, and the loading indicator is replaced with a Green Checkbox button). - **Validate the Firestore Schema** After completing the steps above, validate the Firestore schema by clicking on the blue **Validate** button. This ensures that everything is configured correctly and the Firestore collection schema matches with the Collection schema configured in FlutterFlow Studio. ![](https://docs.flutterflow.io/assets/images/20250430121532793176-81306c33ba320ea521aa4a3b4a8d6803.png) # AdMob Ads Not Displaying in Google Play Testing > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/admob-ads-not-displaying-in-google-play-testing If your AdMob ads are not showing during Open Testing via the Google Play Store, the issue is often tied to AdMob configuration, app permissions, or settings in the Google Play Console. Follow the steps below to ensure ads display correctly. If your AdMob ads are not showing during **Open Testing** via the Google Play Store, the issue is often tied to AdMob configuration, app permissions, or settings in the Google Play Console. Follow the steps below to ensure ads display correctly. :::note[Prerequisites] - An active **AdMob** account is set up. - Your FlutterFlow Studio project is linked to **AdMob**. - The app is uploaded to **Google Play Console** under an Open Testing track. ::: - **Use Test Ads During Development** Always use test ads during development to avoid policy violations or ad-serving issues: - Refer to the **[Google AdMob Test Ads](https://developers.google.com/admob/android/test-ads)** guide for appropriate test ad unit IDs. - Live ads should be used only after your app is published to production and approved. - **Verify AdMob Account Setup** 1. Go to the **AdMob Console**. 2. Confirm that your app is registered and linked to your Google Play listing. 3. Ensure the app’s release status in AdMob matches its status in the **Google Play Console**. :::note If your app is listed as `not released` in AdMob, live ads may not load during testing. ::: - **Declare Use of Advertising ID** Apps targeting **Android 13 (API 33)** or above must declare use of the **Advertising ID**: 1. Open the **Google Play Console**. 2. Go to **Policy > App Content**. 3. Select **Advertising ID** and complete the required form. :::caution Failing to declare the Advertising ID may result in ads not showing during testing or after release. ::: - **Confirm Ad Unit Configuration in FlutterFlow Studio** 1. Open your project in **FlutterFlow Studio**. 2. Navigate to **Settings > AdMob Integration**. 3. Confirm that the correct **Ad Unit IDs** are used. 4. Ensure Ad widgets are connected to the appropriate ad units. - **Test in the Correct Environment** - Use a physical device instead of an emulator when possible. - Ensure the device has a strong internet connection. - Avoid using VPNs or battery optimization tools that may interfere with ad delivery. - **Add app-ads.txt (Optional)** Setting up an `app-ads.txt` file is optional but recommended for better ad quality: - Follow the **[official guide](https://support.google.com/admob/answer/9363762?hl=en&ref_topic=9675856&sjid=8136071085841576181-EU)** to set it up. - **Wait for Ad Approval** Even after the app is released: - Live ads may take several days to appear due to the review process and inventory matching. - This delay is expected. If ads still aren’t appearing, contact FlutterFlow Support at [support@flutterflow.io](mailto:support@flutterflow.io) # Declare Advertising ID for Android 13+ in Play Console > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/declare-advertising-id-android-13-play-console If your app targets Android 13 (API 33) or higher, Google Play requires that you declare whether your app uses the Advertising ID. Failing to do so will result in an upload error when submitting artifacts to the Play Console. If your app targets Android 13 (API 33) or higher, Google Play requires that you declare whether your app uses the **Advertising ID**. Failing to do so will result in an upload error when submitting artifacts to the Play Console. :::note[Prerequisites] - Your app targets Android 13 (API 33) or above. - The app is being submitted via the **Google Play Console**. ::: When uploading your app to Google Play, you may encounter this error: ```js { "error": { "code": 400, "message": "Your app targets Android 13 (API 33) or above. You must declare the use of advertising ID in Play Console.", "status": "INVALID_ARGUMENT" } } ``` This error occurs when the required declaration for the Advertising ID is missing, incomplete, or inconsistent with your app configuration. Google Play now requires developers targeting Android 13 (API 33) or above to explicitly declare if their app uses the **Advertising ID**. You may see this error if: - You didn't complete the advertising ID declaration in the Play Console. - Your app configuration suggests ad usage but you have not declared it. - Your declaration is incomplete or missing required details. Follow the steps below to fix this error: 1. **Open App Content Section in Play Console:** - Log into your **Google Play Console**. - Navigate to your app's **App Content** section. ![](https://docs.flutterflow.io/assets/images/20250430121230522324-4cc8e39aca512a60d499496ffd4f5c83.png) 2. **Declare Advertising ID Usage** - If your app **does not contain ads**, select **No** under the "Advertising ID" section. ![](https://docs.flutterflow.io/assets/images/20250430121230823138-2950ce06ec96a32cb831f17acdf336b1.png) - If your app **contains ads**, select **Yes** and provide the necessary details about how ads are used. This Declaration is important because Google Play uses this information to: - Inform users about your app’s data collection practices. - Ensure compliance with privacy policies. - Prevent build upload failures. If the issue persists after following these steps, please contact FlutterFlow Support via Chat or email at [support@flutterflow.io](mailto:support@flutterflow.io). # Error Running Pod Install > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/error-running-pod-install This article addresses the common Error Running Pod Install issue, which typically occurs due to misconfiguration of Flutter or CocoaPods on macOS devices. This article addresses the common **Error Running Pod Install** issue, which typically occurs due to misconfiguration of Flutter or CocoaPods on macOS devices. :::note[Prerequisites] - Flutter is installed on your development machine. - You are working on a macOS device. - Basic familiarity with terminal commands. ::: ## Steps to Fix Error Running Pod Install: 1. Verify Flutter is set up correctly by following the official guide: **[Flutter - Get Started: Install on macOS](https://docs.flutter.dev/get-started/install/macos)**. 2. For troubleshooting specific to macOS, consult this guide: **[Troubleshooting Flutter on macOS](https://docs.flutter.dev/get-started/install/macos/mobile-ios#install-cocoapods)**. 3. Run `flutter doctor` in the terminal to check for missing dependencies or configuration issues. 4. Ensure CocoaPods is installed and up to date by running the following commands: ```bash sudo gem install cocoapods pod repo update 5. If the problem persists, try deleting the CocoaPods cache and reinstalling: ```bash flutter clean ``` ```bash flutter pub get ``` ```bash cd ios ``` ```bash pod install ``` Deleting the `ios/Pods` directory and `ios/Podfile.lock` file before running `pod install` can help resolve lingering CocoaPods issues. # Fix Flutter Launcher Icons Package Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/fix-launcher-icons-package-error This article describes how to resolve the flutter_launcher_icons package error that may occur during app build or deployment. This article describes how to resolve the **[flutter_launcher_icons package](https://pub.dev/packages/flutter_launcher_icons)** error that may occur during app build or deployment. :::note[Prerequisites] - Access to your FlutterFlow Studio project. - Ability to open and edit the `pubspec.yaml` file. - Familiarity with your build environment (FlutterFlow Studio, GitHub, or IDE). ::: **Understanding the Error:** During the build process, you might see the following error message: ```text Codemagic Deploy Output Failed Step: Generate Launch Icon Could not find package "flutter_launcher_icons". Did you forget to add a dependency? pub finished with exit code 65. Build failed: Step 5 script 'Generate Launch Icon' exited with status code 65. ``` This error indicates that the **flutter_launcher_icons** package is missing or not configured correctly. Follow the steps below to fix the error: 1. **Clear and Reset App Assets in FlutterFlow Studio:** - Navigate to **Settings and Integrations** > **App Assets** inside FlutterFlow Studio. - If the **Splash Screen** and **Launcher Icon** are set: - Clear both assets. - Re-upload the launcher icons. ![](https://docs.flutterflow.io/assets/images/20250430121327988277-fb0bf90a2c5c2fb0d4b1dddccbfe14ad.gif) 2. **`Add flutter_launcher_icons` Package in GitHub Deployment** If you are deploying via GitHub and encounter this error, add the package to your `pubspec.yaml` file: - Open your `pubspec.yaml` file. - Add the following under `dev_dependencies`: ```js dev_dependencies: flutter_launcher_icons: "^0.10.0" flutter_icons: android: true ios: true image_path_ios: "assets/images/launcher/ios.png" image_path_android: "assets/images/launcher/android.png" ``` - **flutter_launcher_icons*: "^0.10.0" specifies the package version. - `image_path_ios` and `image_path_android` specify the paths to your launcher icon images. - Ensure the image files exist at the specified paths. 3. **Run the following commands in your terminal or IDE:** ```bash flutter pub get ``` ```bash flutter pub run flutter_launcher_icons:main ``` ```bash flutter run ``` `flutter pub get` fetches packages. `flutter pub run flutter_launcher_icons:main` generates launcher icons. `flutter run` builds and runs the app. If the issue persists after following these steps, contact FlutterFlow Support at support@flutterflow.io. # Google Play Draft Release Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/google-play-draft-release-error When uploading an app to Google Play, you may encounter the following error: When uploading an app to Google Play, you may encounter the following error: ```js { "error": { "code": 400, "message": "Only releases with status draft may be created on draft app.", "status": "INVALID_ARGUMENT" } } ``` This error occurs because Google Play only allows creating a Draft Release if your app is still marked as a draft in the Google Play Console. Typically, this means some required app information in the Play Console has not been completed, preventing full release submission. :::note[Prerequisites] - Your app is registered in the Google Play Console. - Basic app details such as store listing and setup information are ready to be filled. ::: This error indicates that Google Play only allows you to create a **Draft Release** when your app is still marked as a draft in your Google Play Console. You likely have missing or incomplete app information in Google Play preventing full release submission. Follow these steps to fix the issue: 1. Complete All Required Information in Google Play Console - Log in to your **Google Play Console**. - Complete all mandatory sections under: - **App Content** - **Store Listing** - **Pricing & Distribution** - **Target Audience & Content Rating** Google Play requires all required information to be filled out before allowing full production releases. 2. **Enable "Submit As Draft" in FlutterFlow Studio** After completing your app information, proceed as follows: - **Open Settings and Integrations**: From your FlutterFlow Studio project dashboard, navigate to **Settings > Integrations**. ![](https://docs.flutterflow.io/assets/images/20250430121320431269-11151722194c41cf6f4b090e04863662.png) - **Navigate to Mobile Deployment**: Select **Mobile Deployment**. ![](https://docs.flutterflow.io/assets/images/20250430121320759595-d43561d2552198d967e63415a52a152c.png) - **Enable Submit As Draft**: Under **Google Play Store Deployment**, toggle on **Submit as Draft**. ![](https://docs.flutterflow.io/assets/images/20250430121321051936-e566e7f0a931aff1babd68a214530c68.png) This allows you to submit your release as a draft until all Google Play requirements are fully satisfied. If you’ve followed all steps and still encounter the issue, contact **FlutterFlow Support** via Chat or email at [support@flutterflow.io](mailto:support@flutterflow.io) for additional assistance. # Google Play Failed to Upload Artefacts > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/google-play-failed-to-upload-artefacts-package - Ensure your app’s Package Name in FlutterFlow Studio matches the package name in Google Play Console. :::note[Prerequisites] - Ensure your app’s `Package Name` in FlutterFlow Studio matches the package name in Google Play Console. - Firebase is configured in your project settings. - Your Google Play Console account is active and accessible. ::: When uploading your app to Google Play, you may encounter the following error: ```js Google Play failed to upload artefacts. Package not found: com.flutterflow.appname.: { "error": { "code": 404, "message": "Package not found: com.flutterflow.appname.", "status": "NOT_FOUND" } } ``` This error usually occurs in two scenarios: - Deploying the app to Google Play for the first time. - Changing the app’s `Package Name` in FlutterFlow Studio without regenerating the Firebase configuration files. **First Time Deployment to Google Play** Follow these steps to upload your app for the first time: 1. Generate your build in FlutterFlow Studio and click the `AAB` button to download the build artifact. 2. Log in to your **[Google Play Console](https://play.google.com/console)**. 3. Navigate to your app project and upload the **AAB** file as a new release in the appropriate track (Internal, Closed, Open, or Production). 4. After this initial upload, future deployments should proceed without this error. ![](https://docs.flutterflow.io/assets/images/20250430121330484821-3b5795c533eecbd6fce52a72506ed56e.png) **Updating Package Name and Regenerating Config Files** If you have updated your app’s `Package Name` in FlutterFlow Studio, follow these steps: 1. Open your project in FlutterFlow Studio. 2. Navigate to **Settings** > **Firebase**. 3. Click **Regenerate Config Files**. ![](https://docs.flutterflow.io/assets/images/20250430121330727549-7e216628b1bef45cd6867c86b6fd659e.png) 4. Enter the new `Package Name` and click Generate File to download the updated configuration files. ![](https://docs.flutterflow.io/assets/images/20250430121443525154-992a83c99d1aaac98c6db7838fa1782e.png) 5. Rebuild and redeploy your app to confirm the error is resolved. If the error persists after completing these steps: - Verify the `Package Name` matches exactly between FlutterFlow Studio and Google Play Console. - Confirm that Firebase configuration files have been updated correctly. - Contact FlutterFlow Support via Chat or email at support@flutterflow.io. # Google Play Store Debug Signing Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/google-play-store-debug-signing-error When uploading your Android App Bundle (AAB) or APK to Google Play, you might encounter this error: When uploading your Android App Bundle (AAB) or APK to Google Play, you might encounter this error: ```text You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode ``` This error indicates the app must be signed with a release key before uploading. :::note[Prerequisites] - Access to the Android project files. - Familiarity with editing Gradle build files. ::: **Steps to Fix Debug Signing Error:** 1. Open the `android/app/build.gradle` file in your project folder. 2. Locate the `buildTypes` section and find the configuration labeled `debug`. 3. Replace the `debug` keyword with `release` in the relevant signing configuration. 4. Save the file. :::note Make sure that you fill out all the information in the play store including the store listing information and the setup information. ::: ​ # Launcher Icon Missing After Upload > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/launcher-icon-missing-after-upload Custom app launcher icons may fail to appear after being added in the project settings due to missing icon generation steps. Custom app launcher icons may fail to appear after being added in the project settings due to missing icon generation steps. :::note[Prerequisites] - Flutter is installed on your development machine. - The project code has been downloaded or exported. - Basic familiarity with running terminal commands. ::: **Steps to Resolve Missing Launcher Icon:** 1. Run the launcher icon generation command in the terminal at your project root: ```js flutter pub run flutter_launcher_icons:main ``` This generates the necessary launcher icon assets for your app. 2. Ensure your Flutter environment is properly set up. If needed, follow the official **[Flutter installation guide](https://docs.flutter.dev/get-started/install)**. - Verify your icon files are named correctly and placed in the appropriate directory. - Check that your `pubspec.yaml` includes the correct `flutter_launcher_icons` configuration. - Run `flutter clean` in your project directory before rerunning the icon generation command to clear caches. # Migrate to Play Integrity API From SafetyNet Attestation > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/migrate-to-play-integrity-api-from-safetynet-attestation Google is deprecating the SafetyNet Attestation API, replacing it with the Play Integrity API. This article explains the migration steps needed to maintain app security and compliance with Google Play requirements. Google is deprecating the **SafetyNet Attestation API**, replacing it with the **Play Integrity API**. This article explains the migration steps needed to maintain app security and compliance with Google Play requirements. :::note[Prerequisites] - The **SafetyNet Attestation API** is currently used in your Android app. - Preparation for app deployment or maintenance on Google Play is underway. ::: **Migration Steps:** 1. **Begin the Migration Process** Visit the official migration guide: **[SafetyNet Deprecation & Play Integrity Migration Guide](https://developer.android.com/google/play/integrity/migrate)** 2. **Update Your Backend Implementation** - Replace calls to the **SafetyNet Attestation API** with the **Play Integrity API** in your app code. - Modify your backend to validate responses from the Play Integrity API. 3. **Test Your Migration Thoroughly** Verify that the Play Integrity API integration works correctly on multiple devices before publishing updates. :::tip Migrating is critical to: - Comply with the latest security standards. - Maintain access to Google's integrity services. - Benefit from improved error handling and security signals. Failure to migrate may cause degraded app functionality and user experience. ::: If issues arise during migration, contact FlutterFlow Support at [support@flutterflow.io](mailto:support@flutterflow.io). # Signed in Debug Mode Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/signed-in-debug-mode-error - Generated an APK or Android App Bundle via FlutterFlow Studio → Build → Android. :::note[Prerequisites] - Generated an APK or Android App Bundle via **FlutterFlow Studio → Build → Android**. - Access to the exported project folder. - Ability to edit the `android/app/build.gradle` file. ::: When uploading an Android APK or App Bundle to the Play Store or a production environment, the following error may occur: ```console You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode ``` This error indicates that the build was signed with a debug configuration, which is only for internal testing and not valid for production release. To fix this, update the `build.gradle` file to use the release signing configuration. **Steps to Update Build Configuration:** 1. Open the `android/app/build.gradle` file in your project folder. 2. Locate the `debug` keyword under `buildTypes`. 3. Replace the `debug` keyword with `release` and save the file. If the issue persists, contact FlutterFlow Support at support@flutterflow.io. # Version Solving Failed Due to Incompatible Package > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/google-play-store-deployment/version-solving-failed-due-to-incompatible-package A version solving failed error may occur when running flutter pub get if package versions in the project conflict with FlutterFlow Studio's supported Flutter version. A **version solving failed** error may occur when running `flutter pub get` if package versions in the project conflict with FlutterFlow Studio's supported Flutter version. ```js Running "flutter pub get" in flutter_tools... 3.4s Resolving dependencies... Because every version of flutter_test from sdk depends on collection 1.15.0 and horse_care_new depends on collection 1.16.0, flutter_test from sdk is forbidden. So, because horse_care_new depends on flutter_test from sdk, version solving failed. pub finished with exit code 1 ``` :::note[Prerequisites] - Custom actions or widgets are used in the project. - Access to the project's `pubspec.yaml` file. ::: **Steps to Resolve the Error:** - Verify that all packages used in custom actions or widgets are compatible with FlutterFlow Studio's Flutter version. - Before adding a new dependency in your custom widget or action, check if the package already exists in `pubspec.yaml`. If it does, only import the package in your code without adding it again as a dependency. - If no custom widgets or actions are used and the error persists, contact FlutterFlow Support at support@flutterflow.io for assistance. # FCM Token Generation Troubleshooting > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/notifications/fcm-token-generation-troubleshooting When a user does not have an fcmtoken sub-collection in their Firestore document, push notifications cannot be delivered to their device. This guide outlines the possible causes and solutions for resolving missing fcmtoken sub-collections in FlutterFlow Studio apps. When a user does not have an `fcm_token` sub-collection in their Firestore document, push notifications cannot be delivered to their device. This guide outlines the possible causes and solutions for resolving missing `fcm_token` sub-collections in FlutterFlow Studio apps. **Understanding the Issue** Push notifications require a valid Firebase Cloud Messaging (FCM) token, which is generated when a user logs in or signs up on a physical device. This token is typically stored in the `fcm_token` sub-collection of the user document in Firestore. If this sub-collection is missing, the device cannot receive push notifications. Possible causes for missing tokens include: - Failures during FCM token generation. - Incomplete authentication flows. - Permission issues preventing token creation. - Invalid input data passed to Cloud Functions. Here are the steps to verify user eligibility for push notifications: 1. Check Firestore for `fcm_token` Sub-Collection 1. Open the **Firebase Console**. 2. Navigate to **Firestore Database**. 3. Locate the user document. 4. Verify that the `fcm_token` sub-collection exists. If present, the user is eligible to receive push notifications. ![](https://docs.flutterflow.io/assets/images/20250430121302960895-54aed4f3798bc79637d975fd9c18488a.png) ### Troubleshooting Missing FCM Token Generation 1. **Verify Cloud Function Execution** The `addFcmToken` Cloud Function is responsible for generating and storing FCM tokens. If token generation fails, review its logs: 1. Open the **Firebase Console**. 2. Navigate to **Functions**. 3. Locate the `addFcmToken` function. 4. Open its **Logs** to review errors or warnings. ![](https://docs.flutterflow.io/assets/images/20250430121303270464-01b82a1aec0dec61adb6565fa42ee0ee.png) 2. **Resolve Permission Errors** Proper permissions are required to allow the Cloud Function to write FCM tokens to Firestore. **Verify Firebase Security Rules** - Ensure your Firebase security rules permit writing to the `users` collection and its sub-collections. **Verify FlutterFlow Studio Service Account Permissions** The `firebase@flutterflow.io` service account must have the following roles: - `Editor` - `Cloud Functions Admin` - `Service Account User` **How to Assign Roles**: 1. Open the **Firebase Console**. 2. Go to **Project Settings > Users & Permissions**. 3. Locate the `firebase@flutterflow.io` service account. 4. Assign any missing roles. Refer to **[this guide](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#connect-an-existing-firebase-project-manually)** for full instructions. 3. **Validate Input Data Passed to Cloud Function** If a Cloud Function fails with status code `400`, it may be receiving invalid input data. - Verify that your authentication flow correctly retrieves the user ID before calling the function. - Ensure the user ID is not `null`, empty, or malformed. - Implement conditional validation before invoking the function. - Add logging to your authentication code and Cloud Functions to trace failures. This is especially important if you are using custom authentication logic. If you are using FlutterFlow Studio's built-in authentication, this issue is unlikely. 4. **Check for FCM Server Errors** Additional reasons FCM token generation may fail include: - FCM server downtime or temporary outages. - Incorrect or malformed requests sent from the Cloud Function to the FCM server. - Insufficient API access permissions. - Invalid or missing input data (e.g. device token). If server issues persist, consider contacting Firebase support for assistance. By following this complete troubleshooting process, you can ensure your users successfully receive push notifications. --- # Firebase Push Notification Troubleshooting > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/notifications/firebase-push-notification-troubleshooting Push notifications are essential for keeping users informed through timely alerts and updates. However, several common configuration issues can prevent push notifications from working as expected in FlutterFlow Studio projects. This guide outlines potential causes and solutions. Push notifications are essential for keeping users informed through timely alerts and updates. However, several common configuration issues can prevent push notifications from working as expected in FlutterFlow Studio projects. This guide outlines potential causes and solutions. :::note[Prerequisites] Before troubleshooting, ensure the following: - The FlutterFlow Studio app is connected to Firebase. - The app is installed on a physical device (push notifications do not work on simulators). - The user is logged in to the app. - The app is not currently open when testing notifications. ::: 1. **Verify Firebase Blaze Plan Subscription** - Navigate to **Firebase Console > Project Settings > Usage & Billing > Details & Settings**. - Confirm that the subscription is on the **Blaze Plan**. - If the current plan is **Spark**, upgrade by selecting **Modify Plan**. ![](https://docs.flutterflow.io/assets/images/20250430121514497717-35f747df9e6f0c6dc8a48f2d4df1db3e.png) 2. Verify Apple Push Notification (APN) Key Configuration - **Create an APN Key:** - Navigate to the Apple Developer Console. - Go to **Certificates, Identifiers & Profiles > Keys**. - Create a new key for push notifications if one does not exist. ![](https://docs.flutterflow.io/assets/images/20250430121514756330-9d82a66a1e7e3b46bdd41497816f5079.png) Instructions for **[adding a push notification key](https://developer.apple.com/account/resources/authkeys/list)** - **Upload the APN Key to Firebase** - Navigate to **Firebase Console > Project Settings > Cloud Messaging > iOS section**. - Upload the APNs Authentication Key. ![](https://docs.flutterflow.io/assets/images/20250430121515088626-084ba92102053aa15ae7a97621159519.png) Instructions for **[uploading APN key to Firebase](https://firebase.google.com/docs/cloud-messaging/ios/certs)**. 3. **Create Push Notification Identifier for Apple** - Go to the Apple Developer Console. - Navigate to **Certificates, Identifiers & Profiles > Identifiers**. - Create or verify an identifier for push notifications. ![](https://docs.flutterflow.io/assets/images/20250430121515418578-7f61320f7d4fe81294cf8228e2df56fd.png) Instructions for **[creating a push notification identifier](https://developer.apple.com/account/resources/identifiers/list)**. 4. **Verify Cloud Permissions for FlutterFlow Studio Service Account** - Go to **Firebase Console > Project Settings > Users & Permissions**. - Locate the **firebase@flutterflow.io** service account. - Ensure the following roles are assigned: - Editor - Cloud Functions Admin - Service Account User ![](https://docs.flutterflow.io/assets/images/20250430121518370897-f0e035f033238446b162c7eacbb6af13.png) Instructions to **[add required cloud permissions](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#allow-flutterflow-studio-to-access-your-project)**. 5. **Confirm Cloud Function Region Consistency** - In **FlutterFlow Studio > Settings > Firebase > Advanced Settings**, verify the Cloud Functions Region matches the region configured in **Firebase > Project Settings > Cloud Functions Location**. ![](https://docs.flutterflow.io/assets/images/20250430121515990341-cb8dfe481eb7782d65eedc674d617f20.png) ![](https://docs.flutterflow.io/assets/images/20250430121516228961-e32ba97b88a386f77aa588720976f146.png) 6. **Update FlutterFlow Studio to Latest Version** **Refresh FlutterFlow Studio:** - On Windows: Press `Ctrl + R`. - On Mac: Press `Cmd + R`. **Clear Browser Cache:** Clear the browser cache to ensure the latest version loads properly. 7. **Resolve FlutterFlow Studio Insufficient Permissions Error** If an insufficient permissions error occurs: 1. Open **Firebase Console > Project Settings > Users & Permissions**. 2. Verify the **firebase@flutterflow.io** account exists. 3. Assign the following permissions: - Editor - Cloud Functions Admin - Service Account User 4. Save changes and retry the operation in FlutterFlow Studio. # Firebase Push Notifications on Web > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/notifications/firebase-push-notifications-on-web FlutterFlow Studio currently does not support sending Firebase push notifications on web apps natively. However, Firebase itself supports this capability. This guide outlines alternative approaches to enable Firebase push notifications on web projects built with FlutterFlow Studio. FlutterFlow Studio currently does not support sending Firebase push notifications on web apps natively. However, Firebase itself supports this capability. This guide outlines alternative approaches to enable Firebase push notifications on web projects built with FlutterFlow Studio. ## Workarounds for Implementing Web Push Notifications There are two primary methods to implement Firebase web push notifications in FlutterFlow Studio projects: - **Use Custom Actions:** - Create custom actions in FlutterFlow Studio that utilize Firebase Cloud Messaging (FCM) to send push notifications. - This method requires writing custom code to handle notification logic and integrate it into FlutterFlow Studio. - Custom actions offer flexibility for handling different types of notifications based on the app’s needs. - The Firebase Web SDK can be used alongside your FlutterFlow Studio project to achieve this. Refer to official Firebase documentation for detailed steps on **[setting up web push notifications](https://firebase.google.com/docs/cloud-messaging/js/client)**. - **Use Back-End Functions:** - Implement server-side code using Firebase Functions or any other backend service. - Backend functions handle sending notifications independently of the FlutterFlow Studio frontend. - This approach allows using the Firebase Admin SDK to programmatically send push notifications to targeted web clients. - Backend solutions also offer better scalability, error handling, and control over notification delivery. :::note - Web push notification support requires properly configured Firebase Cloud Messaging, service workers, and valid VAPID keys. - FlutterFlow Studio may add native support for web push notifications in future updates as the platform evolves. ::: # Fix Push Notifications Sent to Zero Devices > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/notifications/fix-push-notifications-sent-to-zero-devices Push notifications allow apps to send updates, alerts, and messages directly to users. In some cases, after triggering a push notification, FlutterFlow Studio displays the following message: Push notifications allow apps to send updates, alerts, and messages directly to users. In some cases, after triggering a push notification, FlutterFlow Studio displays the following message: ```js Push Notification sent to 0 devices ``` This means that the notification was attempted, but no eligible devices received it. Here are the causes: - No registered devices have generated FCM tokens. - Target devices were offline at the time of sending. - Misconfiguration in Firebase or FlutterFlow Studio settings. - Missing permissions or API configuration. - Recipient devices have blocked push notifications. The following steps below outline how to troubleshoot and resolve this issue: 1. **Verify Firebase Functions Are Enabled** - Ensure that Firebase Functions are enabled in the Firebase Console. - Confirm that your project is on the Blaze Plan. ![](https://docs.flutterflow.io/assets/images/20250430121213011292-1babf61949379581747118828e03c164.png) 2. **Delete and Redeploy Firebase Cloud Functions** - Manually delete the Cloud Functions related to push notifications from Firebase. ![](https://docs.flutterflow.io/assets/images/20250430121213284704-3afcc81ff3752e6b58e4d2e156ee73c5.png) - After deletion, redeploy Push Notifications from FlutterFlow Studio: ![](https://docs.flutterflow.io/assets/images/20250430121213612267-3689521eba4ddac2ee7b5144c76dfcf6.png) 3. **Verify Server Region Configuration** - Ensure that the Firebase server region matches the configuration in FlutterFlow Studio. - For example, if the server region is `us-central1`, it must match in both Firebase and FlutterFlow Studio. In FlutterFlow Studio: Navigate to **Settings > Firebase > Advanced Settings** and set the correct region. ![](https://docs.flutterflow.io/assets/images/20250430121214190877-0f8fa7167e3863fd0e98d1b7932ee2ac.png) In Firebase: Verify that Cloud Functions are deployed to the same region. ![](https://docs.flutterflow.io/assets/images/20250430121214486513-73b41f5de85f618a905f3d41ab672a67.png) 4. **Check FCM API Settings in Google Cloud Console** - Open the **[Google Cloud Console](https://console.cloud.google.com/)**. - Search for `FCM API` and ensure it is enabled. ![](https://docs.flutterflow.io/assets/images/20250430121214790195-9418483016c92cf5d1f7acfaa3b1b71c.png) - Make sure that a valid server key is available in Firebase Console. If missing, create one through Google Cloud Console. 5. **Verify Cloud Permissions for flutterflow.io Service Account** To ensure proper communication between FlutterFlow Studio and Firebase: - Step 1: Open Firebase Console - Go to [Firebase Console](https://console.firebase.google.com/). - Select your project. - Step 2: Navigate to Users & Permissions - Open **Project Settings** via the gear icon (⚙️). - Select **Users & Permissions**. ![](https://docs.flutterflow.io/assets/images/20250430121228826304-9171280a069d17c7274a0b43294ac183.png) - Step 3: Verify Existing Permissions - Locate the `firebase@flutterflow.io` service account. - Verify the following roles are assigned: - `Editor` - `Cloud Functions Admin` - `Service Account User` ![](https://docs.flutterflow.io/assets/images/20250430121516955662-6322dcfe8d6656e3d837fdc3e1bd3928.png) - Step 4: Add Missing Permissions - If any roles are missing: - Click **Add Member**. - Enter `firebase@flutterflow.io`. - Select missing roles from the dropdown: - `Editor` - `Cloud Functions Admin` - `Service Account User` ![](https://docs.flutterflow.io/assets/images/20250430121517242675-be5188a887ac9adbfdd77e1f2148702a.png) - Step 5: Verify All Permissions Are Applied - Confirm that all required roles now appear next to the service account. Following these steps should resolve most push notification delivery issues. # Fix Insufficient Permissions for Push Notifications > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/notifications/fix-insufficient-permissions-push-notifications If you encounter an "Insufficient Permissions" error when deploying push notifications from FlutterFlow Studio to Firebase, it usually means the firebase@flutterflow.io service account does not have the necessary permissions in your Firebase project. This guide will walk you through how to resolve this issue. If you encounter an **"Insufficient Permissions"** error when deploying push notifications from FlutterFlow Studio to Firebase, it usually means the `firebase@flutterflow.io` service account does not have the necessary permissions in your Firebase project. This guide will walk you through how to resolve this issue. :::note[Prerequisites] Before proceeding, ensure you have: - Connected your Firebase project to FlutterFlow Studio. - Completed the steps in **[Connect to Firebase](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#allow-flutterflow-studio-to-access-your-project)**. ::: **Steps to Resolve the Insufficient Permissions Error:** 1. **Open Firebase Console** - Go to the **[Firebase Console](https://console.firebase.google.com/)**. - Click on your project tile to open your FlutterFlow Studio project. 2. **Navigate to Users & Permissions:** - In the Firebase project dashboard, click on the gear icon (⚙️) to open **Project Settings**. - From the left sidebar, select **Users & Permissions**. 3. **Locate the `firebase@flutterflow.io` Account** - In the **Users** tab, search for `firebase@flutterflow.io`. - If this account is missing, click **Add User**, enter `firebase@flutterflow.io` as the email address, and continue. 4. **Assign the Required Permissions** - Click on `firebase@flutterflow.io` to open the user details. - Ensure the following roles are assigned: - **Editor** - **Cloud Functions Admin** - **Service Account User** - If any permissions are missing, click **Add Permissions** and select the missing roles. 5. **Save Changes:** - After assigning all necessary roles, click **Save** to apply changes. - Verify that all permissions have been successfully added and saved. 6. **Retry the Operation in FlutterFlow Studio:** - Return to your FlutterFlow Studio project. - Retry the action that previously failed due to insufficient permissions. The error should now be resolved. If you continue to experience issues, please contact the FlutterFlow Support team. :::note Granting the correct permissions to `firebase@flutterflow.io` is essential for FlutterFlow Studio to deploy push notifications and access Firebase resources correctly. ::: :::note[Additional Resources] - [Connect FlutterFlow Studio to Firebase](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#allow-flutterflow-studio-to-access-your-project) - [Firebase Roles and Permissions](https://firebase.google.com/docs/projects/iam/roles) ::: # Black Screen During Preview > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/test-mode/black-screen-during-run-mode If your app screen appears blank during Run Mode, follow these steps to resolve the issue: If your app screen appears blank during Run Mode, follow these steps to resolve the issue: :::note[Prerequisites] - You have already built and deployed at least one screen in your project. - You are running the app in **Run Mode** within the editor. ::: 1. **Reload the Frame** Right-click on the preview screen and select **Reload Frame**. 2. **Change the Device** Use the device selector on the left panel to switch to a different preview device. 3. **Refresh the Page** Press `Ctrl + R` (Windows) or `Cmd + R` (Mac) to refresh the browser. 4. **Update FlutterFlow Studio and Clear Cache** - Ensure you are using the latest version. - Clear your browser cache. - Log out and back in to your FlutterFlow Studio account. 5. **Submit a Bug Report** If none of the steps work, submit a bug report using the **Send Feedback** button in FlutterFlow Studio. ![](https://docs.flutterflow.io/assets/images/20250430121528287666-5ce70b2435c1ba565426093b5f908131.png) :::tip Blank screens are often temporary. Try switching devices or reloading before making major changes to your project. ::: # Firestore Permission Error in Run Mode > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/test-mode/firestore-permission-error-run-mode When previewing your app in Run Mode, you may encounter the following error message: When previewing your app in Run Mode, you may encounter the following error message: **Firestore Security Rules: Missing or insufficient permissions** This occurs when your Firestore rules conflict with the permissions required for a query in your app. :::note[Prerequisites] - You are using Firebase Firestore in your FlutterFlow Studio project. - Your project has one or more Firestore queries configured. ::: This error is typically triggered when: - Firestore rules prevent any user from reading the database. - A page attempts to run a query before a user is authenticated (e.g., querying user-specific data on the login page). Example: - If Firestore rules are configured as: ```js rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } } ``` Any Firestore query will fail because no read or write access is allowed. - If rules allow only authenticated access: ```js allow read, write: if request.auth != null; ``` And a query is placed on a page before the user signs in (e.g., on the login screen), it will trigger this error. Descriptive widget names can help you quickly identify which query or widget is triggering the permission issue. In the example above, the error message references a widget named Container. Renaming it to something like UserQueryContainer can make debugging easier. Take the steps below to fix this error: - **Review Firestore Rules** Go to Firestore → Settings → Rules and verify that your access rules align with how and when your app queries the database. - **Adjust Query Placement** Ensure that queries requiring authentication are not used on screens accessible to unauthenticated users. - **Use Conditional Visibility** If a query must exist on a pre-login screen, wrap it in conditional logic to only execute when the user is signed in. :::tip Test queries using the Run Mode Console and check the browser logs for more specific errors. Use Firestore Schema Validation in FlutterFlow Studio to ensure your rules are properly deployed. ::: # Gray Screen in Run Mode > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/test-mode/gray-screen-run-mode Seeing a gray screen in Run Mode usually points to a configuration issue in your Firebase or project settings. Follow these steps to diagnose and resolve the issue. Seeing a gray screen in Run Mode usually points to a configuration issue in your Firebase or project settings. Follow these steps to diagnose and resolve the issue. :::note[Prerequisites] - You have integrated Firebase with your FlutterFlow Studio project. - You have access to your Firebase Console. ::: 1. **Check Firebase Permissions** Ensure that firebase@flutterflow.io has the following roles: - **Editor** - **Cloud Functions Admin** - **Service Account User** To verify: 1. Go to the **Firebase Console**. 2. Select your project → **Project Overview**. 3. Navigate to **Users and permissions** → **Advanced permissions**. 4. Locate firebase@flutterflow.io and ensure it has the roles listed above. ![](https://docs.flutterflow.io/assets/images/20250430121529462395-fdde1719fe77b55aa50ec3df4e3744b0.png) If missing, click the pencil icon and assign the roles. 2. **Regenerate Firebase Configuration Files** 1. In FlutterFlow Studio, go to **Settings & Integrations** → **Firebase**. 2. Click **Regenerate Config Files**. 3. In the popup, click **Generate Files**. ![](https://docs.flutterflow.io/assets/images/20250430121530070855-7e8912c83c1c2afb165d4762e7e4d84d.png) :::tip You must regenerate config files if you change your project name in FlutterFlow Studio or Firebase. ::: 3. **Update Firebase Rules** 1. In FlutterFlow Studio, go to **Firestore** → **Settings**. 2. Scroll to **Firestore Rules** and click **Deploy**. 3. Confirm by selecting **Deploy Now** in the popup. ![](https://docs.flutterflow.io/assets/images/20250430121530401837-7055a97d7146894eafc1a13985ef7065.jpg) A green checkmark indicates success. 4. **Validate Firebase Schema** 1. In **Firestore** → **Settings**, scroll to **Firebase Schema Validation**. 2. Click **Validate**. ![](https://docs.flutterflow.io/assets/images/20250430121530999303-6bf58af56d0c6b82d655917f4b89ce88.jpg) If the schema is valid, you’ll see a success message. If not, review the identified issues. ![](https://docs.flutterflow.io/assets/images/20250430121531448037-98813d12cfb2a8261c32e01bb494151c.png) 5. **Ensure Collections Have Data** An empty Firestore collection can result in a gray screen. Visit the Firebase Console → **Firestore Database** to confirm your collections contain documents. ![](https://docs.flutterflow.io/assets/images/20250430121531723554-2d6543b11bba69cadfb4f34b0f265649.png) 6. **Verify Custom Widget Compatibility** If your app uses a custom widget, make sure its package supports web. On **[pub.dev](https://pub.dev)**, check that **WEB** is listed under platforms. ![](https://docs.flutterflow.io/assets/images/20250430121531973906-ddd21c7e53708e9079602d171afa3222.png) If not, choose an alternative package. 7. **Refresh FlutterFlow Studio Environment** - Press Ctrl + R (Windows) or Cmd + R (Mac) to refresh FlutterFlow Studio. - Clear your browser cache. - Log out and back in. :::tip Refreshing your session can fix slow or buggy behavior in the UI Builder. ::: 8. **Retest the Project** After completing the above steps, create a new Run Mode session to test if the gray screen issue is resolved. 9. **Test Locally** If the issue persists, download your FlutterFlow Studio code and run the project locally to diagnose further. :::note[Additional Resources] - **[Run Flutter App Locally](https://docs.flutterflow.io/testing/local-run)** - **[FlutterFlow Studio Firebase Integration Guide](https://docs.flutterflow.io/integrations/firebase/connect-to-firebase#step-1-set-up-your-project)** ::: # Loading Spinner in Run Mode > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/test-mode/loading-spinner-run-mode A persistent loading spinner in FlutterFlow Studio's Run Mode usually indicates an issue with your Firestore rules configuration. Updating your rules can resolve this issue. A persistent loading spinner in FlutterFlow Studio's Run Mode usually indicates an issue with your Firestore rules configuration. Updating your rules can resolve this issue. :::note[Prerequisites] - You have already connected your FlutterFlow Studio project to Firebase. - You have access to your Firebase Console. ::: Here are the steps to fix this error: 1. **Copy Firestore Rules from FlutterFlow Studio** 1. Open your project. 2. Navigate to **Firestore** → **Settings**. 3. Click the **Copy** icon to copy the default Firestore rules. ![](https://docs.flutterflow.io/assets/images/20250430121355282620-97cec6fdabc1b155638a88186ec7cd62.gif) 2. **Paste the Rules in Firebase Console** 1. Open the **[Firebase Console](https://console.firebase.google.com/)**. 2. Select your project and go to **Firestore Database**. 3. Open the **Rules** tab. 4. Paste the copied rules into the editor and click **Publish**. ![](https://docs.flutterflow.io/assets/images/20250430121355575413-0179d33777cb89357eecedad825c3070.gif) 3. **Retest Your Project in FlutterFlow Studio** Return to FlutterFlow Studio and run your project again in **Run Mode**. The loading spinner should no longer appear if the Firestore rules were configured correctly. :::tip Always keep your Firestore rules up to date after making structural changes to your database in FlutterFlow Studio. ::: # Local Build ProviderInstaller Error > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/test-mode/local-build-providerinstaller-error This error commonly occurs when building Flutter apps on Android emulators. It is related to the ProviderInstaller service and can typically be resolved through basic cleanup and Flutter version upgrades. This error commonly occurs when building Flutter apps on Android emulators. It is related to the `ProviderInstaller` service and can typically be resolved through basic cleanup and Flutter version upgrades. :::note[Prerequisites] - You are testing or running your Flutter project on an Android emulator. - You have Flutter and Android Studio installed and configured. ::: 1. **Uninstall the App from the Emulator** Before rebuilding your app, ensure the old installation is removed: 1. Open the Android Emulator. 2. Locate your app icon and uninstall it. 3. Alternatively, run the following command from your terminal: ```bash adb uninstall com.yourcompany.yourapp ``` Replace com.yourcompany.yourapp with your actual app ID. 2. **Rebuild the App** After uninstalling: Run the following command in your project directory: ```bash flutter clean ``` ```bash flutter pub get ``` ```bash flutter run ``` This will remove cached data and reinstall the app on the emulator. 3. **Upgrade Flutter (If Problem Persists)** If the issue continues, upgrading Flutter may help. Run the command below to upgrade: ```bash flutter upgrade ``` Ensure your Flutter SDK is up to date. You can verify the version with: ```bash flutter --version ``` :::note This error is often related to Google Play Services not being properly initialized on the emulator. If you're still encountering issues, consider creating a new emulator using a system image that includes the Play Store. ::: :::note[Additional Resources] - Read the official **[Flutter Build Documentation](https://docs.flutter.dev/testing/build-modes)**. - Check **[Android Emulator System Images](https://developer.android.com/studio/run/managing-avds#system-images)**. ::: # Slow Loading in Test Mode > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/test-mode/slow-test-mode-load If Test Mode takes several minutes to load or fails entirely, the issue may stem from your browser, network, or project configuration. This guide walks you through the most common causes and how to resolve them. If Test Mode takes several minutes to load or fails entirely, the issue may stem from your browser, network, or project configuration. This guide walks you through the most common causes and how to resolve them. :::note[Prerequisites] - You are using FlutterFlow Studio's Test Mode feature. - You have already deployed or previewed a version of your app. ::: **Steps to Resolve Slow Loading:** - **Check Your Internet Connection** A weak or unstable connection may delay the loading of compiled apps. Make sure you have a stable network before launching Test Mode. - **Sync Your System Clock** Ensure your device’s time and date settings are accurate. An incorrect clock can cause authentication issues and impact performance. - **Clear Browser Cache** Browsers store temporary files that may interfere with page loading. Clearing your cache can resolve stale resource conflicts and improve speed. - **Try a Different Browser** Some browsers may conflict with specific web assets or settings. If one browser is slow, switch to another (e.g., from Chrome to Firefox). - **Disable Browser Extensions** Extensions like ad blockers or privacy tools can interfere with FlutterFlow Studio’s platform. Temporarily disable them to check for improvement. :::tip[Optimize Your Project] Projects with many pages, assets, or custom code may take longer to compile. Follow these steps to optimize your project: - Remove unused images, fonts, or icons. - Consolidate or simplify custom code. - Limit the number of pages in a single testing session. ::: :::note[Additional Resources] If the issue persists after following the steps above, check the **[official support](https://intercom.help/flutterflow/en/articles/7052737-test-mode-is-not-loading-or-is-very-slow-it-takes-a-long-time-to-load-the-app)** article. ::: Following these steps should resolve most Test Mode performance issues and reduce load times for future previews. # Test API Calls > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/test-mode/test-api-calls Verifying an API response before integrating it into your app helps prevent runtime issues and ensures your data is structured correctly. This guide walks you through testing an API directly within FlutterFlow Studio. Verifying an API response before integrating it into your app helps prevent runtime issues and ensures your data is structured correctly. This guide walks you through testing an API directly within FlutterFlow Studio. :::note[Prerequisites] - A project is open in FlutterFlow Studio. - An API key or endpoint is available if required by the API. ::: **Steps to Test API Calls:** 1. **Open the `API Calls` Panel** From the left sidebar, go to the `API Calls` section. ![](https://docs.flutterflow.io/assets/images/20250430121444122926-bf78dbe544e70f93a7407dd066ab6d49.png) 2. **Select or Create an API Call** Choose an existing `API Call` or click `+ Add API Call` to create a new one. ![](https://docs.flutterflow.io/assets/images/20250430121444364083-3d7576af0612eb40005483e67956bfe9.png) 3. **Enter the API Endpoint** Add the endpoint and necessary parameters, headers, or authentication. ![](https://docs.flutterflow.io/assets/images/20250430121444571412-40417a9e3bacd13a6bdadb8d0ec44022.png) 4. **Click the `Response & Test` Tab** Navigate to the `Response & Test` tab to preview the response structure. ![](https://docs.flutterflow.io/assets/images/20250430121444783602-6c0e9c6851a4645a4cbfc0120c06e445.png) 5. **Run the API Test** Click the `Test API Call` button to trigger the request. If successful, the API response displays in JSON format. ![](https://docs.flutterflow.io/assets/images/20250430121445020637-d8c0b6a4a88e89945efcb6487f901642.png) A valid API response displays a structured output like the example below:: ![](https://docs.flutterflow.io/assets/images/20250430121445238952-ca370fce28cc37d1d114d4da9b593eb7.png) :::tip Use **[JSONPath](https://jsonpath.com/)** to validate and extract values from the returned JSON structure during testing. ::: # Fix Google Translate Errors > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/translations/fix-google-translate-errors FlutterFlow Studio integrates with Google Translate to help localize your app automatically. This guide outlines how to identify and resolve common issues with the translation integration. FlutterFlow Studio integrates with Google Translate to help localize your app automatically. This guide outlines how to identify and resolve common issues with the translation integration. :::note[Prerequisites] - Google Translate integration must be enabled for the project. - At least one supported language must be added in **App Settings > Localization**. - Review the [Google Translate Integration](https://docs.flutterflow.io/concepts/localization#add-multi-language-support) guide for setup instructions. ::: ## Common Translation Issues and Fixes - **Long Text Forms** **Problem:** Attempting to translate long blocks of text in forms or widgets can lead to API timeouts or failures. **Solution:** Remove long text elements and translate them outside of FlutterFlow Studio using external tools like Google Translate. Once translated, manually paste the content back into your project. Ensure the input field is empty before retrying automatic translation. - **Special Characters** **Problem:** Some special characters—such as emojis, accented symbols, or non-Latin characters—may not be supported by the Google Translate API and can cause translation to fail. **Solution:** Review the text and replace or remove any unsupported special characters. Then attempt the translation again. - **Exceeding Language Limit** **Problem:** Adding more than 10 language options in your project may result in translation failure. **Solution:** Limit your project to a maximum of 10 supported languages for translation to work reliably with Google Translate. ## Steps to Troubleshoot Translation Failures 1. **Locate the Problem Area** Identify the specific widget, page, or field where translation fails. Focusing on the problematic component will make resolution faster. 2. **Use the Translate All Button** In **App Settings > Localization**, click the **Translate All** button. The process will stop at the first failure, indicating the field or element causing the issue. 3. **Check Chrome Developer Console** Open the Chrome DevTools console and monitor for any error logs related to translation requests. This can help identify issues such as invalid characters, request failures, or unsupported content. 4. **Remove and Isolate Problematic Text** Temporarily delete the suspected text and retry the translation. If the translation proceeds successfully, that text is likely causing the failure. Manually translate and reinsert it. :::note Using shorter, plain-text strings without special characters improves success rates with the Google Translate API. ::: :::note[Additional Help] If the issue persists after troubleshooting, reach out to [support@flutterflow.io](mailto:support@flutterflow.io) with the following: - Screenshot or screen recording of the failure - Console error logs (if available) - A description of where the failure occurs (page/widget/text field) This will help the support team resolve the issue faster. ::: # Custom Widget Errors > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/widget/custom-widget-errors This article demonstrates common errors and issues that may occur when creating a Custom Widget in FlutterFlow Studio, along with steps to resolve them. In this example, an Animated Text Widget is used. This article demonstrates common errors and issues that may occur when creating a `Custom Widget` in FlutterFlow Studio, along with steps to resolve them. In this example, an `Animated Text Widget` is used. ![](https://docs.flutterflow.io/assets/images/20250430121322843622-c050cb0de4edcae7c8f0b355c0d1cbc0.gif) **Project URL:** [Animated Kit Widget Project](https://app.flutterflow.io/project/animated-kit-widget-fyqw6j) **Run Mode URL:** [Animated Kit Widget Run Mode](https://app.flutterflow.io/run/QP62FwanUTRs7O3HJzdo) :::note[Prerequisites] - A custom widget has been added to your project. - Necessary packages have been added to **Custom Code > Packages**. ::: :::tip[Best Practices Before Creating a Custom Widget] - Set a unique name for the custom widget in the left panel `Side Widget` field. - Start with the boilerplate code template provided by FlutterFlow Studio. Copy it and modify your code from there. ![](https://docs.flutterflow.io/assets/images/20250430121323364253-2ec75fa5a0a999b940f42df1e62600fc.gif) ::: **Common Errors and Solutions:** - **Widget Name Conflicts with Package Name** A common issue is using a widget name that conflicts with the name of an imported package. Avoid generic or conflicting names like `main` or `widget`. Use unique widget names that do not overlap with package names. ![](https://docs.flutterflow.io/assets/images/20250430121324152439-03c0a9f6e48a39760356762c6f92d182.png) ![](https://docs.flutterflow.io/assets/images/20250430121324382074-cce6c4b49b75d0c7cf167c99bb384323.png) Avoid using generic or conflicting names like `main` or `widget`. Always use unique widget names that do not overlap with any package names. - **Missing Package Imports in Code** After adding an external package as a dependency, you must import it at the top of your custom widget code. Failure to do so results in errors such as: ```js The method 'AnimatedText' isn't defined... ``` ![](https://docs.flutterflow.io/assets/images/20250430121324695186-b868bac41d84f6149620fb5cf28bc38c.png) Here is how to fix this issue: - Visit the package page on **[pub.dev](https://pub.dev/)** and locate the import line in the package details section. - Copy and paste the correct import statement into your custom widget code. ![](https://docs.flutterflow.io/assets/images/20250430121324981835-de0769611f3ddebf627bd5848965516b.png) ![](https://docs.flutterflow.io/assets/images/20250430121325311155-ffc69bca85d2e981b3bfe20e27edac57.png) - **Missing Indirect Dependencies** Some packages may rely on additional external packages. Ensure that all required dependencies are also imported in your code. ![](https://docs.flutterflow.io/assets/images/20250430121325659677-fd2659d65e96a310697c8f95f506ed47.png) In this example, the package depends on another package named `silver_tools`, which must also be imported. Always review the dependency chain for any external packages you add. ![](https://docs.flutterflow.io/assets/images/20250430121325972589-5ae05af75dca1a7c9f5a46e73b724a4b.png) - **Widget Name Mismatch Between UI and Code** A mismatch between the widget name in FlutterFlow Studio and the class name in your code will cause compilation errors. Incorrect example: ![](https://docs.flutterflow.io/assets/images/20250430121326300880-a8bb8140772717c439f71c0c31bc0b9e.png) Corrected version with matching names: ![](https://docs.flutterflow.io/assets/images/20250430121326628836-42a2cc3c3d2e93715a5cbb6beabf95e5.png) Ensure that the widget name matches exactly in both places. By following these best practices and carefully reviewing package imports, dependencies, and widget names, most common issues with `Custom Widgets` in FlutterFlow Studio can be avoided. # Emoji Size on iOS Devices > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/widget/emoji-size-on-ios-devices On iOS devices, emojis can appear oversized when rendered inside text widgets, disrupting the intended design and layout. This guide explains how to maintain consistent emoji sizing across all devices using container constraints and auto-sizing configuration. On iOS devices, emojis can appear oversized when rendered inside text widgets, disrupting the intended design and layout. This guide explains how to maintain consistent emoji sizing across all devices using container constraints and auto-sizing configuration. :::note[Prerequisites] - You are using a `Text` widget that includes emojis. - You are targeting iOS devices as part of your app deployment. ::: ## Steps to Maintain Consistent Emoji Size 1. **Wrap the Text Widget in a Container** Create a `Container` with fixed width and height (example `32x32 pixels`) to restrict the emoji size. 2. **Place the Emoji Inside a Text Widget** Add a `Text` widget containing the emoji and place it inside the container. 3. **Set a Font Size** Apply a specific font size to the `Text` widget (example, `16`, `24`, etc.). 4. **Enable Auto-Size** Turn on **Auto-Size** in the `Text` widget to allow responsive resizing within the fixed container. ![](https://docs.flutterflow.io/assets/images/20250430121253238523-5b0095421ea62c6cfa11ca4b39e2eb9d.png) This ensures that the emoji will resize according to the container's constraints and not exceed the intended bounds. :::tip Auto-Size works best when combined with fixed container dimensions. This approach prevents oversized emojis and supports responsive layouts. ::: # Infinite Scroll Pagination in ListView > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/widget/infinite-scroll-pagination-in-listview If a ListView with Infinite Scroll enabled loads all items at once instead of paginating, the issue is typically related to layout configuration. This guide outlines how to correctly structure the widget for proper pagination behavior. If a `ListView` with **Infinite Scroll** enabled loads all items at once instead of paginating, the issue is typically related to layout configuration. This guide outlines how to correctly structure the widget for proper pagination behavior. :::note[Prerequisites] - Infinite Scroll is enabled in the `ListView`. - The widget is placed inside a layout that allows height constraints to be respected. ::: Follow the steps below to configure ListView for pagination: 1. **Ensure ListView Has a Defined Height** A `ListView` must have a height constraint to determine the viewport size and paginate correctly. Without a defined height, it will attempt to load all items. 2. **Let ListView Handle Its Own Scrolling** - Disable scrolling in any parent `Column` or scrollable container. - Enable the **Primary** option, and wrap `ListView` in an `Expanded` widget. - This allows `ListView` to control scroll behavior and calculate items to load per page. ![](https://docs.flutterflow.io/assets/images/20250430121248035007-63bc015cf137d22fc50337da21f3a90e.png) 3. **Wrap ListView Inside a Fixed-Height Container (if nested)** If `ListView` is inside a scrollable parent (like `Column` or `ListView`), wrap it in a `Container` with a defined height (e.g., `500px`). This ensures it doesn't expand indefinitely. ![](https://docs.flutterflow.io/assets/images/20250430121248379992-14e1ef9e72be0c45c03a56f55f8b68b1.png) 4. **Avoid Missing Height Constraints** Without constraints, `ListView` will not know the visible size and will load all data at once, bypassing pagination. :::caution Placing `ListView` directly inside a scrollable parent without a defined height will break Infinite Scroll behavior. ::: 5. **Use Layout Structure That Supports Scroll Isolation** Allow `ListView` to scroll independently before the parent scroll takes over. Combine this with defined height and `Expanded` usage for best results. ![](https://docs.flutterflow.io/assets/images/20250430121249048672-6671c857c81494bec61769372aae4a77.gif) :::tip To optimize pagination, define consistent item heights and test using varying screen sizes. ::: :::note[Additional Resources] - **[ListView Scroll Example Project](https://app.flutterflow.io/project/list-view-scroll-example-wdv076)** – View a working configuration example. ::: # Rive Animation Loading Errors > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/widget/rive-animation-loading-errors Rive animations may fail to render when the source file is incorrectly linked. This guide outlines how to provide a valid .riv file URL for successful animation loading. Rive animations may fail to render when the source file is incorrectly linked. This guide outlines how to provide a valid `.riv` file URL for successful animation loading. :::note[Prerequisites] - A valid Rive animation is hosted online with a `.riv` extension. - The animation is added to a FlutterFlow Studio widget that supports Rive. ::: ## Steps to Fix Rive Animation Not Loading 1. **Verify the Rive File URL** Ensure the file URL ends with `.riv` and points directly to a hosted Rive file. ```text https://public.rive.app/community/runtime-files/1199-2317-jack-olantern.riv ``` If the URL points to a webpage or lacks the `.riv` extension, the animation will not load in FlutterFlow Studio. 2. **Copy the Correct Link from Rive Community:** - Go to the animation page on the **[Rive Community](https://rive.app/community/)**. - Right-click the **Download** button. - Select Copy Link Address. The copied link must end with `.riv`. Any URL that redirects to a webpage or file viewer will fail to render. # Scroll To Action on Page Load > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/widget/scroll-to-action-on-page-load When a Scroll To Action fails to trigger during a page load, it is often because the scrollable widget has not fully rendered at the time the action executes. This guide outlines how to ensure the scroll action works reliably during page load. When a `Scroll To Action` fails to trigger during a page load, it is often because the scrollable widget has not fully rendered at the time the action executes. This guide outlines how to ensure the scroll action works reliably during page load. :::note[Prerequisites] - The `Scroll To Action` is configured inside an `On Page Load` action flow. - The target widget is inside a scrollable view such as `ListView` or `Column`. ::: ## Steps to Ensure Reliable Scroll Behavior: 1. **Add a Delay Before the Scroll Action** Insert a `Delay Action` before the `Scroll To Action` to allow the widget tree to complete rendering. Recommended delay duration is 500 to 700 ms. ![](https://docs.flutterflow.io/assets/images/20250430121250453056-db9b60be4173ea5f88d908ab4673546a.png) 2. **Use Load Animations for Scrollable Widgets** Applying an animation ensures the widget is fully visible before scrolling. - Add a load animation (e.g., `Fade`) to the scrollable widget. - Set the animation duration to approximately `1200 ms`. - Add a `Delay Action` before the scroll action (e.g., `700 ms`). ![](https://docs.flutterflow.io/assets/images/20250430121250214649-b4e5617b809194b82b868f3a40d38d17.png) :::tip Combining a delay with animation prevents the scroll action from executing before the widget appears, creating a smoother transition. ::: # Store Custom Widget Output Using App State > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/troubleshooting/widget/store-custom-widget-output-using-app-state To use the output from a custom widget elsewhere in your project, you can store its value in an app state variable. FlutterFlow Studio does not directly support retrieving data from custom widgets, so this method provides an effective workaround. To use the output from a custom widget elsewhere in your project, you can store its value in an app state variable. FlutterFlow Studio does not directly support retrieving data from custom widgets, so this method provides an effective workaround. :::note[Prerequisites] - You have created a custom widget in your project. - You are familiar with the **[App State management](https://docs.flutterflow.io/resources/data-representation/app-state)** system in FlutterFlow Studio. ::: ## Steps to Store Output from a Custom Widget 1. **Create an App State Variable** Go to **App State**, then create a new app state variable that will hold the value returned by your custom widget. ![](https://docs.flutterflow.io/assets/images/20250430121220879251-67b746b90666bc17fb112c6558d78583.png) 2. **Update the App State Variable from the Custom Widget** In your custom widget code, use `FFAppState()` to set the value of the app state variable. ![](https://docs.flutterflow.io/assets/images/20250430121221066642-eafa9c31015ec78d924fb47ad3774de8.png) ```js FFAppState().update(() { FFAppState().localvalue = 'setvalue'; }); ``` App state variables can be accessed anywhere in your FlutterFlow Studio project, making them useful for sharing data between custom widgets and other parts of the app. # Craft your intent on the canvas. Bring the cost of design iteration to zero. > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer Discover FlutterFlow Designer—the fastest way to design apps. Explore its key features, understand how it works, and start designing your first app with ease.

FlutterFlow Designer provides the fastest UI generation in the world, without sacrificing quality or control integrated with agents for a seamless design-to-code experience.

Available on the web and as a desktop app for macOS and Windows.

## Get started - [Quickstart](https://docs.flutterflow.io/designer/quickstart): Generate your first app design from a simple text prompt and export it in just a few steps. - [Tour the workspace](https://docs.flutterflow.io/designer/workspace): Get familiar with the panels, canvas, and tools that make up the Designer environment. ## Explore the Designer - [Components](https://docs.flutterflow.io/designer/components): Build reusable UI blocks with variants and parameters to keep your design system consistent across screens. - [Import & Export](https://docs.flutterflow.io/designer/import): Bring existing FlutterFlow Studio screens into Designer or hand off designs back to FlutterFlow Studio, PNG, or agent-ready prompts. - [Integrations](https://docs.flutterflow.io/designer/integrations): Integrated with agents for a seamless design-to-code experience. Connect Designer with Claude, Gemini, and other AI tools to edit designs in natural language. FlutterFlow Designer empowers both non-technical creators and development teams to move faster during early UX and UI exploration, then hand off straight to code. # Quickstart > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/quickstart Get started with designing your first app quickly. FF Designer lets you generate complete app designs from simple text prompts. Just describe what you want to build, explore different style directions, and the Designer will create a full set of screens for you. From there, you can refine the design using AI or manual editing and export it directly to continue building. Ready to design your app? Simply: 1. Open FF Designer and click the prompt bar that says **Describe your app** 2. Enter your app idea and press **Enter** to generate designs 3. Browse style variants and click **Use This Style** 4. Review the generated screens in the canvas 5. Edit using AI or manually adjust elements and properties 6. Export your design to FlutterFlow Studio, PNG, or Agent Prompt The Designer generates complete app screens in seconds, giving you a strong starting point that you can quickly refine and turn into a real app.

## Sample Prompts Here are some prompts you can try in FF Designer to quickly generate complete app designs. ### Personal Finance Tracker **Prompt** Design a personal finance app that helps users track expenses and manage budgets. Show a dashboard with total balance, recent transactions, and spending categories. Include detailed views for transaction history and budget insights. Make the UI clean, modern, and easy to understand. ![finance-app.avif](https://docs.flutterflow.io/assets/images/finance-app-8ffa78c3f7319b18a7e7762a8e221bdf.avif) ### Fitness Workout App **Prompt** Create a fitness app with a home screen showing daily workouts, progress stats, and streaks. Include workout detail screens with exercises, sets, and timers. Make the design energetic, modern, and easy to follow. ![fitness-tracking-app.avif](https://docs.flutterflow.io/assets/images/fitness-tracking-app-bb5432071c0bf822fb2e5e325f0b1753.avif) ### Food Delivery App **Prompt** Design a food delivery app with a home screen showing nearby restaurants, categories, and featured items. Include restaurant detail pages, menu listings, and a checkout flow. Make the UI modern, colorful, and easy to navigate. ![food-delivery-app.avif](https://docs.flutterflow.io/assets/images/food-delivery-app-2d46a90c637607c3c9370ed25f2929cc.avif) # Workspace > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/workspace Learn about FlutterFlow Designer's workspace that provide a complete design environment with specialized tools. The workspace is organized into panels that work together to provide a complete design experience. ![ff-designer.avif](https://docs.flutterflow.io/assets/images/ff-designer-36dc528ec8066b359fded4a387a0dc67.avif) - **Frames Panel**: Displays all screens of the app and allows quick navigation between them. - **Components Panel**: Create reusable UI elements. - **Theme Panel**: Make global theme customization. - **Layers Panel**: Shows the hierarchical structure of widgets within the selected screen. - **Canvas Area**: Visual preview of all screens in storyboard layout. - **Undo/Redo Controls**: Quickly revert or reapply recent design changes. - **Light/Dark Mode Toggle**: Switch between light and dark preview modes to instantly see how your design adapts across themes. - **Zoom Controls**: Adjust zoom level for better overview or detailed editing. - **Share Button**: Share the current design or collaborate with others. - **Properties Panel**: Edit properties of the selected widget such as layout, content, and styling. - **Prompt Bar**: Use AI commands to describe changes and modify the selected screen or widget. # Prompting > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/prompting Generate your first app design from a prompt. Explore styles, attach reference images, and create a complete storyboard from a single description. Prompting is how you turn an idea into screens. Describe your app in the main prompt box, optionally attach a reference image, and the Designer generates a complete editable storyboard for you. ## Create Designs Here's how you generate an initial screen design, refine, and export it: 1. You can select [**Explore Styles**](#explore-styles) to first browse and refine design ideas, or choose **Instant Generation** to skip that step and quickly create designs from your prompt. 2. Go to the **main prompt box** and write your app vision with important details (e.g., app type, target users, key screens, primary actions, and any must-have features). For example: *"Design a travel planning app with a modern card-based layout, destination image grids, a bottom navigation bar with Explore, Trips, Bookings, and Account tabs, saved itineraries, map integration, and a trip detail screen with timeline and booking information."* 3. Optionally, [**attach an image**](#add-image-attachments) such as a sketch, wireframe, or screenshot using the image attachment button below the prompt field. The Designer will use it as a reference to transform it into a fully editable design. 4. Use the mobile and desktop toggle to set your target platform. This ensures your designs are generated with the correct layout and screen dimensions for your intended device. 5. Click the **submit** (up-arrow) button to generate your design storyboard. 6. Review the generated screens. Scan through the generated frames to confirm: - The right screens exist (and no critical screens are missing) - The overall flow makes sense - The UI direction matches your intent 7. Select a screen to refine. You can [**use the prompt bar**](https://docs.flutterflow.io/designer/iterate#use-ai-prompt) to request changes to the selected screen. 8. You can also make precise tweaks from the [**Properties panel**](https://docs.flutterflow.io/designer/iterate#use-properties-panel). Select an element and adjust its properties on the right side, such as text, typography, spacing, styling. 9. To add a new screen, click on an empty area of the canvas, then in the bottom prompt input, describe the screen you want to add. Include its purpose, key UI elements, and how it connects to the overall flow, then submit. 10. Open the **Theme** tab to edit global styling like colors, typography, spacing, and radius so the entire design stays consistent. 11. You can generate a **shareable link** for feedback and review. 12. To export your design, open the top-left app menu (FF Designer) and choose an **export option**.

### Explore Styles **Explore Styles** helps you try different visual directions for your app before generating the final design. Instead of going straight to a full build, you can first browse style variations, compare layouts, adjust colors, and guide the design toward the look you want. This is useful when you already know what your app should do, but want help deciding how it should look. Once the styles are generated, browse through the generated variants and look for the one that feels closest to your vision. Each style gives you a different take on the same app idea, such as a different layout, spacing, typography, or visual mood. When you hover over a style, you can use the following options: - **Regenerate**: Recreates the style if something looks off or needs improvement. - **More Like This**: Generates more variations similar to the selected style. - **Remix Colors**: Keeps the overall style but changes the color palette. - **Prompt for Changes**: Lets you describe specific updates you want for that style. - **Use This Style**: Selects that style and starts the full generation process.

### Add Image Attachments You can attach reference images directly in the prompt to guide the design generation process. This is useful when you have an existing sketch, low-fidelity wireframe, competitor screenshot, or inspiration design that you want the Designer to follow. To do so, simply click the image attachment button below the prompt field and upload your image. The AI will analyze the layout, visual hierarchy, and structure, then transform it into a clean, fully editable multi-screen design. For example, you might upload a rough wireframe of a food delivery app showing a home screen with a search bar, restaurant cards, and a bottom navigation bar. Along with the image, you can add a prompt such as "Using the attached screenshot as a reference, convert this wireframe into a modern food delivery app design."

## FAQ
Are charts from Designer converted into FlutterFlow Studio chart widgets?

Yes. Bar charts, line charts, and pie charts created in the Designer are automatically converted into fully functional FlutterFlow Studio chart widgets.

![ff-designer-chart-conversion](https://docs.flutterflow.io/assets/images/ff-designer-chart-conversion-fa4fa0a5bbaffd262bbff76cbf48c1c3.avif)
# Iterate > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/iterate Refine and improve your generated screens visually, with AI prompts, or by editing the global theme. After generating your initial storyboard, you can refine and improve your screens in two ways: [editing visually](#edit-visually) on the canvas and [using AI prompts](#use-ai-prompt). Each method is useful depending on the type of change you want to make. ## Edit Visually This is useful when you want precise control over layout and structure. It makes it easy to quickly add or adjust elements exactly where you want them. To start, click on any UI element in the canvas. The selected element will be highlighted, and small dots will appear around it. You can click any of these dots to add a new UI element at that position. When you click a dot, a selector pop-up opens, allowing you to choose and insert a new element.

You can also rearrange elements using drag and drop. Simply select an element and move it to a new position within the layout.

### Use Properties Panel The Properties Panel allows you to make precise adjustments to any selected widget. When you click on an element in the canvas, its editable properties appear on the right side. From there, you can modify properties such as text content, typography settings, spacing, alignment, colors, borders, and other styling attributes. This gives you direct control over how each element looks and behaves without needing to regenerate the entire screen. Unlike AI-driven changes, edits made here are exact and predictable, making it ideal for polishing the design once the overall layout and structure are already in place.

## Use AI Prompt This method is best for structural, layout, or multi-element changes. To make a change using AI Prompt: 1. Click on the screen (frame) you want to update from the canvas or Frames panel. 2. Use the prompt bar at the bottom to clearly describe what you want to modify. 3. If you're not satisfied with the result, use the regenerate option to explore a new variation of the same instruction. 4. You can click directly on a widget. The selected widget will automatically be added to the prompt bar as context for your next instruction, allowing more precise AI updates.

You can also select a page and ask the AI to generate variations of it. This helps you quickly explore different design directions.

## Edit Theme Editing a **Theme** allows you to modify the global design system of your entire storyboard at once. Instead of adjusting individual widgets, you can change core styling elements such as brand colors, typography, spacing, corner radius, and text scaling. Any updates made in the Theme Editor automatically apply across all screens, ensuring visual consistency without manual updates on each page.

# Components > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/components Learn how to create reusable UI components, add variants and toggles, and manage dynamic behavior using parameters and expressions in FlutterFlow Designer. A **component** is a reusable UI building block that you can use across your app design. Instead of creating the same UI again and again, you build it once as a component and reuse it wherever needed. This helps keep your app design consistent and easier to maintain. When you update a component, all places where it is used automatically get updated. Imagine you are having a settings screen with multiple rows, such as: - Notification toggle - Privacy option - Account settings Each row has a similar layout with an icon, text, and an action such as switch or arrow. Instead of having each row separately, you can create one **Settings Item component** and reuse it multiple times with different content. ### Creating Component To create a new component, start by selecting an existing UI block on the canvas. Then click **Create Component** from the right-side panel, give your component a name, and choose the parameters you want to include (such as text, image, or icon). Once you confirm, the component is created and opens in Component Studio. Inside Component Studio, you can bind these parameters to different UI elements. Select an element, then connect its properties (like text or image) to a parameter from the right panel. You can also add new parameters if needed. This allows each instance of the component to display different content while keeping the same structure and design.

:::tip Once the component is created, you can also use AI to quickly update your component by describing the changes instead of manually editing everything. ::: ### Create Variants A **variant** is a different version of the same component that allows you to change its appearance without creating a new component. Variants help you manage multiple styles, states, or layouts in one place to make your components more flexible and reusable. For example, a button component can have variants like **Filled** and **Outlined**. To create a variant, first open your component and click **Add variant**. This creates a new option for the current component, such as an alternate style or layout. Once the new variant appears, select it and customize its properties to make it visually different from the default version, such as changing borders, spacing, colors, or other styling details. If you want to introduce a completely new category of variation, click **+ Add variant** again to create a new dimension for the component.

### Add Toggle A **toggle** lets you switch between two states of a component, such as on/off or active/inactive, within the same component. For example, a settings item can have a toggle to show **enabled** or **disabled** states, or a card can toggle between **selected** and **unselected** styles. To add a toggle, open your component and click **Add toggle** from the variants panel. This creates a new toggle dimension for your component. Once added, you’ll see two states (i.e., true/false). Select each state and customize the component to define how it should look in each case.

#### The `Has` Expression The `Has` expression lets you automatically control a Boolean property based on whether a component parameter has been provided. This is useful when you want part of a component to appear only when data exists, without manually setting a separate true/false value each time. For example: - Show an image only when `image_url` is set - Show a subtitle only when `subtitle` is set - Show a time row only when `time` is set A `Has` expression checks whether a parameter contains a value. If it does, the result is `true`. If it does not, the result is `false`. Suppose you have a flight booking card component with an optional image on the right side. Instead of adding both `image_url` and a separate `show_image` flag, you can just use `image_url` and bind the **Visible** property to `has(image_url)`. If an image is provided, the card displays the image, and if not, it just appears as a text-only layout. ![control-using-has-expression](https://docs.flutterflow.io/assets/images/control-using-has-expression-33d71531048737ae78b8b2cda1971a4c.avif) # Collaboration > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/collaboration Work on the same design together — in real time, with comments and shared access. Collaboration lets multiple people work on the same design at once. Edits, cursors, and comments all stay in sync, so a team can explore and refine a design together without passing files back and forth. ## Sharing & Access Designs are shared by email. You invite someone by entering their email address, and they get access to that specific design — there are no public links or anonymous access. Each collaborator is given one of two roles: - **View** — open the design and follow along, without making changes. - **Edit** — make changes to the design alongside everyone else. The owner manages who has access and can add, change a role, or remove collaborators at any time. Access is granted per design, so sharing one design doesn't expose anything else in your workspace. ### Add a Collaborator 1. Open the design you want to share, then open the **Collaboration** dialog from the share control. The owner is shown at the top, with everyone the design is shared with listed under **Shared with**. 2. In the email field (`name@company.com`), type the address of the person you want to add. 3. Use the role dropdown next to the field to set their access — **View** or **Edit**. New collaborators default to **Edit**. 4. Select **Add** (or press Enter). They appear in the **Shared with** list, and live collaboration turns on for the design.

### Change a Collaborator's Role In the **Shared with** list, open the role dropdown on that person's row and switch between **View** and **Edit**. The change applies immediately.

### Remove a Collaborator In the **Shared with** list, select the remove icon on that person's row. They lose access right away. Removing the last collaborator turns off live collaboration for the design. ## Real-Time Editing Everyone with Edit access works on the same canvas at the same time. Changes appear instantly for all collaborators, like adding a frame, restyling an element, or updating the theme is reflected for everyone as it happens, with no manual saving or refreshing. Because changes are merged automatically as they're made, multiple people can edit at the same time without overwriting each other's work or running into "who saved last" conflicts.

Active collaborators are shown on the canvas as you work, so you always know who else is in the design and what they're focused on. ## Comments Comments let you leave feedback directly on a design — pinned to a frame, an element, or the canvas itself — so discussion stays anchored to what it's about. Each comment opens a thread for replies, and the Designer Agent can act on a comment to make the change for you. ### Add a Comment 1. Right-click on the canvas, a frame, or an element, and choose **Comment**. A **New comment** popover opens, anchored where you clicked. 2. The popover shows the target above the input — **On Canvas**, **On Frame …**, or the element name — so you know what the comment is pinned to. 3. Type in the **Add a comment** field (up to 4,000 characters). 4. Select **Send** (or press Enter). A canvas comment drops a pin with your avatar; a frame or element comment adds a count bubble to the frame.

### View and Reply in a Thread 1. Select a canvas **pin**, or a frame's **comment bubble** (tooltip: *View comments*). A bubble with multiple threads opens a list first — pick the one you want. 2. The thread shows the original comment and all replies, oldest to newest. Long threads load more replies as you scroll. 3. Type in the **Write a reply** field at the bottom and press Enter or select **Send**.

### Edit or Delete Your Own Comment These actions appear only on comments you authored. 1. Hover the comment you wrote and select the **⋯** menu (tooltip: *Comment actions*). 2. Choose **Edit**, change the text in place, and send. The comment is marked **Edited**. 3. Choose **Delete** to remove the comment. ### Ask the Designer Agent 1. Hover a comment or open its thread, then select **Ask agent to fix** (the sparkles action). It's available from a comment row, the thread header, and individual messages. 2. The agent reads the full thread, original comment and replies and applies the requested change to the target frame or element. It's unavailable while the editor is already busy. 3. When it finishes, the agent posts a reply in the thread confirming the change.

:::note For comments on the canvas, this action instead creates a new frame from the comment. ::: # Import from FlutterFlow Studio > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/import Bring existing FlutterFlow Studio screens into Designer to enhance layouts, explore new styles, and refine the user experience faster. Importing from FlutterFlow Studio allows you to bring your existing app screens directly into the Designer environment. Instead of rebuilding UI from scratch, you can enhance layouts, explore new styles, and refine user experience faster. This is especially helpful when you want to modernize an existing app, experiment with different design directions, or quickly generate improved versions of your current screens. To import screens from FlutterFlow Studio, select **Export to Designer** from the canvas menu options, then choose the pages you want to send in the export dialog. Once selected, click the export button to transfer them. After the process completes, the selected pages will open in FF Designer, where you can continue customizing and iterating on them.

# Export > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/export Export your FlutterFlow Designer designs as PNGs, agent-ready prompts, or directly into a FlutterFlow Studio project. Once your screens are finalized, you can export your design for implementation. FlutterFlow Designer provides flexible export options depending on whether you want static assets, reusable prompts, or direct integration into FlutterFlow Studio. ## Export Options - **Export Frames as PNGs:** Download high-quality PNG screenshots of your frames. This is ideal for adding to documentation, or presenting visual concepts. - **Export Agent Prompt:** Download an agent-ready prompt as a Markdown file. This allows you to reuse the generated design structure as context in AI workflows or modify it further using natural language instructions. - **Export to FlutterFlow Studio:** Copy all frames directly to your clipboard for pasting into a FlutterFlow Studio project. Simply select a widget on a FlutterFlow Studio project page and paste to import all your design instantly. ## Export Storyboard To export the entire storyboard, open the top-left **FF Designer** menu and choose one of the export options (PNGs, Agent Prompt, or FlutterFlow Studio). This method is best when your full flow is ready for implementation. ![export-all.avif](https://docs.flutterflow.io/assets/images/export-all-51648fdd1bb34062810c024ff8917b21.avif) ## Export a Single Frame To export a single frame, select a specific frame and use the **Export** section in the right panel. Use this when you only need to implement a particular screen. ![export-single-screen.avif](https://docs.flutterflow.io/assets/images/export-single-screen-e6ce2e1682fbb34dd8ecef32b722bc23.avif) # Slides > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/slides Turn a FlutterFlow Designer project into a presentation deck. Design 16:9 slides, present with presenter view, and import or export PowerPoint files. **Slides** turns a FlutterFlow Designer project into a presentation deck. Instead of designing phone, tablet, or desktop screens, each frame becomes a 16:9 slide. You get speaker notes, a real present-with-presenter-view mode, and two-way PowerPoint support: import an existing `.pptx` to edit, or export your deck back out to `.pptx`. ## Set up a slide deck 1. Switch the project's device type to **Slides**. 2. Frames become fixed presentation sizes: **1280×720** (720p) or **1920×1080** (1080p). 3. Describe the deck you want in the prompt textbox (your topic, key points, and how many slides) and let Designer generate it. 4. Once the deck is generated, refine each slide manually, just like any other design project.

### Speaker notes Each slide gets its own **speaker notes** field in the right-hand panel. These notes show up in presenter mode and travel with PowerPoint import and export.

## Present the slideshow To start, click the **Present** button in the top bar (only visible on Slides projects), or use the present keyboard shortcut. You get a two-window setup: - A full-screen **audience view**: clean, black background, showing exactly what the room sees. - A separate **presenter window** showing the current slide, a preview of the next slide, your speaker notes, an elapsed-time timer, and prev/next controls.

### Navigation shortcuts | Action | Keys | |--------|------| | Next | `→` · `↓` · `Space` · `Page Down` · or click/tap the slide | | Previous | `←` · `↑` · `Page Up` | | Exit | `Esc` | :::tip You can keep editing slides while presenting, and changes sync live into the presentation. When you exit, the canvas jumps back to whatever slide you ended on. ::: ## Export to PowerPoint In the left panel, choose **Export to PowerPoint**, or use the **Export presentation (.pptx)** button in the right panel. The result is a real, editable PowerPoint file: text stays as editable text and shapes stay as shapes (not flattened images) wherever possible. Charts export as native charts; icons that can't be represented natively are rendered as images. # Integrations > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/designer/integrations Connect FlutterFlow Designer with AI agents and developer tools to generate, edit, and update designs using natural language from your preferred environment. You can connect FlutterFlow Designer with external AI agents and developer tools. This enables you to generate, edit, and inspect designs directly from your preferred AI environment instead of working only inside the Designer UI. For example, you can use an agent like Claude or Codex to open your design, make layout changes, add components, or iterate on styles just by describing what you want in natural language. :::note[Prerequisites] Before using integrations, make sure the following are set up: - [**FlutterFlow Designer Desktop App**](https://storage.googleapis.com/flutterflow-downloads/designer/macos/prod/flutterflow-designer-latest-macos.dmg) is installed (currently available only on macOS) - **Agent MCPs** are installed via CLI. The install commands are: - **Claude Code:** `npm install -g @anthropic-ai/claude-code` - **Gemini CLI:** `npm install -g @google/gemini-cli` - **Codex CLI:** `npm install -g @openai/codex` - Supported **IDEs** are installed on your system. To download, use the official links: - **Cursor:** https://cursor.com/download - **Antigravity:** [https://antigravity.google/download](https://cursor.com/download) ::: ## Installation To add integrations, go to the **Integrations** section inside FlutterFlow Designer. Here you will see available integrations under **Agent MCPs** (such as Claude Code, Gemini CLI, and Codex) and **IDEs** (such as Cursor, Antigravity). Click **Install** next to any integration you want to use.

## Launch Agent To launch an agent and update the design: 1. Open your design project and click the agent menu option in the top-right side. 2. Choose where you want to open the project, such as **Open in Claude Code**, **Open in Gemini CLI**, **Open in Cursor**, or **Open in Antigravity**. 3. Once the terminal opens, describe the change you want to make. For example, ask the agent to create more variations of a selected screen or modify the current design. 4. When the agent asks for permission to run a Designer MCP tool, approve the request so it can inspect and update the project. 5. Wait for the agent to complete the task. It will create or update frames inside your current design project. 6. Return to FF Designer and review the generated frames or changes.

## MCP Calls MCP Calls let an AI assistant work directly with your current FF Designer project. It can read, edit, create screens, update UI, manage components, adjust themes, and export designs. There are two main calls: - `create_session`: Connects the assistant to your open project and returns a session ID with available tools. Must be called first. - `call_design_script`: Executes actions like editing screens, creating layouts, updating content, or exporting designs. Using MCP Calls, an assistant can work with: - **Designs**: Create, open, rename, or export projects - **Frames (Screens)**: Create, duplicate, edit, or organize screens - **Nodes (Elements)**: Update text, colors, images, layout, and structure - **Components**: Create reusable UI, edit once and update everywhere - **Theme**: Control colors, typography, spacing, and styles - **Images & Assets**: Upload, replace, generate, and manage media - **Captures**: Take screenshots of screens or elements - **Selection**: Work on currently selected items - **History**: Undo, redo, and review changes The assistant operates directly on your design, making it easy to iterate quickly and visually. # FlutterFlow Marketplace > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace Discover how to explore, purchase, and contribute to the FlutterFlow Marketplace, including guidelines for submissions and handling copyrights. FlutterFlow Studio's Marketplace is a dynamic platform designed to enhance your app development experience by providing a vast array of pre-built templates, components, and other resources. ## Exploring the FlutterFlow Marketplace In the FlutterFlow Marketplace, you can [add and purchase](https://docs.flutterflow.io/marketplace/adding-purchasing-item) items to quickly integrate into your projects, significantly reducing development time. The Marketplace is curated to ensure high-quality resources, with contributions from a diverse community of developers and designers. ## Becoming a Contributor If you're interested in contributing to the Marketplace, the [creator hub](https://docs.flutterflow.io/marketplace/creators-hub) is your starting point. Here, you can learn about [submitting items for review](https://docs.flutterflow.io/marketplace/creators-hub/submit-item-for-review), [submission criteria](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria), and [legal guidelines](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators) for creators. Ensuring your submissions adhere to these guidelines helps maintain the quality and integrity of the Marketplace. ## Protecting Your Work Understanding and navigating [copyright (DMCA process)](https://docs.flutterflow.io/marketplace/creators-hub/copyright-dmca-process) is crucial for both creators and users. The Marketplace provides clear instructions on how to handle copyright issues, ensuring that intellectual property rights are respected. For those dealing with third-party resources, [navigating external licensing](https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses) is essential. The Marketplace offers guidelines to help you understand and comply with various licensing agreements. ## Marketplace Policies and Guidelines Understanding our marketplace policies helps ensure a positive experience for all users: - [Refund Policy](https://docs.flutterflow.io/marketplace/refund-policy) - Learn about our refund policy and exceptional circumstances - [Review Dispute Guidelines](https://docs.flutterflow.io/marketplace/creators-hub/review-dispute-guidelines) - Understanding when and how reviews may be disputed - [Submit Feedback](https://docs.flutterflow.io/marketplace/submit-feedback) - Learn how to rate items and provide feedback ## FAQs Our [Creators FAQs](https://docs.flutterflow.io/marketplace/creators-hub) section provides answers to common questions, supporting you throughout your journey in the Marketplace. # Adding & Purchasing Items > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/adding-purchasing-item Learn how to add and purchase FlutterFlow Studio marketplace items. The **FlutterFlow Marketplace** lets you add new features to your app in just a few clicks. It includes ready-made components, templates, and libraries built by other users. These items can help you add things that are not yet available in FlutterFlow Studio or would take more time to build from scratch. To add a Marketplace item, go to your FlutterFlow Studio dashboard and click **Marketplace**, or visit [marketplace.flutterflow.io](https://marketplace.flutterflow.io/) directly. Click on any item to view its details. - For **free items**, click **+ Clone for Free**, then choose the project you want to add it to. - For **paid items**, click **Buy Now** and complete the purchase. Once added, the item will be available in your selected project for immediate use. **Free Item** ![free-item](https://docs.flutterflow.io/assets/images/free-item-723adc39b8cba522e58a59b89a0cffb0.avif) **Paid Item** ![paid-item](https://docs.flutterflow.io/assets/images/paid-item-1eb671388d39c50fbe09110f71035c44.avif) ## Add Library Item To install a library item from the Marketplace, search for the library, open its details page, and click **+ Add for Free**. This adds the library to your FlutterFlow Studio account, meaning you can reuse it in any of your projects. To add it to a specific project, go to **Settings > Project Dependencies**, click **Add Library**, and search for your library. ![branch-library-install](https://docs.flutterflow.io/assets/images/branch-library-install-c634fb2710a175e9f5cca5a7a7a738b9.png) # Refund Policy > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/refund-policy Learn more about the refund policy of FlutterFlow Studio marketplace. :::note Please note that this policy does not override the local laws concerning refunds in your country, which remain applicable where necessary. ::: At FlutterFlow Studio, we're committed to ensuring that Marketplace offers high-quality templates that meet the diverse needs of our users. We understand the importance of finding the right tools to accelerate your app development, and we strive to ensure our Marketplace reflects the high standards you expect. ## No-Refund Policy Due to the digital nature of Marketplace items, which include access to code, design, and layout, we maintain a **no-refund policy**. This policy is clearly outlined during the purchase process near the "Buy Now" button. Each template is designed for single use, and once purchased, the buyer gains immediate access to all its contents, making returns infeasible. ## Exceptional Circumstances While our policy is to not offer refunds, we are committed to the satisfaction of our customers. If you encounter any of the following issues, you may be eligible for refund consideration: 1. **Major Defects:** All the items are thoroughly tested before being published, but unexpected errors may occur. Such issues must be submitted for verification. If any deficiency is confirmed, we will reach out to the item creator to address the issue and may issue a refund if we fail to address the defect within a reasonable time frame. 2. **Purchased with Incorrect Account:** If you purchased an item with a different account than you intended and have not yet used the item, we can help transfer the item to the correct account. If you believe an item qualifies, please contact us directly by emailing [marketplace@flutterflow.io](mailto:marketplace@flutterflow.io). Each request will be considered on a case-by-case basis, and in exceptional circumstances, we may issue a refund. Such cases are handled manually and may take 5-10 days to process. ## Feedback and Resolution Your feedback is vital in helping us improve the quality of the offerings on our Marketplace. If the template didn’t meet your expectations, please consider: - **Providing Feedback:** You can [rate the item](https://docs.flutterflow.io/marketplace/submit-feedback#rate-an-item) in your Marketplace dashboard, which helps us maintain quality standards and assists other users in making informed decisions. - **Contacting the Creator:** [Reach out directly](https://docs.flutterflow.io/marketplace/submit-feedback#contact-the-item-creator) to the item creator to express any dissatisfaction. - **Reporting Issues:** If you believe the item violates our standards or policies, please [report it](https://docs.flutterflow.io/marketplace/submit-feedback#report-an-item). We take these concerns seriously and investigate every report. # Submitting Feedback for Items > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/submit-feedback Learn more about the submitting feedback on FlutterFlow Studio marketplace items. At FlutterFlow Marketplace, your feedback is crucial to improving the quality and reliability of the items available. There are three main ways to submit feedback: ## Contact the Item Creator For direct feedback or questions, we recommend contacting the item creator. This is great for providing constructive feedback or for support with minor item issues: **Via Item Detail Page:** 1. Navigate to the item's detail page on Marketplace. 2. Click the **Contact the creator** button. This action will launch a new email draft with the creator's official email address pre-filled. **Via Creator's Profile:** 1. Navigate to the creator's profile on Marketplace. 2. Click the **Contact** button. This action will copy the creator's official email address to your clipboard. 3. Send an Email to the copied email address. ## Rate an Item You can rate items you have used, which helps other users make informed decisions: **Via Item Detail Page:** 1. Navigate to the item's detail page on Marketplace. 2. Navigate to the **Reviews** tab. 3. Click **Add a review**. 4. Select a star rating from 1 to 5, where 5 is the highest. 5. Optionally, add a comment to your rating. Please keep your feedback respectful and honest. **Via Dashboard:** 1. Go to the **Usage History** tab of your [dashboard](https://marketplace.flutterflow.io/dashboard). 2. Find the item you want to rate and click on the stars next to it. 3. Select a star rating from 1 to 5, where 5 is the highest. 4. Optionally, add a comment to your rating. Please keep your feedback respectful and honest. ## Report an Item If you encounter any issues with an item that may require our attention, such as copyright or trademark infringements, or severe quality issues, you can report it. Reports are submitted anonymously and will alert both the creator and our Marketplace team. 1. Navigate to the item's detail page in Marketplace. 2. Click **Report this item** button. 3. Choose a report type and clearly describe the issue, including external URLs if necessary. 4. Click **Submit** :::tip If you are the original author or copyright holder of content that has been uploaded to the FlutterFlow Marketplace without your permission, you can file DMCA takedown request following the instructions in [**FlutterFlow Studio's Terms of Service**](https://flutterflow.io/tos). ::: ## Review Disputes If you're a creator and believe a review on your item was submitted inappropriately, you can learn about our review dispute process in our [Review Dispute Guidelines](https://docs.flutterflow.io/marketplace/creators-hub/review-dispute-guidelines). This covers when reviews may be removed and how to submit a dispute. # Creators Hub > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/creators-hub This section is designed to provide you with all the necessary information to contribute effectively and responsibly to Marketplace. Welcome to the FlutterFlow Marketplace Creators' Hub! This section is designed to provide you with all the necessary information to contribute effectively and responsibly to Marketplace. Whether you are submitting your first item or looking to understand the legal nuances, you'll find detailed guidelines and helpful tips here. ### Submitting an Item for Review - Understand the [criteria](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria) we apply to items submitted to Marketplace. - Learn how to prepare and [submit](https://docs.flutterflow.io/marketplace/creators-hub/submit-item-for-review) your items to the Marketplace with our step-by-step guide. ### Legal Guidelines for Creators A user-friendly [guide](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators) outlining what content can and cannot be published on our Marketplace. We've also compiled information on dealing with [external licenses](https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses), including excerpts from popular third-party marketplaces that restrict the creation of templates on platforms like FlutterFlow Marketplace. Finally, we have a detailed guide on how we handle [DMCA takedown notices](https://docs.flutterflow.io/marketplace/creators-hub/copyright-dmca-process). This is crucial for understanding how to manage copyright issues and ensure compliance. ### Creator FAQs [Find answers](https://docs.flutterflow.io/marketplace/creators-hub/creator-faqs) to common questions from fellow creators. # Submitting Item for Review > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/creators-hub/submit-item-for-review Learn how to submit an item to the FlutterFlow Marketplace. All items submitted to the Marketplace are subject to a comprehensive review process prior to publication. While we have recently significantly improved review times, please note that the review period can take up to 30 days depending on the complexity and volume of submissions. :::danger[Important: Review Submission Policies] Please review our [**Submission Guidelines**](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria) and our [**Marketplace Terms of Service**](https://flutterflow.io/tos-marketplace) before submitting your item. It may also be helpful to review our [**Legal Guidelines for Creators**](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators), which explain your legal responsibility in plain language. ::: ## How to Submit an Item An item can be an entire project (in the case of Temlate Apps or Libraries), a page or a component (in the case of Template Page & Components) or a Custom Function, Action or Widget (in the case of Custom Code). ### 1. Set your project as a Marketplace project Marketplace items should belong to projects that are specifically made to publish Marketplace items (i.e., they should not be inside of a production project). In order to submit an item, it must be inside of a project that has been Set For Marketplace. A project that is set for Marketplace can not be deployed. To set a project for Marketplace: 1. Prerequisite: please enroll as a Marketplace creator first by setting up a profile in [Marketplace](https://marketplace.flutterflow.io/profile). You can optionally also apply to become a paid creator, which allows you to monetize your items. 2. Select the [**Share Icon**](https://docs.flutterflow.io/flutterflow-ui/toolbar#share-project) from the Toolbar (top right side of the screen). Please note that you must be the project owner to see this icon and to submit an item. 3. Select **Create New Item > Set For Marketplace > Yes** :::tip You can also clone an existing project and then set it as a Marketplace Project. :::

### 2. Fill out the submission form Below is an overview of what is needed to create your Marketplace item: :::tip If you aren't ready to submit your item, select **Save As Draft** to continue editing your submission at a later time. ::: #### Cover Photo The cover photo should be **1200x800 pixels** and help the users understand the purpose of the item. GIFs are allowed but should not be distracting, focus solely on the use and/or usability of the template, and be highly optimized to ensure a smooth load on the platform. Please do not include the FlutterFlow Studio logo in your cover image. #### Gallery Photos (optional) Include up to 4 additional photos that showcase your item's features. GIFs are allowed but should not be distracting, focus solely on the use and/or usability of the template, and be highly optimized to ensure a smooth load on the platform. Each should be should be **1200x800 pixels**. #### Name The item name should be professional, unique, and help the users understand the purpose of the item. Please use correct grammar and capitalization. #### Description The description should provide an overview of the key features, helping users determine if the item aligns with their requirements. If the item includes any third-party paid services or pub.dev packages/dependencies, those should also be mentioned in the description. Please use correct grammar and capitalization. #### Usage Instructions Provide clear and concise instructions on how to implement and utilize your item within FlutterFlow Studio. Include any necessary steps, code snippets, or configurations required to get started. If your item depends on any third party services or pub.dev packages/dependencies, please provide full details of these including showing users where to find relevant API keys or more information. Please use correct grammar and capitalization. #### Marketplace Item Type Four types of items can be submitted: - Libraries - Template Apps - Template Page or Components - Custom Code **Libraries** Libraries allow you to share resources like API endpoints, UI components, custom data types, custom code, action blocks and more with complete version control. To submit a Library to the Marketplace, first publish your project as a Library. Note that there are some limitations on Library projects - most notably there is currently no support for Firebase or Pages. For more details, see the [documentation on Libraries](https://docs.flutterflow.io/resources/projects/libraries). :::note *Libraries* can be monetized. The minimum price for Libraries is $50. ::: **Template App** Template apps contain multiple screens. There are 2 sub-types: - **Full App:** an app with authentication, complete navigation, multiple pages/flows, database schema, complete action trees, etc. - **UI Kit**: purely design-based templates and layouts :::note *Template Apps* can be monetized. The minimum price for Full Apps is $400 while the minimum for UI Kits is $50. ::: **Page or Component** Pages or Components are assembled modules that can be used within FlutterFlow Studio. There are 2 sub-types: - **Page:** a single page in a FlutterFlow Studio project - **Component:** a reusable UI element that can be integrated into any part of your application :::caution *Pages and Components* cannot be monetized at this time. ::: **Custom Code** Custom Code is Dart code that can be used within FlutterFlow Studio projects. There are 3 sub-types: - **Custom Functions:** synchronous functions that do not have external dependencies. - **Custom Actions:** synchronous or asynchronous functions that may have external dependencies. If your action contains dependencies, please review our guide on [Open Source Licenses](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators). - **Custom Widgets:** user-defined Dart widgets that extend the capabilities of the standard FlutterFlow Studio widget collection. If your widget contains dependencies, please review our guide on [Open Source Licenses](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators). *Please note that each custom code item needs to be submitted separately.* :::caution *Custom Code* cannot be monetized at this time. ::: #### Template Tags (optional) Template tags help users sort and filter items. If the tags listed don't match your item, enter your desired search terms under *Keywords*. #### Supported Platforms You can submit Marketplace items for Android, iOS, and Web (or all three!). Please make sure to test on all supported platforms to ensure the item works without issues or errors. #### Run Mode URL A Run Mode link of your Marketplace allows users to better understand how your item looks and works. :::note If your Run Mode link includes authentication functionality, please add a demo login button that uses [**Anonymous sign-in**](https://docs.flutterflow.io/integrations/authentication/firebase/anonymous-login) or pre-fill demo credentials in the email and password inputs. ::: #### Documentation URL If there are complex installation or usage instructions, we highly recommend creating a documentation link for your Marketplace item. This can be written (e.g., Notion Doc, Google Doc) or video (e.g., YouTube, Loom). ### 3. Submit your item for review Once the Marketplace item submission form is complete, you can submit it for review. To submit a Marketplace item for review: 1. Fill out the items in the Marketplace Item Submission Form 2. Select **Submit For Approval** Your item will be shown in your [Dashboard](https://marketplace.flutterflow.io/dashboard) under **Created Items** as "Pending Approval": ![Item in "Pending Approval"](https://docs.flutterflow.io/assets/images/image-29405d90490c33329a3a9f9ed007ae4e.avif) ### 4. Edit an approved item :::note At this time, it is not possible to edit an approved Marketplace Item. We are working to add this functionality soon. ::: # Item Submission Criteria > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria Learn about marketplace item submission criteria. ## Item Submission Standards Below, you'll find the criteria our Submission Review Team uses to review items submitted to FlutterFlow Marketplace. ### 1. Originality and Ownership #### 1.1 Project Ownership - **Criteria:** You must own the rights to the project you submit. - **Why it Matters:** Only the original creator has the right to share and potentially sell their work. This ensures fairness, prevents unauthorized distribution, and protects intellectual property. - **What To Do:** - **If you're the sole creator:** Great! Make sure you're submitting the project from your own FlutterFlow Studio account. - **If you're collaborating:** The project owner should be the one to submit it to Marketplace. Discuss this with your collaborators beforehand. - **If you've acquired a project:** Ensure the original creator has officially [transferred ownership](https://docs.flutterflow.io/resources/projects/collaboration#transferring-project) rights to you. This may involve legal documentation, so it's important to handle it properly. #### 1.2 Significant Edits Made - **Criteria:** Projects must demonstrate a substantial amount of original work and editing. - **Why It Matters:** The Marketplace thrives on innovation and creativity. Minor cosmetic tweaks to existing projects don't offer the same value as fundamentally unique creations or heavily modified versions showcasing your distinct design and development skills. - **What To Do:** - **Highlight your modifications:** Clearly demonstrate the unique components, functionalities, or design choices you've implemented. - **Go beyond superficial changes:** If your modifications are primarily visual (e.g., color swaps, logo replacements), consider adding more substantive improvements. #### 1.3 Not Based on an Existing Marketplace Item - **Criteria:** Projects must not be direct derivatives of existing Marketplace items. - **Why It Matters:** Originality is key! Duplicating existing offerings diminishes the diversity and value of Marketplace. We want to empower users with a wide range of unique choices. - **What To Do:** - **Draw inspiration, don't duplicate:** While you can certainly learn from existing projects, aim to differentiate yours significantly. - **Add your own flavor:** Infuse your unique style, features, or functionalities to make the project distinctively yours. #### 1.4 Not Based on a Sample App - **Criteria:** Submissions should not be minimally modified versions of FlutterFlow Studio's provided sample apps. - **Why It Matters:** Sample apps are fantastic learning tools, but Marketplace items should showcase a higher level of complexity and original thought. - **What To Do:** - **Use sample apps as a foundation:** Treat them as a starting point. Experiment, expand, and transform them into something new. - **Demonstrate advanced skills:** Go beyond basic layouts and features; integrate custom code, complex animations, or add helpful API calls. #### 1.5 Original Project Content - **Criteria:** All project content—text, images, designs—must be original or appropriately licensed for commercial use. Please see [Legal Guidelines for Creators](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators) and [Navigating External Licenses](https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses) for more info. - **Why It Matters:** Using copyrighted material without permission can lead to legal issues and undermines the professional nature of Marketplace. - **What To Do:** - **Create your own assets:** This is the best way to ensure originality. - **Use royalty-free resources and properly licensed code:** Several websites offer high-quality, free-to-use assets. See also our guidance on [Open Source Licenses](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators#open-source-licenses). - **Purchase commercial licenses:** If you choose to use paid assets, secure the appropriate license for commercial distribution. This can be really tricky, so please review [Licenses from Other Marketplaces](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators#open-source-licenses) and [Navigating External Licenses](https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses). #### 1.6 No Library Dependencies (Libraries Only) - **Criteria:** Libraries cannot depend on other libraries. - **Why It Matters:** Dependencies between libraries create complexity in permissions management and version control, potentially leading to compatibility issues or broken functionality. - **What To Do:** - **Build Self-Contained:** Ensure your library contains all necessary functionality without requiring other libraries (from Marketplace or personal libraries). :::note When you publish a free item to Marketplace, you agree to license it under the [MIT License](https://opensource.org/licenses/MIT), which grants users perpetual rights to use, modify, and distribute the project. Paid items are subject to the license terms specified in our [Marketplace Terms of Service](https://www.flutterflow.io/tos-marketplace). While creators may remove their items from Marketplace at any time, this does not affect the rights of users who obtained the item while it was published - they retain their license rights according to the terms that were in effect when they acquired the item. Please review our [Legal Guidelines for Creators](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators) for more details about licensing and intellectual property rights. ::: ### 2. Metadata Clear, engaging, and accurate metadata helps users discover and understand the value of your project. #### 2.1 Submission in English - **Criteria:** All item metadata (title, description, tags, etc.) must be in English. - **Why it Matters:** To ensure a broad understanding among our global community, all Marketplace items must be in English. - **What To Do:** Use clear, concise English throughout your submission. If English isn't your first language, consider using FlutterFlow Studio's automatic [translation](https://docs.flutterflow.io/concepts/localization) feature. #### 2.2 Professional Title - **Criteria:** Your project title should be clear, concise, and free of grammatical errors. - **Why it Matters:** A strong title grabs attention and communicates the essence of your project at a glance. - **What To Do:** - **Keep it brief and impactful:** Aim for a title that's easy to remember and accurately reflects the core purpose of your project. - **Use relevant keywords:** This helps users find your project when searching on Marketplace. - **Proofread carefully:** Typos and grammatical errors create a negative first impression. #### 2.3 Unique Title - **Criteria:** Your title should be distinct from other items in Marketplace. - **Why it Matters:** A unique title helps your project stand out and prevents confusion among users. - **What To Do:** - **Research existing titles:** Before settling on a title, do a quick search to make sure it isn't already in use. - **Get creative with wording:** If you find similar titles, brainstorm alternative phrases or keywords that accurately describe your project's unique selling points. #### 2.4 Professional Description - **Criteria:** Your project description should be well-written, engaging, and free of grammatical errors. - **Why it Matters:** The description provides users with a deeper understanding of your project's features, benefits, and intended use cases. - **What To Do:** - **Start with a strong opening:** Capture attention from the start and clearly state what your project does. - **Highlight key features:** Use bullet points or formatting to make it easy to scan for important information. - **Focus on benefits:** Explain *why* someone would want to use your item – what problems does it solve or what opportunities does it unlock? - **Proofread meticulously:** Errors in grammar and spelling can make your project seem unprofessional. :::caution While tools like ChatGPT can assist in drafting content, they often generate generic text that might not fully capture the unique aspects of your project or could sound overly promotional and insincere. Always personalize and proofread AI-generated content to ensure it aligns with your item's features and capabilities. ::: #### 2.5 Accurate Description - **Criteria:** The description should accurately reflect the project's functionality and avoid exaggerating its capabilities. - **Why it Matters:** Misleading descriptions lead to negative user experiences. Transparency builds trust within Marketplace. - **What To Do:** - **Be truthful and transparent:** Clearly state what your project can and cannot do. - **Avoid hype and jargon:** Focus on clear, concise language that everyone can understand. Do not overpromise. #### 2.6 Third-Party Service Information - **Criteria:** If your project relies on any external services or APIs, you must disclose this information in the description. - **Why it Matters:** Transparency about potential additional costs or dependencies ensures users have all the information needed to make an informed decision before purchasing or cloning an item. - **What To Do:** - **List all external services:** Include the name of the service, its purpose within your project, and whether it requires a paid subscription or API key. - **Provide links (if applicable):** Direct users to relevant documentation or pricing pages for the third-party service. #### 2.7 Professional Instructions - **Criteria:** Instructions and documentation should be clear, easy to follow, and written in a professional tone. - **Why it Matters:** Well-written instructions ensure a smooth setup and implementation experience for users, increasing customer satisfaction. - **What To Do:** - **Assume no prior knowledge:** Write for someone who's completely new to your project and FlutterFlow Studio. - **Use numbered steps:** Break down complex processes into manageable, actionable steps. - **Include video links:** Use the documentation URL to point users to a visual video walkthrough. Alternatively, point users to a Google Doc or similar written documentation for your item. - **Test your instructions:** Have someone else follow your instructions to identify any points of confusion. #### 2.8 Accurate Tags - **Criteria:** Use relevant tags that accurately describe your project's category, features, and functionality. - **Why it Matters:** Tags play a crucial role in helping users discover your project through Marketplace search. - **What To Do:** - **Think like a user:** What keywords would someone use to search for a project like yours? - **Use a mix of broad and specific tags:** For example, use general tags like "e-commerce" or "social media" along with more specific ones like "shopping cart" or "user authentication". - **Don't use irrelevant tags:** This only makes it harder for users to find what they're looking for. #### 2.9 High-Quality Images - **Criteria:** Images should be visually appealing, high-resolution, and representative of the project's design and functionality. Cover images should be at least 1200 x 800 pixels and in 1.5 aspect ratio. - **Why it Matters:** Images are the first thing users see – make a great visual impression! - **What To Do:** - **Showcase key screens and features:** Select images that highlight the most visually impressive and important aspects of your project. - **Use high-resolution images:** Avoid blurry or pixelated images. - **Maintain a consistent style:** Use similar image dimensions and visual treatments to create a cohesive look. :::tip Use FlutterFlow Studio's [**screenshot generator**](https://docs.flutterflow.io/deployment/pre-checks-before-publishing#generate-screenshots) along with services like [**Shots.so**](https://shots.so/) to create beautiful cover images. ::: #### 2.10 Image Representativeness - **Criteria:** Images must accurately reflect the actual content and functionality of your project. - **Why it Matters:** Misleading images create a negative experience for users and erode trust in Marketplace. - **What To Do:** - **Use genuine screenshots or recordings:** Avoid showcasing designs or features that are not actually present in your project. - **Use abstract images sparingly:** While a certain level of abstraction or illustration can be effective for concepts that are hard to capture with screenshots, they should be used judiciously. Prefer to showcase actual product screenshots in your gallery images. #### 2.11 No FlutterFlow Studio Logo in Images - **Criteria:** Do not include the FlutterFlow Studio logo in your cover photos. - **Why it Matters:** Using the FlutterFlow Studio logo might suggest an official endorsement or the appearance of an official template, neither of which may be accurate. Additionally, including the logo is redundant, as all items are exclusively offered through the FlutterFlow Marketplace. - **What To Do:** Remove any references to the FlutterFlow Studio logo in your images. ### 3. Aesthetics & Design First impressions matter! We're looking for projects that go beyond basic functionality and demonstrate a strong understanding of visual design principles. #### 3.1 Design Standard - **Criteria:** Projects should adhere to high standards of visual design, incorporating principles of usability, accessibility, and aesthetics. - **Why it Matters:** A well-designed app is not just visually appealing; it's intuitive, easy to navigate, and provides a positive user experience. - **What To Do:** - **Prioritize usability:** Make sure your design choices support, rather than hinder, the core functionality of your app. - **Consider visual hierarchy:** Guide the user's eye with clear visual cues – size, color, contrast, and spacing can all be used effectively. - **Maintain consistency:** Aim to use a theme colors and typography throughout your project, as well as consistent padding, list spacing, border radii, and navigation elements. - **Test with real users:** Get feedback from others to identify any areas of your design that are confusing or frustrating to use. #### 3.2 Screen Size Compatibility (Responsiveness) - **Criteria:** Projects should be designed to adapt seamlessly to various screen sizes. - **Why it Matters:** Users expect Flutter apps to scale appropriately across a wide range of devices, from small smartphones to large desktop monitors. A responsive design ensures a positive user experience across the board. - **What To Do:** - **Follow responsive design best practices:** Use `Wrap`, Responsive Visibility, and Flex features to ensure your app can scale across devices. Read more about building responsively in [Responsive Layouts: 101](https://docs.flutterflow.io/concepts/layouts/responsive). - **Test on different devices:** Use FlutterFlow Studio's different virtual devices in Test and Run Modes to test your project on a variety of screen sizes. Experiment with the canvas size in the builder to check how your designs scale. ### 4. Test Experience A seamless and positive test experience is crucial for users to evaluate your FlutterFlow Studio item before purchasing or cloning. This section focuses on ensuring your submission is functional, accessible, and easy to explore. #### 4.1 Functional Run Mode Link - **Criteria:** The provided Run Mode link must be active and correctly load a working demo of your project. For mobile-only features or utility libraries that cannot be demonstrated in Run Mode's web environment, you must provide alternative demonstration methods. - **Why it Matters:** The Run Mode link is the primary way users can interact with your project before purchasing. A broken, inaccessible, or non-demonstrative link creates a significant barrier to understanding the item's value. - **What To Do:** - **For Standard Web-Compatible Items:** - Double-check your link before submitting to confirm it showcases the experience you want potential buyers to have. - Test the link multiple times to ensure consistent functionality. - **For Mobile-Only Features:** - Create a dedicated demonstration page in your project that explains the mobile-only functionality. - Include screenshots, videos, or mockups showing how the feature works on mobile devices. - Clearly indicate which features are mobile-only and why they cannot be demonstrated in Run Mode. - Optionally, provide a published FlutterFlow Studio web deploy link that can be used instead of the Run Mode URL. - **For Utility Libraries (e.g., Analytics, Background Services):** - Create a demonstration page that explains the library's functionality. - Show configuration options and expected outcomes. - Include visual aids like flowcharts or diagrams to explain the library's operation. - Provide example code or configuration snippets. - Consider adding debug/test outputs that demonstrate the library is working. - **Documentation:** - Regardless of the type of item, ensure your documentation clearly explains how to implement and test the functionality in a real mobile environment. - Include troubleshooting guides and common implementation scenarios. :::tip For items that cannot be fully demonstrated in Run Mode, focus on creating a clear, informative demonstration page that helps users understand the value and implementation of your item. Visual aids, clear explanations, and comprehensive documentation are key to helping users make informed decisions. ::: #### 4.2 User Sign-In (Anonymous Auth) - **Criteria:** Users should be able to explore the core functionality of your item *without* being required to create an account or log in. - **Why It Matters:** Requiring upfront authentication creates friction for users who simply want to try before they buy. Additionally, forcing users to provide personal information could cause privacy issues. Anonymous authentication allows for immediate exploration. - **What To Do:** - **Provide pre-filled demo credentials:** If your demo relies heavily on user-specific data, consider creating a demo account with pre-populated sample data accessible to guest users. Pre-fill the username and password on the sign in screen so that users can easily begin exploring your item. - **Implement anonymous authentication:** FlutterFlow Studio supports easy integration with Firebase for [anonymous sign-in](https://docs.flutterflow.io/integrations/authentication/firebase/anonymous-login). This allows users to access your project's demo mode without creating an account. - **Remove authentication:** Another option is to remove the need for any authentication altogether. This will enable users to start exploring your item immediately without any barriers. #### 4.3 Accessible Navigation - **Criteria:** All pages and sections within your project should be easily navigable and accessible. - **Why it Matters:** A confusing or broken navigation flow creates a frustrating user experience. Users should be able to intuitively explore all aspects of your project. - **What To Do:** - **Configure the Initial Page Properly**: In Settings > App Details, the 'Entry Page' determines the starting point for Run Mode links and the initial page users will see when they enter your app. Make sure this is set to the most logical and welcoming page to ensure a smooth user entry and navigation experience. - **Review your project's [Storyboard](https://docs.flutterflow.io/flutterflow-ui/storyboard) view:** This view displays the navigation across various pages and can help highlight any gaps. Please note that any page which is not accessible will not be shown. - **Test navigation thoroughly:** Click through *every* button, link, and menu item in Run Mode to make sure they lead to the correct destinations. #### 4.4 Functional Template - **Criteria:** All core features and functionalities within your project must be working correctly. - **Why it Matters:** Broken features or functionalities lead to a negative user experience and give the impression of a rushed or incomplete project. - **What To Do:** - **Rigorous testing is essential:** Test *every* aspect of your project – from button clicks and form submissions to API calls and animations. - **Emulate real-world scenarios:** Don't just test with ideal data or happy paths. Introduce potential edge cases or user errors to see how your project handles them. - **Get fresh eyes on it:** Ask someone unfamiliar with your project to test it and provide feedback. ### 5. Build Quality Building a solid app template goes beyond surface-level design. It's about creating a robust, efficient, and user-friendly project that can scale and makes efficient use of components. This section focuses on technical excellence and attention to detail. #### 5.1 Error-Free Functionality - **Criteria:** Projects should be free of runtime errors, crashes, and unexpected behaviors. - **Why it Matters:** Errors and crashes create a frustrating user experience and can damage the reputation of your project. - **What To Do:** - **Review project errors and optimizations:** Do not submit projects with any errors, and attempt to address most optimization suggestions in the top bar. - **Use FlutterFlow Studio's debugging tools:** Take advantage of FlutterFlow Studio's built-in debugging panel to identify and resolve issues. - **Handle nulls and errors gracefully:** Add default values for variables in case their value is ever `null`. Implement conditionals in action chains to respond appropriately to API errors or other cases when something goes wrong. #### 5.2 No Pixel Overflow - **Criteria:** Ensure your UI elements are positioned and sized correctly to avoid content overflowing its container, leading to visual glitches / cut off content. - **Why It Matters:** Pixel overflows are a sign of UI inconsistencies that can negatively impact the user experience, especially on different screen sizes. Pixel overflow issues can occur in Test Mode when there's a hardcoded pixel value and not enough space on the screen to render that exact value. - **What To Do:** - **Preview pixel overflows:** Toggle the pixel overflow icon in the top-right of the canvas to see if there are any overflow issues. - **Leverage FlutterFlow Studio's layout tools:** Use Expanded and Flex values to help prevent layout issues. Make `Columns` or `Rows` scrollable to prevent overflows. Use auto-sizing text or text clipping where it makes sense. Remove hard-coded width and height where it makes sense. - **Test on different screen sizes:** Resize the canvas while building to preview any potential issues. #### 5.3 Error-Free Custom Code - **Criteria:** Any custom code integrated into your project (using Custom Functions, Actions, and Widgets) must be free of syntax errors, logical errors, and potential security vulnerabilities. - **Why it Matters:** Errors in custom code can lead to app instability, crashes, or even security risks. - **What To Do:** - **Write clean, well-documented code:** This makes it easier to debug and maintain your project. - **Test custom code thoroughly:** Isolate and test your custom code units (functions, actions) to ensure they work as expected. - **Use FlutterFlow Studio's code validation:** Pay close attention to any warnings or errors highlighted by FlutterFlow Studio's built-in code validation. #### 5.4 Coherent & Relevant Custom Code - **Criteria:** Custom code should be purposefully integrated and enhance your project's functionality in a meaningful way. Avoid unnecessary or redundant code. Avoid including unused or irrelevant custom code. - **Why it Matters:** While custom code offers flexibility, excessive or poorly integrated code can make your project harder to understand, maintain, and update in the future. - **What To Do:** - **Plan your custom code strategically:** Determine if FlutterFlow Studio's built-in features can achieve the desired functionality before resorting to custom code. - **Comment your code effectively:** Explain the purpose and logic behind your custom code to improve readability and maintainability. - **Keep it modular:** Break down complex logic into smaller, reusable functions or actions. Prefer code blocks when a Custom Function is relatively short and will only be used once. #### 5.5 Testable Custom Code in Run Mode - **Criteria:** Ensure that the functionality implemented using custom code is accessible and verifiable within the Run Mode demo. - **Why It Matters:** Users should be able to experience the full impact of your custom code item within the Run Mode environment. - **What To Do:** - **Add a page that uses your custom code:** This page should ideally expose the ideal use case of your custom code or perhaps allow users to set and control parameter values in Run Mode. - **Provide clear instructions:** If special steps are required for users to test certain custom code functionalities in Run Mode, explain these instructions clearly within your project description or documentation. #### 5.6 Proper Firestore Rules (If Applicable) - **Criteria:** If your project utilizes Firestore as a database, ensure your Firestore Security Rules are correctly configured in Settings to protect user data and prevent unauthorized access. - **Why it Matters:** Improperly configured Firestore Rules can expose sensitive user data or create security vulnerabilities within users' apps. - **What To Do:** - **Implement Firestore Security Rules:** Familiarize yourself with how FlutterFlow Studio exposes [Firestore rules](https://docs.flutterflow.io/integrations/database/cloud-firestore/firestore-rules) and make the necessary modifications in your base project. - **Test your rules thoroughly:** Create test accounts and attempt add, update, and delete operations on your data across different authentication states to verify your rules are working as intended. #### 5.7 Spelling and Grammar - **Criteria:** Maintain a professional tone with correct spelling and grammar throughout your project's UI text, descriptions, and documentation. - **Why it Matters:** Even small typos can detract from your project's credibility and create a negative user experience. - **What To Do:** - **Proofread, proofread, proofread:** Carefully review all text elements within your project. Ask a friend or colleague to review your text for errors. #### 5.8 User-Friendly Template - **Criteria:** Your template should empower users to build upon it easily and intuitively, regardless of their FlutterFlow Studio expertise. - **Why It Matters:** A user-friendly template increases its value and appeal. When users can quickly understand and customize your template, they're more likely to choose it, leading to greater success for your Marketplace item. - **What To Do:** - **Embrace reusable components:** Design your template with modularity in mind. Create reusable components that users can easily modify for their use case. - **Clear and concise naming conventions:** Use descriptive names for widgets, variables, and functions to make your template's structure understandable at a glance. - **Logical organization:** Structure your template's layout in a clear and logical manner, grouping related elements and using comments to guide users. - **Documentation is key:** Provide clear and comprehensive documentation that guides users on how to use and customize your template effectively. Include explanations of key features, customization options, and potential use cases. - **Test with diverse users:** Get feedback from users with varying levels of FlutterFlow Studio experience. This helps identify potential pain points or areas where your template could be more user-friendly. #### 5.9 Appropriate State Management - **Criteria:** Implement state management effectively to ensure data is updated and reflected correctly across your application. - **Why it Matters:** Proper state management is crucial for building responsive and dynamic Flutter apps. It helps prevent data inconsistencies, improves performance, and makes your code easier to maintain. - **What To Do:** - **Choose the right state management scope:** FlutterFlow Studio supports (1) [App State](https://docs.flutterflow.io/resources/data-representation/app-state) (2) [Page State](https://docs.flutterflow.io/resources/ui/pages/page-lifecycle#page-state) and (3) [Component State](https://docs.flutterflow.io/resources/ui/components/component-lifecycle#creating-a-component-state) variables. Familiarize yourself with these options and scope any state variables to where they are needed. For instance, do not use App State to control the value of a checkbox within a component. - **Rebuild efficiently:** Ensure changes to state rebuild only the necessary scope for efficiency. #### 5.10 Organized Widget Tree - **Criteria:** Maintain a well-structured and organized widget tree within your FlutterFlow Studio project. - **Why It Matters:** A clean and organized widget tree makes your project more understandable, maintainable, and less prone to errors. It also makes it easier for others to collaborate on your project. - **What To Do:** - **Use descriptive names for widgets and variables:** Make your code self-documenting by using clear and meaningful names for major nodes. - **Avoid deeply nested widgets:** If your widget tree becomes too deeply nested (>10 levels), consider breaking it down into smaller, reusable [components](https://docs.flutterflow.io/resources/ui/components). #### 5.11 Follow FlutterFlow Studio Best Practices - **Criteria:** Adhere to recommended best practices and guidelines for building apps with FlutterFlow Studio. - **Why It Matters:** Following best practices can help you avoid common pitfalls, improve the performance of your app, and ensure your project is compatible with future updates to FlutterFlow Studio. - **What To Do:** - **Stay up-to-date:** Keep an eye on FlutterFlow Studio's official documentation, blog posts, and community forums for the latest tips, tricks, and best practices. :::note Stay tuned for an upcoming "style guide" we're publishing that goes into deeper detail about best practices for building in FlutterFlow Studio. ::: #### 5.12 Limit Static Images - **Criteria**: Minimize the use of large, unoptimized static images within your project to prevent app bloat and ensure that your template accurately represents the functionality of your app. - **Why It Matters**: Overusing large static images not only increases the download size and slows down performance, particularly on slower networks, but also risks misleading users. For example, using an image of a map or a credit card form, rather than building these elements, can give the false impression that your app includes functionalities that are merely visual mockups. This can disappoint users when they discover these components are non-interactive. - **What To Do**: - **Build Functional Components**: Wherever possible, replace static images with functional elements built using FlutterFlow Studio. This ensures your app remains scalable and interactive, providing a genuine user experience across all device sizes and orientations. - **Use optimized images**: Reduce image file size using online compression tools, which maintain quality while decreasing load times. - **Leverage caching**: Implement image caching for network images to minimize repeated downloads of the same images, which enhances performance. #### 5.13 Limit Custom Code (When Possible) - **Criteria:** While custom code is powerful, strive to achieve as much functionality as possible using FlutterFlow Studio's visual builder and built-in features. - **Why It Matters:** Over-reliance on custom code can make your project less maintainable, less user-friendly, and potentially more prone to errors. - **What To Do:** - **Explore FlutterFlow Studio's capabilities:** Familiarize yourself with FlutterFlow Studio's extensive library of pre-built widgets, actions, and integrations to see if they can fulfill your requirements before resorting to custom code. #### 5.14 Efficient Component Use & Avoiding Duplication - **Criteria:** Projects should demonstrate efficient use of FlutterFlow Studio's components. Avoid unnecessary duplication of pages, widgets, or actions. Strive to create reusable components and implement action blocks in a scalable and maintainable way. - **Why it Matters:** Duplicating large sections of code or entire pages with only minor changes bloats the project size, reduces maintainability, and can mislead users about the project's complexity and value. - **What To Do:** - **Leverage Components:** Create reusable components for elements that repeat throughout your project (e.g., product cards, list items, headers, footers). - **Utilize Parameters:** Pass data and customize component instances using parameters instead of duplicating and hardcoding values. - **Review for Redundancies:** Before submitting, carefully examine your project for any unnecessarily duplicated pages, widgets, or action chains that could be consolidated or streamlined. #### 5.15 Library Values Implementation (Libraries Only) - **Criteria:** Libraries must use [Library Values](https://docs.flutterflow.io/resources/projects/libraries) for sensitive keys and customizable elements that users need to configure. - **Why It Matters:** Library Values allow users to safely provide their own API keys and customize critical configuration without modifying the library's core functionality. This improves security and makes libraries more flexible and reusable. - **What To Do:** - **Identify Configurable Elements:** Review your library for any API keys, endpoints, or other values that users should be able to customize. - **Create Library Values:** Set up Library Values for these configurable elements in Settings > App Settings > Publish as Library. - **Document Requirements:** Clearly explain in your item description if any Library Values are required for your library to function correctly. - **Test Configuration:** Verify that your library functions correctly when Library Values are changed by users. #### 5.16 Automated Tests (Strongly Recommended) - **Criteria:** Projects should include automated tests that verify core functionality and key user workflows. While not required for approval, this is strongly recommended for libraries and will positively impact visibility. - **Why It Matters:** Automated tests help ensure reliability, catch regressions, and demonstrate your commitment to quality. They also improve your item's visibility. - **What To Do:** - **Add Integration Tests:** Use FlutterFlow Studio's [automated testing](https://docs.flutterflow.io/testing/automated-tests) features to verify your item's core functionality. - **Test Key Workflows:** Focus on testing critical user paths and features that users will rely on. - **For Libraries:** Since libraries are often used as building blocks in larger applications, thorough testing is particularly important to: - Verify that Library Values are properly implemented - Ensure core functionality works across different configurations - Demonstrate expected behavior to potential users - Catch issues before they affect downstream applications ### 6. Value (Paid Items) A successful Marketplace item goes beyond just a functional app—it provides real value to users. #### 6.1 High Value Proposition - **Criteria:** Items should offer a compelling value proposition that justifies their price. - **Why It Matters:** Users are looking for solutions that save them time, effort, or resources, or that provide a unique experience they can't easily find elsewhere. - **What To Do:** - **Define Your Unique Value**: Identify and articulate what sets your project apart from others. Ensure it solves a specific problem in a way that is not readily available in Marketplace. - **Tag Appropriately**: Accurately categorize your item—whether it's a full app, UI kit, or library—to set the right expectations for potential users. - **Justify Your Pricing**: Make sure the pricing of your item reflects its true value and stands in fair comparison to similar offerings. Ensure it offers enough depth and uniqueness to warrant the minimum price point. - **For Paid Libraries**: Libraries should excel in at least one of these areas: - 🧘 Simplifying technical complexity (ease) - ⚡️ Enabling quick and seamless integrations (speed) - 🎛️ Offering diverse reusable components and features (quantity) - 🛠️ Providing robust, reliable functionality (quality) - 🙋‍♂️ Addressing specific, high-demand use cases with thoughtful solutions (relevance) ### 7. Legal & Security Building trust in the FlutterFlow Marketplace requires respecting legal boundaries and safeguarding user information. This section covers essential considerations to ensure your project adheres to ethical and legal standards. #### 7.1 Free of Inappropriate Content - **Criteria:** Projects must not contain any offensive, discriminatory, or illegal content. This includes, but is not limited to: - Hate speech or discrimination - Sexually explicit material or pornography - Content that promotes violence, illegal activities, or harm to others - **Why it Matters:** Maintaining a safe and inclusive community is paramount. Inappropriate content violates the [FlutterFlow Studio Terms of Service](https://flutterflow.io/tos) and may have legal ramifications. - **What To Do:** - **Review your content carefully:** Ensure all text, images, and other assets align with community standards and legal guidelines. - **Err on the side of caution:** When in doubt, it's best to avoid potentially controversial content. #### 7.2 Free of Copyrighted Material - **Criteria:** Projects must not include any unauthorized use of copyrighted material, such as: - Images, illustrations, or graphics - Music or sound effects - Code snippets or libraries — see our docs on [Open Source Licenses](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators#open-source-licenses) for details - **Why it Matters:** Using copyrighted material without permission is a legal infringement and can result in serious legal consequences, including [DMCA takedown](https://docs.flutterflow.io/marketplace/creators-hub/copyright-dmca-process). - **What To Do:** Please review our [Legal Guidelines for Creators](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators) and [Navigating External Licenses](https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses) for more details. #### 7.3 Free of Trademarked Material - **Criteria:** Items must not misuse or infringe upon registered trademarks, including: - Brand names - Logos - Slogans - **Why it Matters:** Trademark infringement can lead to legal disputes and damage the reputation of FlutterFlow Marketplace. Please see our [Legal Guidelines for Creators](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators) for more details. - **What To Do:** Please review our [Legal Guidelines for Creators](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators) for more details. #### 7.4 Free of Confidential Data - **Criteria:** Projects should not expose any sensitive or confidential information, including: - API keys - User credentials - Personal data (e.g., names, addresses, financial information) - **Why it Matters:** Exposing confidential data can compromise the security of your project and put users at risk. - **What To Do:** - **Follow [API Key Best Practices](https://docs.flutterflow.io/best-practices/secure-api-keys):** Add restrictions, delete unnecessary API keys, and regularly rotate your keys to ensure keys are secured. - **Require users to provide their own API keys:** Use ephemeral, user-provided API keys in calls rather than hardcoding your own keys directly into code. - **Scrub your project before submission:** Double-check your project files and codebase to ensure no confidential information is accidentally included. ## Common Rejection Reasons To help streamline your submission process, here are some of the most frequent reasons projects are flagged: - [**Lack of Anonymous Authentication**](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria#42-user-sign-in-anonymous-auth): Make it easy for users to test your project without requiring logins. - [**Unclear Usage Instructions**](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria#27-professional-instructions): Provide detailed, step-by-step guidance on how to use and customize your template. - [**Image Issues**](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria#29-high-quality-images): Ensure images are high-resolution, sized appropriately, and don't include the FlutterFlow Studio logo. - [**Poor Widget Tree Organization**](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria#510-organized-widget-tree): Utilize components and naming effectively to create a clean, well-structured project. - [**Use of Copyrighted Assets**](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria#72-free-of-copyrighted-material): Only include assets that you have created or have the legal right to use commercially. - [**Library Dependencies**](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria#515-library-values-implementation-libraries-only): Libraries cannot currently depend on other libraries from Marketplace. We're excited to see the amazing FlutterFlow Studio projects you bring to Marketplace! By following these guidelines, you'll help us maintain a high-quality platform that benefits the entire FlutterFlow community. **Let's build something incredible together!** 🚀 # Legal Guidelines for Creators > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators Understand the legal guidlines for creating marketplace items. As part of our creative community, your contributions are invaluable in helping others build amazing apps. To ensure a smooth experience for everyone and to adhere to legal requirements, we've outlined what types of content you can publish on Marketplace. This guide is designed to be user-friendly and straightforward, focusing on the legal aspects of your submissions. For a more detailed view of our policies, please review the [Marketplace Terms of Service](https://flutterflow.io/tos-marketplace). ### What You Can Submit - **✅ Original Creations:** Your template should be your original work or properly licensed work that you have the right to distribute. Whether it’s a unique design layout, a functional module, or an innovative app solution, if you created it, we're excited to see it! - **✅ API Wrappers**: If you've developed a wrapper for public APIs (like AWS or SendGrid), you're welcome to submit it! Ensure your wrapper adds value through simplification, integration, or enhancement of the original API functionalities. - **✅ Educational Templates**: Educational or demonstrative templates that mimic functionalities of popular apps (like a "social photo app clone") are great for learning and are welcome, provided they do not use any trademarked names, logos, or proprietary UI elements from the actual apps. ### What to Avoid in Your Submissions - **❌ Designs from External Marketplaces:** Please refrain from submitting designs or templates that you've acquired from other marketplaces. Typically, these items are licensed, not sold, and come with restrictions that prohibit their redistribution on our platform. For guidance on navigating external licenses and understanding your rights, please review [Navigating External Licenses](https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses). - **❌ Proprietary Code or Data**: Do not include any proprietary code, data, or APIs that you do not have explicit rights to use and redistribute. This includes direct copies of proprietary software or use of internal SDKs not intended for public distribution. - **❌ Trademarked Material Without Permission**: Avoid using trademarked names, logos, or branding elements in your templates unless you have obtained explicit permission from the trademark owner. This includes mimicking the UI of a proprietary app exactly. - **❌ Misleading Content**: Ensure your template does not mislead users into thinking it's officially affiliated with or endorsed by any brand or service it might resemble, especially in educational or demonstrative templates. ### Best Practices for Template Submission - **✍️ Clear Attribution**: If your template includes third-party open-source components, ensure you comply with their licenses by properly attributing the original creators and including any required license texts or notices. Also see [Open Source Licenses](https://docs.flutterflow.io/marketplace/creators-hub/legal-guidelines-for-creators#open-source-licenses). - **💎 Use Generic Elements**: For educational or demonstrative templates, use generic names and design elements to avoid trademark issues while still providing valuable learning experiences. - **⚖️ Include Disclaimers**: When necessary, include disclaimers clarifying the purpose of your template, especially if it's for educational use, to avoid any potential confusion about its unofficial status. - **📣 Stay Informed**: Licenses and legal requirements can change, so it's crucial to stay informed about the legal aspects of the components and APIs you use in your templates. ## Licenses: What's Allowed? ### Open Source Licenses Embracing open-source is part of our ethos, but not all licenses are created equal, especially in a commercial setting like ours. Here's a quick rundown of what fits on Marketplace: - **✅ Permissive Licenses**: Licenses such as MIT, BSD, and Apache 2.0 are generally fine because they allow commercial use and modification with minimal restrictions. Just make sure to give proper credit and include the original license text as required. - **🤔 Copyleft Licenses (Caution!)**: Licenses like GPL (General Public License) can be tricky. They often require derivative works to be distributed under the same license, affecting how your template can be used. If you're considering using GPL-licensed code, please review the specific terms carefully or consult with legal advice to ensure compliance. - **❌ No Unlicensed Code**: Ensure all open-source code used in your templates is properly licensed. Using unlicensed code or failing to comply with open-source license requirements can lead to legal headaches for you and for us. ### Licenses from Other Marketplaces We understand that inspiration can come from lots of different sources, including other marketplaces. However, it's important to respect legal and ethical standards, especially with the reuse of design elements and templates purchased elsewhere. Here’s what you should know: - **🤝 Ownership and Licensing**: When you purchase a design or template from other marketplaces, you're typically acquiring a license to use that item, not owning it outright. These licenses often come with significant restrictions, particularly around redistribution and creating derivative works meant for resale. It’s best to carefully review the license terms for each item and marketplace you use. See [Navigating External Licenses](https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses) for some examples. - **⚠️ End Products and Redistribution**: Most marketplace licenses restrict the use of their items as part of an “end product” that is not meant for redistribution or resale. For example, using a downloaded Figma design to create a template that you then sell on FlutterFlow Marketplace may violate the original marketplace's license terms, even under extended licenses. When in doubt, ask the original content provider. Obtaining explicit permission or clarification can prevent future disputes and legal challenges. - **Clarifications and Examples**: - **❌ Likely Prohibited**: Using a UI design purchased from another marketplace to create a FlutterFlow Studio template that you intend to distribute or sell. - **✅ Allowed**: Creating a template inspired by design principles or trends you've observed, without directly copying or adapting a purchased item. - **✅ Allowed**: Implementing a UI design with the explicit written permission from the author and owner of that design. For more details and examples, please review: [Navigating External Licenses](https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses) ## Item Reports and Complaints At FlutterFlow Studio, we're committed to maintaining a respectful and legally compliant community. We understand that there may be instances where content on FlutterFlow Marketplace may infringe on your rights or violate our policies. To address these concerns, we've established a straightforward process for filing complaints, including DMCA requests and other legal concerns. ### Reporting an Item We encourage our community members to resolve disputes amicably whenever possible. For details on contacting creators, reporting items, rating items, and filing a DMCA notice, please visit the following page. [Submitting Feedback for Items](https://docs.flutterflow.io/marketplace/submit-feedback) ### Responding to Item Reports When you receive a report about an item you've listed on FlutterFlow Marketplace, it's important to respond promptly and thoughtfully. We've put together a breakdown of our process for responding to DMCA and other infringements here: [Copyright (DMCA) Process](https://docs.flutterflow.io/marketplace/creators-hub/copyright-dmca-process) Our goal is to foster a creative, respectful, and lawful environment for all users. By following these steps, you help us achieve this goal and ensure FlutterFlow Studio remains a platform where innovation thrives within the bounds of respect and legality. For further assistance or questions, please contact [marketplace-legal@flutterflow.io](mailto:marketplace-legal@flutterflow.io). # Copyright (DMCA) Process > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/creators-hub/copyright-dmca-process Understand the copyright (DMCA) process on FlutterFlow Marketplace. :::danger This guide is meant for creators of items on FlutterFlow Marketplace. If you want to provide feedback on an item published in FlutterFlow Marketplace, please follow the relevant instructions at [**Submitting Feedback for Items**](https://docs.flutterflow.io/marketplace/submit-feedback). ::: As a valued creator on the FlutterFlow Marketplace, it's important to understand the process that unfolds when an item you've submitted receives an infringement report. Our approach distinguishes between two main types of allegations: DMCA infringement claims and other types of infringement allegations. ### DMCA Infringement Claims The [DMCA (Digital Millennium Copyright Act)](https://en.wikipedia.org/wiki/Digital_Millennium_Copyright_Act) is a US copyright law that provides a mechanism for copyright owners to request the removal of content they believe infringes on their copyright. Here's how we handle these specific claims: 1. **Immediate Action**: If an infringement report is classified as a DMCA claim and the reporter provides adequate proof of ownership or authorized representation, we are legally required to act quickly. In such cases, the reported item is immediately removed from FlutterFlow Marketplace. 2. **Notification Email**: Upon removal, you will receive an email notification outlining the details of the claim and the steps you can take if you believe the item was wrongly removed. 3. **(Optional) Counter-Notice**: If you choose to submit a counter-notice, we will provide guidance on the process. Please email [marketplace-legal@flutterflow.io](mailto:marketplace-legal@flutterflow.io) with any relevant details. ### Other Infringement Allegations For other infringement reports, specifically those filed by individuals who are neither the copyright owner nor their authorized representatives, we follow a different process: 1. **Credibility Review:** Our team will first assess the credibility of the report. We will engage with the reporter to gather additional information if the initial claim lacks sufficient detail. If we determine the claim appears credible, we will then proceed to notify you the creator. 1. *Evidence of Prior Publication:* In cases where an infringement allegation is supported by a URL linking to similar content that was clearly published prior to the date of submission on FlutterFlow Marketplace, this URL will be considered sufficient preliminary evidence to establish the credibility of the claim. 2. **48 Hours Notice:** When we receive a non-DMCA allegation that is deemed credible after our initial review, we will notify you and provide a 48-hour period for you to respond to the claim. This window allows you to present any counter-evidence or resolve the issue by modifying or removing the item yourself. 3. **Review of Evidence**: If you provide evidence or make changes that address the report's concerns, we will review this new information before making a final decision on the item's status in Marketplace. 4. **Resolution**: If, after reviewing the evidence, the claim is found to be credible, or if no response is received within the 48-hour window, we will proceed with removing the item from Marketplace and inform you of the action taken. # FlutterFlow Marketplace Review Dispute Guidelines > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/creators-hub/review-dispute-guidelines Learn about FlutterFlow Marketplace review dispute process and when reviews may be removed or modified. At FlutterFlow Marketplace, we believe in transparent and honest feedback. Reviews are an essential part of helping buyers make informed decisions and helping creators improve their work. However, not all reviews are created equal. Sometimes feedback is based on misunderstandings, irrelevant factors, or issues unrelated to the quality of the item itself. This guideline outlines when and how we handle review disputes. ### Criteria for Removing a Review We may remove a review if it meets **one or more** of the following criteria: - **Spam or Abuse:** The review contains offensive language, harassment, or unrelated spam content. - **Misuse of the Review System:** The review is about unrelated topics (e.g., FlutterFlow Studio features, pricing, unrelated bugs). - **Critical Misunderstanding:** The review is based on a clear misunderstanding of the item's purpose or scope, despite the listing being accurate and transparent. - **Irrelevant to the Current Version:** The review references issues that have since been resolved, and the creator has updated the item significantly. :::note We may remove outdated reviews in cases where leaving them would misrepresent the current product. ::: ### Reviews That Meet Our Standards We **will not remove** a review just because it is negative if it: - Represents a real user experience - Critiques the item's quality, usability, documentation, or performance in good faith - Highlights friction that future buyers may encounter, even if subjective ### How to Dispute a Review If you believe a review on your item qualifies for removal: 1. **Contact Us:** Email [marketplace@flutterflow.io](mailto:marketplace@flutterflow.io). 2. **Include:** - A link to the item and review - A short explanation of why you believe it qualifies for removal :::note[Decision] Our team will review each case individually and respond within **10 business days**. Please note we are actively working on better creator tools to allow creators to reply directly to reviews. ::: # Navigating External Licenses > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/creators-hub/navigating-external-licenses Understand the key concepts that will assist you in creating unique and compliant content for FlutterFlow Marketplace. We know navigating the world of licenses and copyright rules can be a bit daunting, so we’ve put together this guide to help simplify things for you. Here, we’ll cover some of the most common licensing terms you’ll encounter and explain key concepts that will assist you in creating unique and compliant content for FlutterFlow Marketplace. Keep in mind that while we aim to highlight the most prominent licenses, it’s crucial to always check the most recent and applicable license terms for any assets you plan to use. If you’re ever unsure, please consult the relevant content provider or original author. ### Key Terms **"Derivative Work"** The term **Derivative Work** refers to any new creation that incorporates a copyrighted asset in a form that is still closely related to the original. Most licenses, especially in digital marketplaces, prohibit using assets to create derivative works that are then sold as standalone products or used as base templates in a marketplace. This means you cannot take a design template, make minor adjustments, and resell it as your own template. The creation of derivative works generally requires significant transformation of the original asset, ensuring the final product is distinct enough to not merely be a slight variation of the original. **"End Product"** Some licenses may permit “unlimited end products”. However, it's important to understand that this typically refers to the ability to create multiple final projects using the original asset as long as each project remains within the terms set out by the original license. An **End Product** is a final, functional, and complete creation that is built from the initial resources but is substantially different from them. In the context of app development, an end product is typically the final app delivered to users, *not an app template* intended for further development or resale. ### License Examples As seen from the licensing terms of platforms like UI8, Envato, Creative Market, and Canva, there are clear restrictions against using their items directly or in slightly modified forms as base materials for creating new FlutterFlow Marketplace items. This practice could violate copyright laws and the specific licensing agreements set by these platforms. **UI8** **License Terms:** https://ui8.net/licensing **Relevant Products:** [All Access Pass](https://ui8.net/products/all-access-pass) (Basic, Elite, and Lifetime) **Excerpt** *(as of April 22, 2024)* > [You cannot] make a theme, template or derivative work of any product to sell on any marketplace. **hi** **Legal Contact:** [legal@ui8.net](mailto:legal@ui8.net) --- **Result:** ❌ Not allowed to use in creating FlutterFlow Marketplace template **Envato** **License Terms:** https://elements.envato.com/license-terms and https://codecanyon.net/licenses/terms/extended **Relevant Products:** [Envato Elements subscription](https://elements.envato.com/pricing) Also, individual items sold on: - CodeCanyon: https://codecanyon.net/ - ThemeForest: https://themeforest.net/ - VideoHive: https://videohive.net/ - AudioJungle: https://audiojungle.net/ - GraphicRiver: https://graphicriver.net/ - PhotoDune: https://photodune.net/ - 3DOcean: https://3docean.net/ **Excerpts** *(as of April 22, 2024)* > You can’t re-distribute the Item as stock, in a tool or template, or with source files. You can’t do this with an Item either on its own or bundled with other items, and even if you modify the Item. You can’t re-distribute or make available the Item as-is or with superficial modifications. > > You can’t use the Item in any application allowing an end user to customise a digital or physical product to their specific needs, such as an “on demand”, “made to order” or “build it yourself” application. You can use the Item in this way only if you purchase a separate license for each final product incorporating the Item that is created using the application. > **Legal Contact:** [legal@envato.com](mailto:legal@envato.com) --- **Result:** ❌ Not allowed to use in creating FlutterFlow Marketplace template **Creative Market** **License Terms:** https://creativemarket.com/licenses/terms/general#extended-commercial **Relevant Products:** [Membership](https://creativemarket.com/membership) with Extended Commercial License **Excerpt** *(as of April 22, 2024)* > Resale or Sub-Licensing of the Licensed Asset or any modification of it in a way that is directly competitive with the original Licensed Asset is strictly prohibited (e.g., as a stock asset or template). > **Legal Contact:** [ip@creativemarket.com](mailto:ip@creativemarket.com) --- **Result:** ❌ Not allowed to use in creating FlutterFlow Marketplace template **Canva** **License Terms:** https://www.canva.com/policies/content-license-agreement/ **Relevant Products:** [Canva Pro](https://www.canva.com/pro/) (with Pro Content license) **Excerpt** *(as of April 22, 2024)* > Unless it’s a template created for use on Canva, you can’t use Pro content in templates of any nature. > **Legal Contact:** [legal@canva.com](mailto:legal@canva.com) --- **Result:** ❌ Not allowed to use in creating FlutterFlow Marketplace template ### Securing Explicit Permissions In situations where standard licensing does not meet the specific needs of your project or where the terms seem restrictive, **obtaining explicit permission from the original content creators can be a viable solution.** This allows for flexibility and ensures that your use of the assets is legally sound. We encourage reaching out directly to copyright holders whenever you are considering uses that are not clearly allowed under the standard license terms. Documenting such permissions in writing is essential to avoid any future misunderstandings or legal disputes. # Creator FAQs > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/marketplace/creators-hub/creator-faqs Learn about creator's FAQs in FlutterFlow Marketplace. ## ⚖️ Intellectual Property and Legal Concerns ### Why might my item be removed from Marketplace? Your item might be removed from the Marketplace under several circumstances, mainly related to legal and quality standards. Here are the specific reasons: - **DMCA Takedown Notices:** If we receive a DMCA takedown notice claiming that your item infringes on someone else's copyright, we are legally required to remove the item immediately. We will notify you of the takedown, and you will have the opportunity to respond or counter-claim according to the legal processes set out by the DMCA. Please see [Copyright (DMCA) Process](https://docs.flutterflow.io/marketplace/creators-hub/copyright-dmca-process) for details. - **Other IP Violations:** If your item is found to violate IP laws outside of a formal DMCA complaint—i.e. if filed by someone other than the original author or their representative—we will inform you of the specific violation. You will be given a chance to provide proof of licensing or to correct the issue within **48 hours**. If satisfactory proof or corrections are not provided, the item may be removed to comply with legal standards. Please see [Copyright (DMCA) Process](https://docs.flutterflow.io/marketplace/creators-hub/copyright-dmca-process) for details. - **Violation of Marketplace Policies:** Aside from copyright issues, if your item violates other Marketplace policies, such as those related to quality, accuracy, or ethical standards, you will be notified of the specific issues. We will provide you with details about the violation and, depending on the severity, you may be asked to modify the item or it might be removed. Please see [Marketplace Item Submission Guidelines](https://flutterflow.io/flutterflow-marketplace-item-submission-guidelines) for more details. - **Critical Item Reports:** If we receive reports from users or other creators that critically challenge the legality or appropriateness of your item (e.g., reports of plagiarism, false advertising, or severe quality issues), these will be thoroughly investigated. Based on the findings, and in accordance with our commitment to maintaining a trustworthy and high-quality Marketplace, your item might be subject to removal. We will communicate with you throughout this process, offering details of the report and an opportunity to respond. ### Will I be notified if my item is removed from Marketplace? Yes, in all cases, you will be notified if your item is removed from FlutterFlow Marketplace. ### Can I list my item on other marketplaces? No. You cannot sell FlutterFlow Studio projects on other marketplaces. Please see the non-circumvention clause in our [Marketplace Terms of Service](https://flutterflow.io/tos-marketplace). This policy helps ensure that all interactions with FlutterFlow Studio templates are safe, compliant, and effectively managed for our users. ### What licenses are granted to users of my item? When users purchase or add items from the FlutterFlow Marketplace, they are granted use under specific licenses: - **Free items** are generally covered under the **MIT License (Open Source License)**, which allows extensive freedom to use, modify, and redistribute the content. - **Paid items** are usually governed by **Single Use License.** Please refer to the specific restrictions and conditions outlined in our [Marketplace Terms of Service](https://flutterflow.io/tos-marketplace) for each license type. ### What if someone copies my template code or design? Please reach out to [marketplace-legal@flutterflow.io](mailto:marketplace-legal@flutterflow.io) for next steps. ## 🚨 Reporting Process ### What happens if someone reports my item? :::note We will always notify you if your item is removed from Marketplace. ::: If the reporter is the original author and files a DMCA notice, the item will be removed immediately as required by law. You will be notified and have the opportunity to submit counter-evidence. Please see [Copyright (DMCA) Process](https://docs.flutterflow.io/marketplace/creators-hub/copyright-dmca-process) for details. For other reports, we will notify you **48 hours** before taking any action. During this time, you may submit counter-evidence or clarify the situation. ### If my item is reported, what details will you share with me? When your item is reported, our goal is to maintain transparency while respecting privacy and legal constraints. Here’s what we will share with you: - **Report Type:** We will inform you about the specific nature of the complaint, such as whether it’s a copyright or quality issue. - **Relevant Details:** We will provide any non-confidential details submitted within the report that you need to understand the complaint and to formulate your response. - **Deadlines:** We will inform you of any deadlines by which you need to respond or take corrective action to avoid having your item removed from Marketplace. Please note that we will not share the identity of the reporter. ### If my item is reported, what details will you share with the original reporter? When a report is filed, we ensure that the process is fair and respects the privacy of all parties involved. Here’s what we will share with the original reporter: - **Confirmation of Report:** We will acknowledge receipt of their report and confirm that we are taking it seriously. - **Contact Email:** We will provide your Marketplace Creator official email as specified in your [public profile](https://marketplace.flutterflow.io/profile). ### What if I see low-quality items on the Marketplace? How can I report an item? We strive to maintain a high standard, but some items may not meet these expectations. If you encounter an item on the Marketplace that appears to violate our policies, please submit feedback using one of the channels described on [this page](https://docs.flutterflow.io/marketplace/submit-feedback): ## 📦 Item Submission and Review ### What is the criteria for getting my item approved for Marketplace? Please see our [Item Submission Criteria](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria). ### What happens if my item is rejected? If your item is not approved, it will be returned to draft status, allowing you to make the required edits. We will provide you with detailed feedback via email, specifying the criteria it did not meet. You can see more details about our criteria and suggested actions [here](https://docs.flutterflow.io/marketplace/creators-hub/submission-criteria). You can then make the necessary adjustments and resubmit it for review. ### When will my template be reviewed? We have significantly improved our review wait time recently! ⚡ We aim to review your template within 7 days. However, depending on the volume of submissions or the complexity of your submission, the review process can take up to 30 days (20 business days). ## 🖐️ Other Questions? If your question is not covered here, please **first review the other documentation pages** within the Marketplace section. If you are still facing issues, please reach out to the appropriate channel: - For legal issues, please email [marketplace-legal@flutterflow.io](mailto:marketplace-legal@flutterflow.io) - For other issues, please email [marketplace@flutterflow.io](mailto:marketplace@flutterflow.io) # Composing Widgets > This page is about FlutterFlow Studio (the visual builder), not FlutterFlow (the app builder you use by describing your app). URL: https://docs.flutterflow.io/resources/ui/widgets/composing-widgets In FlutterFlow Studio, creating a complex user interface often involves combining simpler widgets into more intricate layouts. While atomic widgets like Text, Button, Image, and Icon form the building blocks of your UI, you’ll use molecular widgets like Row, Column, and Stack to arrange these atomic widgets into a structured layout. In FlutterFlow Studio, creating a complex user interface often involves combining simpler widgets into more intricate layouts. While atomic widgets like **Text, Button, Image**, and **Icon** form the building blocks of your UI, you’ll use molecular widgets like **Row**, **Column**, and **Stack** to arrange these atomic widgets into a structured layout. As you grow more comfortable with these, you can advance to using **Lists** and **Grids** for even more dynamic and complex compositions. ## Molecular Widgets: Row, Column, and Stack To start composing more sophisticated interfaces, FlutterFlow Studio provides essential molecular widgets like **Row, Column**, and **Stack**. These widgets allow you to control the arrangement of atomic widgets within your app. - **Row:** This widget aligns its children horizontally in a single line, from left to right. It's useful for creating layouts where elements need to be placed side by side, such as icons with labels or buttons in a toolbar. - **Column:** This widget aligns its children vertically, from top to bottom. It's perfect for creating lists of items or laying out sections of a page vertically. - **Stack:** This widget allows for overlapping widgets by placing them on top of each other. It’s ideal for creating layered effects, like placing text over an image or adding a badge to an icon. ![row-col-stack.png](https://docs.flutterflow.io/assets/images/row-col-stack-43692a7d10f09d07ddb08295cc2b1055.png) :::note Learn more about how to compose widgets with **[Row, Column & Stack](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/rows-column-stack)**. ::: ## Advanced Composition: Lists & Grids As you become more familiar with using molecular widgets like **Row**, **Column**, and **Stack**, you can begin working with **Lists** and **Grids**. These widgets are specifically designed to handle large sets of data or dynamic content, making them essential for more complex layouts. - **Lists:** While a `Column` is useful for stacking a few items vertically, a `ListView` is designed to handle potentially infinite items by allowing the content to scroll. This makes it ideal for things like a chat app, news feed, or any list that can grow beyond the screen size. One of the key advantages of using a ListView is also its built-in support for **lazy loading**. :::tip[Lazy Loading] Lazy loading means that the `ListView` only builds and renders the items that are currently visible on the screen. As the user scrolls, `ListView` dynamically loads additional items just in time. This significantly improves performance, especially when dealing with long lists of data, by conserving memory and processing resources. ::: - **Grids:** A GridView organizes items into a two-dimensional grid. It's perfect for displaying items like photos, products, or any other type of content that benefits from being presented in a grid format, making it visually appealing and easy to navigate. :::note[List & Grids] Learn about the advanced properties of **[Lists & Grids](https://docs.flutterflow.io/resources/ui/widgets/composing-widgets/list-grid)**. :::