diff --git a/docs/ff-concepts/navigation-routing/bottom-sheet.md b/docs/ff-concepts/navigation-routing/bottom-sheet.md index f119cd6b..2811edc9 100644 --- a/docs/ff-concepts/navigation-routing/bottom-sheet.md +++ b/docs/ff-concepts/navigation-routing/bottom-sheet.md @@ -49,7 +49,7 @@ Follow the steps below to add an action that opens the bottom sheet: 1. First, create a bottom sheet [component](../../resources/ui/components/intro-components.md). :::tip -You can also create one from the 'BottomSheet' [**templates**](../../resources/ui/components/creating-components.md#creating-a-component-from-a-popular-template). +You can also create one from the 'BottomSheet' [**templates**](../../resources/ui/components/creating-components.md#creating-component-from-template). :::

-### Passing in an Action to a Component +### 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 to be executed when the callback is triggered. For this example, we simply update the profile picture. +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. :::info @@ -145,26 +145,26 @@ You can access the value passed to the callback by navigating to the **Set Varia

-Now that we have an *image upload component* with action parameters set up, it can be reused across different pages or contexts, as it relies on the parent to define the post-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. +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](imgs/component-action-parameters.avif) ## More Examples -Let's see some more examples of adding action parameters (callbacks) to deepen the understanding and use it in real-world scenarios. +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 of what should happen—it simply executes the callback passed to it when users click on the "Yes" button. +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](imgs/dialog-component-action-parameters.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 allows you to define navigation behavior dynamically, depending on the active context, making it perfect for this scenario. +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. diff --git a/docs/resources/ui/components/child-widget.md b/docs/resources/ui/components/child-widget.md index c735cfb4..b18a4686 100644 --- a/docs/resources/ui/components/child-widget.md +++ b/docs/resources/ui/components/child-widget.md @@ -11,9 +11,9 @@ keywords: [FlutterFlow, Child Widget, Components, UI, Reusable 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. -- The position is fixed within the component layout -- It accepts any widget (text, button, image, custom widget, and components, etc.) -- Each instance of the component can have different content inside it +- 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. @@ -35,7 +35,7 @@ Let’s see how to use the Child Widget by building a simple example of displayi 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. Now go to the component instance (the place where you add this component), locate the Child Widget area, and add any widget into it. +4. Go to the component instance (the place where you add this component), locate the Child Widget area, and add any widget to it.
-While creating a Component State, the following properties are included: +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. @@ -151,19 +151,19 @@ While creating a Component State, the following properties are included: - **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 `isFavourite` variable in the context of the above example: +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. -- The **Initial Field Value** would also be set to **false**, indicating that the item is not +- Set the **Initial Field Value** to **false**, indicating that the item is not favorited by default. -- **Nullable** property will be set to false, as the variable should always have a boolean value +- 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 any primitive data types such as **String, Integer, Boolean, Double** or to any other complex built-in data types such as **Enum, Custom Data Type, Document,** etc. To learn more about the available data types, refer the [**Data Representation Section**](../../data-representation/overview.md). +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**](../../data-representation/overview.md). ::: ### Get Component State Value @@ -173,7 +173,7 @@ icon based on the `isFavourite` state variable. We introduce a `Conditional Buil 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 the steps as below: +Follow these steps:
Create Blank Component**.
-## Creating a Component from a Popular Template +## Creating Component from Template FlutterFlow offers multiple popular templates for components across various use cases that you can -apply to your project in seconds, saving you a lot of time. +apply to your project in seconds, saving time.
-#### Import from Figma Frame - -You can also quickly turn your Figma designs into functional components in FlutterFlow. By providing a Figma Frame URL, FlutterFlow AI will analyze the design and automatically generate UI layouts that closely match your mockup. +## Import from Figma Frame +You can quickly turn your Figma designs into functional FlutterFlow 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 import from a Figma Frame, first, connect your Figma account, [import the Figma theme](../../../ff-concepts/design-system/design-system.md#import-figma-theme), and map your colors and typography accordingly. Next, open the **Generate with AI** dialog and click the **Plus (+)** button. Select **Import from Figma**, enter your **Figma frame URL**, and press **Send**. +To get started, first [connect your Figma account](../../../ff-concepts/design-system/design-system.md#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**. -A preview of the frame you are importing will appear. To finalize the import, click **Send** again. Once completed, the component will appear in the AI Generation History, where you can preview and add it to your project. +FlutterFlow 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. :::warning -Currently, we don't support importing SVG elements from Figma frames. However, you can manually add the SVGs directly to your project [**assets**](../../../generated-code/directory-structure.md#assets) after generation is complete, or replace them in Figma with supported image formats like PNG or JPEG. +Currently, FlutterFlow doesn't support importing SVG elements from Figma frames. However, you can manually add the SVGs directly to your project [**assets**](../../../generated-code/directory-structure.md#assets) after generation is complete, or replace them in Figma with supported image formats like PNG or JPEG. ::: @@ -169,8 +157,8 @@ Currently, we don't support importing SVG elements from Figma frames. However, y width: '100%' }}>
- +![component-unique-id.avif](imgs/component-unique-id.avif) ## Recursive Components -You can create a recursive component, meaning the component can include an instance of itself within its own widget tree. This is especially useful for nested content. +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](../imgs/recursive-comp.png) - diff --git a/docs/resources/ui/components/widget-builder-parameters.md b/docs/resources/ui/components/widget-builder-parameters.md index 9579b4fb..28f5c01c 100644 --- a/docs/resources/ui/components/widget-builder-parameters.md +++ b/docs/resources/ui/components/widget-builder-parameters.md @@ -6,19 +6,19 @@ slug: widget-builder # Widget Builder Parameters -Sometimes, you want to create a component that offers some consistent design, while also allowing for customization. This is where passing widget builder 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 in 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. +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 use the dropdown's appearance and behavior without creating new components for each variation. +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 casses] +:::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 some customization 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. +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](imgs/widget-builder-as-parameter-example.avif) @@ -27,7 +27,7 @@ Let’s see an example from an eCommerce app. On the shipping address page, you 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 unmodified. 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. +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 into 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. +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.

-#### Preview the Widget Builder using Different Components +#### 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 **Property Panel**. +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](imgs/preview-component.png) ## Using Components with Widget Builders as Parameters -When you use a component that has a widget builder as a parameter, you can pass in [components](/resources/ui/components) to customize the content according to your needs. +When you use a component that has a widget builder parameter, you can pass [components](/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. @@ -152,4 +152,3 @@ In this example, we create two additional components for `TextField` and `Dropdo

- diff --git a/docs/resources/ui/widgets/composing-widgets/rows-column-stack.md b/docs/resources/ui/widgets/composing-widgets/rows-column-stack.md index ff9bf513..81ed0996 100644 --- a/docs/resources/ui/widgets/composing-widgets/rows-column-stack.md +++ b/docs/resources/ui/widgets/composing-widgets/rows-column-stack.md @@ -31,7 +31,7 @@ depends on how you need to arrange your UI components: ![row-col-stack.png](../../imgs/row-col-stack.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](../../components/creating-components.md#convert-into-a-component)**. +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](../../components/creating-components.md#convert-to-a-component)**. :::