Skip to content

Commit 70fa18c

Browse files
committed
Merge branch 'refs/heads/main' into pooja/secure-keys-gen-code
2 parents 6ff45a5 + 1471c42 commit 70fa18c

File tree

70 files changed

+1460
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1460
-271
lines changed

docs/accounts-billing/payments-billing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This section contains information on the payment methods we accept and how to ch
55

66
## Invoices
77
#### Can I Add A Tax ID (e.g. VAT) to my invoice?
8-
Unfortunately, at this time we are not able to process Tax IDs.
8+
If you need to include VAT in your invoices, please reach out to our support team at [email protected], and we’ll be happy to assist you with the process.
99

1010

1111
## Payment Methods

docs/ff-concepts/adding-customization/vscode-extension.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,72 @@ To delete a Custom Action or Widget, delete the associated file.
231231
### Adding New Dependencies
232232
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.
233233

234+
## Using Flutter Version Management (FVM)
235+
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:
236+
237+
### Install FVM
238+
239+
To install **FVM**, run the following command in your terminal. This installs FVM globally using Dart’s package manager.
240+
241+
```
242+
dart pub global activate fvm
243+
```
244+
245+
### Add FVM to Your System’s PATH
246+
247+
After installation, you need to add the directory containing FVM’s executables to your **PATH variable** so that it can be accessed globally.
248+
249+
#### For macOS & Linux
250+
251+
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.
252+
253+
```bash
254+
echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> ~/.zshrc # For Zsh
255+
echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> ~/.bashrc # For Bash
256+
```
257+
258+
2. Restart your terminal or run `source ~/.zshrc` (or `source ~/.bashrc`) to apply the changes.
259+
260+
#### For Windows
261+
262+
1. Locate the **FVM executable path**, typically:
263+
264+
```
265+
C:\Users\YourUsername\AppData\Local\Pub\Cache\bin
266+
```
267+
268+
2. Add this path to your **System’s PATH variable**:
269+
1. Open **System Properties****Advanced system settings**.
270+
2. Click **Environment Variables**.
271+
3. Under **System variables**, select **Path****Edit**.
272+
4. Click **New** and add the above path.
273+
5. Click **OK** and restart your terminal.
274+
275+
276+
### Verify the Installation
277+
278+
To check if FVM is correctly installed and accessible, run:
279+
280+
```bash
281+
fvm --version
282+
```
283+
284+
If this command prints the installed version of FVM, it means FVM is successfully installed and added to PATH.
285+
286+
287+
### Configure FVM in Your Flutter Project
288+
289+
Once FVM is installed, navigate to your Flutter project folder and set up FVM:
290+
291+
```bash
292+
cd your-flutterflow-project
293+
fvm init
294+
fvm install <flutter_version>
295+
fvm use <flutter_version>
296+
```
297+
298+
*(Replace `<flutter_version>` with the required Flutter version.)*
299+
234300

235301
## FAQs
236302
<details>

docs/ff-concepts/design-system/design-system.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ To add a design system from a library, first, ensure that you [add a library dep
239239

240240
---
241241

242-
## Loading Indicator
242+
## Loading Indicators
243243

244-
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.
244+
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.
245245

246246
<div style={{
247247
position: 'relative',
@@ -269,6 +269,10 @@ To customize the loading indicators used in the app, you can make changes in thi
269269
</div>
270270
<p></p>
271271

272+
:::tip
273+
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.
274+
:::
275+
272276
If you prefer watching a video tutorial, here is the guide for you:
273277

274278
<div style={{
Binary file not shown.

docs/ff-concepts/navigation-routing/share-action.md

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,10 @@ keywords: [FlutterFlow, Share Action, Navigation, Concepts]
99

1010
# Share [Action]
1111

12-
Share Action can be used to send a text using the Android or iOS device's share dialog. You can send the text using email, message, or any other application present on the device that supports sharing functionality.
13-
14-
<figure>
15-
<img src="https://firebasestorage.googleapis.com/v0/b/ecommerceflow-docs/o/share-example.gif?alt=media&token=f902c889-56e0-4f40-9413-7e5852d5d8c2"></img>
16-
<figcaption class="centered-caption"></figcaption>
17-
</figure>
18-
19-
## Define Share Action
20-
21-
Go to your project page on FlutterFlow and follow the steps below to define an Upload Photo/Video Action to a widget:
22-
23-
1. Select the **widget** in which you want to set the Action.
24-
25-
2. Select the **Actions** from the Properties Panel (the right menu).
26-
27-
3. Click **+ Add Action** button.
28-
29-
4. Choose a gesture from the dropdown among ***On Tap****,* ***On Double Tap****,**or* **On Long
30-
Press**.
31-
32-
5. Select the **Action Type** as ***Share***.
33-
34-
6. Now, you need to specify a **URL/Text Value**. It can be set either by defining a **Specific
35-
Value** or by using **From Variable** to use a value stored inside a variable.
36-
- If you are using **Specific Value**, enter the text in the **Value** field.
37-
- If you are using **From Variable**, you need to select the **Source**.
38-
39-
Demo of defining Share Action using a **Specific Value** is as follows:
40-
41-
<img src="https://firebasestorage.googleapis.com/v0/b/ecommerceflow-docs/o/share-with-value.gif?alt=media&token=415cf039-dae7-4ee0-ad3c-c31a8c5c4a50"></img>
42-
43-
<p></p>
44-
45-
Alternatively, a demo of defining Share Action using **From Variable** option is as follows:
46-
47-
<p></p>
48-
49-
50-
<figure>
51-
<img src="https://firebasestorage.googleapis.com/v0/b/ecommerceflow-docs/o/share-with-variable.gif?alt=media&token=7d77df34-7c82-47fe-ba50-8eedf699c6ea"></img>
52-
<figcaption class="centered-caption"></figcaption>
53-
</figure>
54-
12+
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.
5513

5614
:::warning
57-
You won't be able to try out this Action using FlutterFlow's *Run Mode* or *Preview Mode*. To
58-
test this Action, you have to run it on an iOS or Android device or emulator. You can either
59-
**Download the Code** (by going to `Developer Menu > Download Code`) and build it for your
60-
device, or use the **Build APK** button (present on the [**Tool Bar**](../../intro/ff-ui/toolbar.md) to generate an APK that
61-
you can run on your Android device.
15+
It's important to note that the Share Action is designed for mobile platforms and is not supported in FlutterFlow's Run Mode or Preview Mode. To test this functionality, you need to [**run your app on an iOS or Android device or emulator**](../../testing-deployment-publishing/running-your-app/local-run.md).
6216
:::
17+
18+
![share-action](imgs/share-action.avif)

docs/ff-integrations/firebase/connect-to-firebase-setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ com/embed/1abddd1120db477da2c085dbc6b7a742?sid=5b161c8b-3957-4ac9-b27f-dc5ebc03f
168168

169169

170170

171-
## Enable Billing for Cloud Functions Access
171+
## Enable Billing
172172

173-
If you want to deploy functions (e.g., Braintree payments, Push Notifications), you will need to enable billing for your Firebase project. Please follow these steps to enable billing:
173+
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:
174174

175175
1. From the Firebase dashboard of your project, navigate to the far left menu. Under Build, select **Functions** and then select **Upgrade project**.
176176

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Components
3+
slug: /generated-code/component-model
4+
sidebar_position: 6
5+
---
6+
7+
# Generated Code: Components
8+
9+
Similar to a [**Page**](pages-generated-code.md), when creating a **[component](../resources/ui/components/intro-components.md)** in FlutterFlow, it automatically generates two files: a `Widget` class and a `Model` class.
10+
11+
:::info[Prerequisites]
12+
This guide uses examples from the generated code of the **[EcommerceFlow demo app](https://bit.ly/ff-docs-demo-v1)**. To view the generated code directly, check out the **[Github repository](https://github.com/FlutterFlow/sample-apps/tree/main/ecommerce_flow)**.
13+
:::
14+
15+
## ComponentModel class
16+
17+
`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.
18+
19+
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](pages-generated-code.md)**.
20+
21+
### onComponentLoad Action: Generated Code
22+
23+
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.
24+
25+
```js
26+
@override
27+
void initState() {
28+
super.initState();
29+
_model = createModel(context, () => ProductListPageModel());
30+
31+
// On component load action.
32+
SchedulerBinding.instance.addPostFrameCallback((_) async {
33+
await _model.updateTotalCost(context);
34+
safeSetState(() {});
35+
});
36+
37+
}
38+
```
39+
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: FlutterFlow Model
3+
slug: /generated-code/flutterflow-model
4+
sidebar_position: 4
5+
---
6+
7+
# FlutterFlow Model
8+
9+
The `FlutterFlowModel` class is an abstract class used in FlutterFlow 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.
10+
11+
FlutterFlow automatically generates the `flutter_flow_model.dart` file, which contains the `FlutterFlowModel` class and utility methods like `wrapWithModel()` and `createModel()`.
12+
13+
The diagram below illustrates how these utility classes and methods are utilized in a widget or model class:
14+
15+
16+
![page-generated.png](imgs/page-generated.png)
17+
18+
When a component is added to your page (and every component you create [generates both a widget and a model class)](component-gen-code.md), the flow below explains how the utility classes are used when there is a child component:
19+
20+
![page-component-generated.png](imgs/page-component-generated.png)
21+
22+
<p></p>
23+
24+
Here’s a breakdown of the lifecycle of `FlutterFlowModel` class:
25+
26+
## Initialization
27+
Ensures the model is initialized **only once** and is tied to the `BuildContext` and the widget it is associated with.
28+
29+
```js
30+
abstract class FlutterFlowModel<W extends Widget> {
31+
// Initialization methods
32+
bool _isInitialized = false;
33+
void initState(BuildContext context);
34+
void _init(BuildContext context) {
35+
if (!_isInitialized) {
36+
initState(context);
37+
_isInitialized = true;
38+
}
39+
if (context.widget is W) _widget = context.widget as W;
40+
_context = context;
41+
}
42+
```
43+
44+
45+
## Widget & Context references
46+
47+
Provides references to the associated widget and its `BuildContext`.
48+
49+
```js
50+
// The widget associated with this model. This is useful for accessing the
51+
// parameters of the widget, for example.
52+
W? _widget;
53+
W? get widget => _widget;
54+
55+
// The context associated with this model.
56+
BuildContext? _context;
57+
BuildContext? get context => _context;
58+
```
59+
60+
`_widget` and `_context` (private fields) store the widget and context references. `widget` and `context` (getters) are the public accessors for `_widget` and `_context`.
61+
62+
## Disposal
63+
64+
Manages the cleanup of resources when the model or widget is disposed.
65+
66+
```js
67+
bool disposeOnWidgetDisposal = true;
68+
void dispose();
69+
void maybeDispose() {
70+
if (disposeOnWidgetDisposal) {
71+
dispose();
72+
}
73+
// Remove reference to widget for garbage collection purposes.
74+
_widget = null;
75+
}
76+
```
77+
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).
78+
79+
The `maybeDispose()` checks `disposeOnWidgetDisposal` before disposing. It removes the widget reference to aid garbage collection.
80+
81+
## Updates and Change Notification
82+
83+
Allows the model to notify the associated widget or parent component/page when updates occur.
84+
85+
```js
86+
// Whether to update the containing page / component on updates.
87+
bool updateOnChange = false;
88+
// Function to call when the model receives an update.
89+
VoidCallback _updateCallback = () {};
90+
void onUpdate() => updateOnChange ? _updateCallback() : () {};
91+
92+
FlutterFlowModel setOnUpdate({
93+
bool updateOnChange = false,
94+
required VoidCallback onUpdate,
95+
}) =>
96+
this
97+
.._updateCallback = onUpdate
98+
..updateOnChange = updateOnChange;
99+
100+
// Update the containing page when this model received an update.
101+
void updatePage(VoidCallback callback) {
102+
callback();
103+
_updateCallback();
104+
}
105+
```
106+
107+
## wrapWithModel()
108+
109+
The `wrapWithModel()` method in FlutterFlow 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.
130 KB
Loading
77.4 KB
Loading

0 commit comments

Comments
 (0)