Skip to content

Commit 575cacb

Browse files
committed
consolidated articles from the folder "how to build in FF" in to the main docs, reordered the articles, updated content
1 parent bf47a97 commit 575cacb

File tree

10 files changed

+752
-1
lines changed

10 files changed

+752
-1
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
keywords: ['iot', 'bluetooth', 'mqtt', 'flutter packages']
3+
slug: /build-iot-app
4+
title: Build an IoT App
5+
---
6+
7+
# Build an IoT App
8+
9+
An IoT (Internet of Things) app is designed to connect, monitor, and control smart devices such as sensors, thermostats, and Bluetooth-enabled devices. With FlutterFlow, it’s possible to build the front-end of an IoT app and extend its capabilities using custom code and Flutter packages.
10+
11+
:::info[Prerequisites]
12+
- Familiarity with FlutterFlow’s Custom Code feature.
13+
- Access to target IoT devices or a simulation environment.
14+
- Understanding of device communication protocols such as Bluetooth or MQTT.
15+
:::
16+
17+
1. **Set Up the Flutter App Structure**
18+
19+
Use FlutterFlow’s UI builder to create the structure of your IoT app. Common pages include:
20+
- Device List
21+
- Device Control Panel
22+
- Settings and Connectivity
23+
24+
2. **Integrate Custom Code or Packages**
25+
26+
FlutterFlow supports using custom Dart code and Flutter packages. You can use this to manage device connectivity and communication.
27+
28+
:::note
29+
To use external packages, you must add them via **Custom Code > Packages** in your project settings.
30+
:::
31+
32+
Popular Flutter packages for IoT functionality include:
33+
34+
- `flutter_blue`: Connect to and communicate with Bluetooth Low Energy (BLE) devices.
35+
- `iot_sensors`: Access common sensor data such as temperature, humidity, and acceleration.
36+
- `mqtt_client`: Communicate with MQTT brokers, a common protocol in IoT systems.
37+
- `flutter_mqtt`: Publish and subscribe to MQTT messages from within your app.
38+
39+
3. **Manage Device Connections and State**
40+
41+
Use custom actions and logic to:
42+
1. Scan for available devices.
43+
2. Connect or disconnect from a device.
44+
3. Read or write values (e.g., sensor data, device commands).
45+
4. Display real-time device states using local state or Firestore sync.
46+
47+
4. **Test on Physical Devices**
48+
49+
IoT features such as Bluetooth or MQTT often require testing on real hardware. Simulators or emulators may not support these protocols.
50+
51+
:::warning
52+
FlutterFlow's custom code executes only on physical devices or when building for mobile. Make sure to test using real devices for Bluetooth or sensor-related features.
53+
:::
54+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
keywords: ['make', 'custom', 'indicator', 'bottom sheet', 'loading']
3+
slug: /custom-loading-bottom-sheet
4+
title: Create a Custom Loading Animation Using a Bottom Sheet
5+
---
6+
7+
# Create a Custom Loading Animation Using a Bottom Sheet
8+
9+
Use a custom `Bottom Sheet` to display a loading animation while performing long-running actions such as API calls, database writes, or chained workflows. This guide walks through how to build a non-blocking custom loading indicator.
10+
11+
![](../assets/20250430121406506215.gif)
12+
13+
:::info[Prerequisites]
14+
- A `Bottom Sheet` component with a loading animation (e.g., Lottie, GIF, or static image)
15+
- A page where you want to trigger the loading sequence
16+
:::
17+
18+
1. **Create a Bottom Sheet Component**
19+
20+
1. Go to the **UI Builder** and create a new `Component`.
21+
2. Select the **Bottom Sheet** layout.
22+
3. Add a loading animation:
23+
- Use a **Lottie** animation, **GIF**, or any custom UI for the loading indicator.
24+
- You can also include a `Text` widget to display a status message.
25+
26+
![](../assets/20250430121406885071.png)
27+
28+
This component will serve as the visual loading indicator during your action chain.
29+
30+
2. **Set Up the Action Workflow**
31+
32+
On the page where you want to trigger the loading sequence:
33+
34+
1. **Trigger the workflow** (e.g., on button press).
35+
2. Add a `Delay` action to simulate a task (optional).
36+
3. Add the `Open Bottom Sheet` action and configure it to be **non-blocking**.
37+
38+
![](../assets/20250430121407233519.png)
39+
40+
![](../assets/20250430121407654843.png)
41+
42+
:::warning
43+
Enable the **Non Blocking** option in the `Open Bottom Sheet` action. This allows the workflow to continue running while the bottom sheet is visible.
44+
:::
45+
46+
3. **Add the Main Actions**
47+
48+
1. Add the primary actions you want to perform while the loading indicator is active.
49+
- These could include `API Calls`, `Create Document`, `Update Document`, or chained actions.
50+
2. For demonstration, a `Delay` of 5 seconds is used to simulate long-running tasks.
51+
52+
4. **Dismiss the Bottom Sheet**
53+
54+
Once all actions are complete:
55+
56+
1. Add a `Close Bottom Sheet` action to remove the loading indicator.
57+
58+
![](../assets/20250430121407938780.png)
59+
60+
5. **Show a Confirmation Message**
61+
62+
1. Add a `Show SnackBar` action to display a success message to the user.
63+
64+
This confirms that the actions are complete and the bottom sheet has been dismissed.
65+
66+
![](../assets/20250430121408203472.gif)
67+
68+
You can test this implementation in the public project:
69+
- Navigate to the **CustomLoading** page
70+
- Tap **Login** on the login screen using the test account
71+
- Select **Custom Loading** from the home page to view it in action
72+
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
keywords: ['custom', 'navbar', 'navigation', 'app bar']
3+
slug: /custom-navbar-setup
4+
title: Custom Navigation Bars
5+
---
6+
7+
# Custom Navigation Bars
8+
9+
Build a custom `Navigation Bar` (NavBar) to support dynamic views, role-based access, or complex widget layouts such as embedded cart counters or animated icons. Unlike the default NavBar widget, this approach gives full control over design and visibility.
10+
11+
![](../assets/20250430121449657102.png)
12+
13+
:::info[Prerequisites]
14+
- A component to be used as the custom NavBar.
15+
- Pages with `Stack` layout to allow overlay positioning.
16+
- Local State variable or conditional logic to control visibility.
17+
:::
18+
19+
Follow the steps below:
20+
21+
1. **Build the NavBar Component**
22+
23+
1. Create a **Component** and design your NavBar layout.
24+
2. Add widgets as needed: icons, labels, counters, conditional containers, etc.
25+
3. Ensure the NavBar’s height is consistent across screens (e.g., `100px`).
26+
27+
2. **Add the NavBar to Your Pages**
28+
29+
1. Wrap the page layout in a `Stack`.
30+
2. Place the NavBar component inside a `Container` widget.
31+
- Set the container’s vertical alignment to `1` (bottom).
32+
- Set its width and height to match screen width and desired NavBar height.
33+
34+
```plaintext
35+
Page
36+
└─ Stack
37+
├─ Main Page Content
38+
└─ Container (height: 100px, align: bottom)
39+
└─ NavBar Component
40+
```
41+
42+
3. **Configure NavBar Behavior**
43+
44+
1. Add `Bottom Padding` to your main page content equal to the NavBar’s height. This prevents the NavBar from overlapping other widgets.
45+
46+
![](../assets/20250430121450015102.png)
47+
48+
2. Use `Local State`, `App State`, or conditional logic from a database (e.g., `is_admin`) to control:
49+
- Which version of the NavBar appears.
50+
- Whether the NavBar is visible at all.
51+
52+
:::warning
53+
Avoid placing the custom NavBar on subpages. NavBar components should only be used on top-level pages. Adding back navigation (e.g., `Pop` actions) to these pages may result in routing issues.
54+
:::
55+
56+
**Example: Conditional NavBar Logic**
57+
58+
You can conditionally display different layouts depending on the user’s role:
59+
- **Admin** users may see extra items or a different layout.
60+
- **Standard** users may have limited options.
61+
- Use the `is_admin` field from the `Users` collection to control this logic dynamically.
62+
63+
**Sample Project:**
64+
65+
A public sample project is available demonstrating:
66+
- A basic custom NavBar
67+
- A conditional NavBar that changes layout based on user role
68+
69+
**How to Use the Sample:**
70+
71+
1. Launch the project.
72+
2. Tap **Login** using the pre-configured test user.
73+
3. Navigate to:
74+
- **Custom NavBar/AppBar** to view a static NavBar layout.
75+
- **Conditional NavBar** to explore role-based NavBar behavior.
76+
- Toggle the `is_admin` field to test both states.
77+
78+
![](../assets/20250430121450326812.png)
79+
80+
![](../assets/20250430121450591399.png)
81+
82+
![](../assets/20250430121450801118.png)

docs/ff-concepts/navigation-routing/special-page-navigation/pageview-widget.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,57 @@ To add the PageView widget to your app:
4949
</iframe>
5050
</div>
5151

52+
## Use Case: Image Carousel with Auto-Scroll
53+
54+
You can build an image carousel using the `PageView` widget combined with the `Control Page View` action. This allows users to scroll through images either manually or automatically.
55+
56+
**Steps Overview:**
57+
58+
1. **Add a PageView Widget**
59+
- From the **Widget Panel**, drag the `PageView` widget onto the canvas.
60+
- Populate it with your image widgets or bind it to a dynamic image list.
61+
62+
2. **Set Up Page Load Action**
63+
- Select the `Scaffold` or main container.
64+
- Add a `Page Load` action to trigger carousel behavior.
65+
66+
3. **Add `Control Page View` Action**
67+
- Use the `Control Page View` action to control transitions:
68+
- `Next`, `Previous`, `First`, or `Last`.
69+
70+
4. **Auto-Scroll Behavior (Optional)**
71+
- Add a sequence of:
72+
- `Control Page View` → `Wait` → `Control Page View` (Next)
73+
- Loop this logic to create a smooth, timed carousel experience.
74+
75+
![Carousel Example](../assets/20250430121318472792.gif)
76+
77+
## Use Case: Image Slider from List of Image URLs
78+
79+
This example demonstrates how to build a dynamic image slider using a list of image URLs—ideal for product detail screens or galleries.
80+
81+
Follow the steps below:
82+
83+
1. **Add a PageView Widget**
84+
- Place a `PageView` on your screen.
85+
86+
2. **Bind to the Image List**
87+
- Generate dynamic children from your list of image URLs.
88+
89+
3. **Add a Repeating Child**
90+
- Use a single `Image` widget inside the `PageView`.
91+
- Bind the `Image URL` to the current list item.
92+
93+
:::tip
94+
You only need one child inside the PageView. When bound to a list, it automatically repeats for each item.
95+
:::
96+
97+
:::tip
98+
- Use horizontal scroll for carousels and onboarding pages.
99+
- Combine with indicators or swipe gestures for a richer UX.
100+
- Use `Wait` and `Control Page View` actions to create auto-scroll behavior.
101+
:::
102+
52103
## Adding infinite scroll
53104

54105
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.

docs/ff-concepts/notifications/push-notifications.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,31 @@ In this action, you can decide who should receive the push notification by setti
237237

238238
![trigger push notifications](imgs/trigger-pn.avif)
239239

240+
### Send Notifications to Multiple Users (Dynamic)
241+
242+
To notify a group of users when a document is created (e.g., group chat, announcement, or event), follow this flow:
243+
244+
1. **Add a Backend Query**
245+
- Add an **Action****Backend Query** before sending the notification.
246+
- Set **Query Type** to `Query Collection` and select your users collection (e.g., `users`).
247+
- Set **Return Type** to `List of Documents`.
248+
249+
2. **Create a Document**
250+
- Add an **Action****Create Document** to store the submitted content (e.g., a post or message).
251+
252+
3. **Trigger Notification**
253+
- Add an **Action****Trigger Push Notification**.
254+
- Set the **audience** to **Multiple Recipients**.
255+
- Under **Recipients**:
256+
- Select **Filter List Items****Items in List > Document Exists** to apply conditions.
257+
- Then choose **Map List Items**`Document Properties``Reference` to get user document references.
258+
259+
The notification will be sent to all users matching your filters, using the queried list.
260+
261+
:::tip
262+
Use this approach for dynamic group-based notifications tied to app activity, like chat, announcements, or tasks.
263+
:::
264+
240265
## Testing Push Notifications Cloud Function
241266

242267
You can also test the Push Notifications Cloud Function directly from the Google Cloud console, without needing to trigger from FlutterFlow. 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](../../ff-concepts/adding-customization/cloud-functions.md#testing-cloud-functions-in-google-cloud-console) section.

0 commit comments

Comments
 (0)