-
Notifications
You must be signed in to change notification settings - Fork 103
How to build in FF: consolidated articles from the folder "how to build in FF" in to the … #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mrdavidorok
wants to merge
2
commits into
main
Choose a base branch
from
david/howtobuildinFF
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
keywords: ['iot', 'bluetooth', 'mqtt', 'flutter packages'] | ||
slug: /build-iot-app | ||
title: Build an IoT App | ||
--- | ||
|
||
# Build an IoT App | ||
|
||
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. | ||
|
||
:::info[Prerequisites] | ||
- Familiarity with FlutterFlow’s Custom Code feature. | ||
- Access to target IoT devices or a simulation environment. | ||
- Understanding of device communication protocols such as Bluetooth or MQTT. | ||
::: | ||
|
||
1. **Set Up the Flutter App Structure** | ||
|
||
Use FlutterFlow’s UI builder to create the structure of your IoT app. Common pages include: | ||
- Device List | ||
- Device Control Panel | ||
- Settings and Connectivity | ||
|
||
2. **Integrate Custom Code or Packages** | ||
|
||
FlutterFlow supports using custom Dart code and Flutter packages. You can use this to manage device connectivity and communication. | ||
|
||
:::note | ||
To use external packages, you must add them via **Custom Code > Packages** in your project settings. | ||
::: | ||
|
||
Popular Flutter packages for IoT functionality include: | ||
|
||
- `flutter_blue`: Connect to and communicate with Bluetooth Low Energy (BLE) devices. | ||
- `iot_sensors`: Access common sensor data such as temperature, humidity, and acceleration. | ||
- `mqtt_client`: Communicate with MQTT brokers, a common protocol in IoT systems. | ||
- `flutter_mqtt`: Publish and subscribe to MQTT messages from within your app. | ||
|
||
3. **Manage Device Connections and State** | ||
|
||
Use custom actions and logic to: | ||
1. Scan for available devices. | ||
2. Connect or disconnect from a device. | ||
3. Read or write values (e.g., sensor data, device commands). | ||
4. Display real-time device states using local state or Firestore sync. | ||
|
||
4. **Test on Physical Devices** | ||
|
||
IoT features such as Bluetooth or MQTT often require testing on real hardware. Simulators or emulators may not support these protocols. | ||
|
||
:::warning | ||
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. | ||
::: | ||
|
72 changes: 72 additions & 0 deletions
72
docs/ff-concepts/animations/custom-loading-bottom-sheet.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
keywords: ['make', 'custom', 'indicator', 'bottom sheet', 'loading'] | ||
slug: /custom-loading-bottom-sheet | ||
title: Create a Custom Loading Animation Using a Bottom Sheet | ||
--- | ||
|
||
# Create a Custom Loading Animation Using a Bottom Sheet | ||
|
||
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. | ||
|
||
 | ||
|
||
:::info[Prerequisites] | ||
- A `Bottom Sheet` component with a loading animation (e.g., Lottie, GIF, or static image) | ||
- A page where you want to trigger the loading sequence | ||
::: | ||
|
||
1. **Create a Bottom Sheet Component** | ||
|
||
1. Go to the **UI Builder** and create a new `Component`. | ||
2. Select the **Bottom Sheet** layout. | ||
3. Add a loading animation: | ||
- Use a **Lottie** animation, **GIF**, or any custom UI for the loading indicator. | ||
- You can also include a `Text` widget to display a status message. | ||
|
||
 | ||
|
||
This component will serve as the visual loading indicator during your action chain. | ||
|
||
2. **Set Up the Action Workflow** | ||
|
||
On the page where you want to trigger the loading sequence: | ||
|
||
1. **Trigger the workflow** (e.g., on button press). | ||
2. Add a `Delay` action to simulate a task (optional). | ||
3. Add the `Open Bottom Sheet` action and configure it to be **non-blocking**. | ||
|
||
 | ||
|
||
 | ||
|
||
:::warning | ||
Enable the **Non Blocking** option in the `Open Bottom Sheet` action. This allows the workflow to continue running while the bottom sheet is visible. | ||
::: | ||
|
||
3. **Add the Main Actions** | ||
|
||
1. Add the primary actions you want to perform while the loading indicator is active. | ||
- These could include `API Calls`, `Create Document`, `Update Document`, or chained actions. | ||
2. For demonstration, a `Delay` of 5 seconds is used to simulate long-running tasks. | ||
|
||
4. **Dismiss the Bottom Sheet** | ||
|
||
Once all actions are complete: | ||
|
||
1. Add a `Close Bottom Sheet` action to remove the loading indicator. | ||
|
||
 | ||
|
||
5. **Show a Confirmation Message** | ||
|
||
1. Add a `Show SnackBar` action to display a success message to the user. | ||
|
||
This confirms that the actions are complete and the bottom sheet has been dismissed. | ||
|
||
 | ||
|
||
You can test this implementation in the public project: | ||
- Navigate to the **CustomLoading** page | ||
- Tap **Login** on the login screen using the test account | ||
- Select **Custom Loading** from the home page to view it in action | ||
|
82 changes: 82 additions & 0 deletions
82
docs/ff-concepts/navigation-routing/special-page-navigation/custom-navbar-setup.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
keywords: ['custom', 'navbar', 'navigation', 'app bar'] | ||
slug: /custom-navbar-setup | ||
title: Custom Navigation Bars | ||
--- | ||
|
||
# Custom Navigation Bars | ||
|
||
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. | ||
|
||
 | ||
|
||
:::info[Prerequisites] | ||
- A component to be used as the custom NavBar. | ||
- Pages with `Stack` layout to allow overlay positioning. | ||
- Local State variable or conditional logic to control visibility. | ||
::: | ||
|
||
Follow the steps below: | ||
|
||
1. **Build the NavBar Component** | ||
|
||
1. Create a **Component** and design your NavBar layout. | ||
2. Add widgets as needed: icons, labels, counters, conditional containers, etc. | ||
3. Ensure the NavBar’s height is consistent across screens (e.g., `100px`). | ||
|
||
2. **Add the NavBar to Your Pages** | ||
|
||
1. Wrap the page layout in a `Stack`. | ||
2. Place the NavBar component inside a `Container` widget. | ||
- Set the container’s vertical alignment to `1` (bottom). | ||
- Set its width and height to match screen width and desired NavBar height. | ||
|
||
```plaintext | ||
Page | ||
└─ Stack | ||
├─ Main Page Content | ||
└─ Container (height: 100px, align: bottom) | ||
└─ NavBar Component | ||
``` | ||
|
||
3. **Configure NavBar Behavior** | ||
|
||
1. Add `Bottom Padding` to your main page content equal to the NavBar’s height. This prevents the NavBar from overlapping other widgets. | ||
|
||
 | ||
|
||
2. Use `Local State`, `App State`, or conditional logic from a database (e.g., `is_admin`) to control: | ||
- Which version of the NavBar appears. | ||
- Whether the NavBar is visible at all. | ||
|
||
:::warning | ||
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. | ||
::: | ||
|
||
**Example: Conditional NavBar Logic** | ||
|
||
You can conditionally display different layouts depending on the user’s role: | ||
- **Admin** users may see extra items or a different layout. | ||
- **Standard** users may have limited options. | ||
- Use the `is_admin` field from the `Users` collection to control this logic dynamically. | ||
|
||
**Sample Project:** | ||
|
||
A public sample project is available demonstrating: | ||
- A basic custom NavBar | ||
- A conditional NavBar that changes layout based on user role | ||
|
||
**How to Use the Sample:** | ||
|
||
1. Launch the project. | ||
2. Tap **Login** using the pre-configured test user. | ||
3. Navigate to: | ||
- **Custom NavBar/AppBar** to view a static NavBar layout. | ||
- **Conditional NavBar** to explore role-based NavBar behavior. | ||
- Toggle the `is_admin` field to test both states. | ||
|
||
 | ||
|
||
 | ||
|
||
 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.