You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can only add a pub dependency to Custom Action & Custom Widgets.
223
+
You can only add a pubspec dependency to [**Custom Action**](custom-actions.md) & [**Custom Widgets**](custom-widgets.md).
224
224
:::
225
225
226
-
If you plan to use a dependency from [*pub.dev*](https://pub.dev/) into a custom widget or action,
227
-
you must go through the following steps:
226
+
### Pub.dev
227
+
[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.
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.
232
+
233
+
You can explore the Flutter Favorite packages on **[pub.dev's Flutter Favorites page](https://pub.dev/packages?q=is%3Aflutter-favorite)**.
234
+
235
+
:::
236
+
237
+
### Choosing the correct package from pub.dev
234
238
235
239
You will find varieties of dependencies for a specific requirement, and choosing the best one can be
236
240
challenging. This section helps you identify the right dependency by examining its score.
When adding a pubspec dependency to your custom code in FlutterFlow, you’ll need two pieces of information: the [package name with its version number](#copy-package-name--version-) and the [import statement](#copying-import-statement).
265
+
266
+
#### Copy Package Name & Version
261
267
262
268
To use the dependency code in our code editor, copy its name with the version. To do so, click
263
269
the **Copy to Clipboard** icon.
@@ -278,7 +284,7 @@ section at the bottom right side.
278
284
279
285

280
286
281
-
##### 3. Copying import statement
287
+
#### Copying import statement
282
288
283
289
An import statement points to where the dependency's code is located. When making a custom widget or
284
290
action, place this statement at the beginning of the code editor.
@@ -288,7 +294,44 @@ the import statement. To copy, click the **Copy to Clipboard** icon.
288
294
289
295

290
296
297
+
### Add Pubspec Dependency to Custom Code: Guide
298
+
In this example, we are using the
299
+
[**flutter_rating_bar**](https://pub.dev/packages/flutter_rating_bar) dependency to create a
300
+
`ProductRatingBar` custom widget for our
301
+
Product pages. See how we utilize the example code from pub.dev and add the customized widget in
302
+
FlutterFlow:
291
303
304
+
<div style={{
305
+
position: 'relative',
306
+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
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](custom-widgets.md)** and [Custom Actions](custom-actions.md).
Copy file name to clipboardExpand all lines: docs/ff-concepts/adding-customization/custom-widgets.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ this example, we will create a `ProductRatingBar` widget that uses a pub.dev dep
61
61
62
62
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.
63
63
64
-
## Adding a pub.dev dependency
64
+
## Add Dependency to Custom Widgets
65
65
66
66
In this example, we are using the
67
67
[**flutter_rating_bar**](https://pub.dev/packages/flutter_rating_bar) dependency to create a
@@ -95,6 +95,10 @@ FlutterFlow:
95
95
</iframe>
96
96
</div>
97
97
98
+
:::tip[Choosing a Pubspec Dependency]
99
+
For a comprehensive guide on navigating external packages using pub.dev, evaluating packages, and making the best choices for your app, [**follow the guide**](custom-code.md#adding-a-pubspec-dependency).
100
+
:::
101
+
98
102
## Using a Custom Widget
99
103
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:
100
104
@@ -167,7 +171,7 @@ FlutterFlow also allows you to view your custom widget once it is successfully c
167
171
To learn more about Custom Widget settings, such as the
168
172
[**Exclude From Compilation toggle**](custom-code.md#exclude-from-compilation),
169
173
and other properties like [**Callback Actions**](custom-code.md#add-a-callback-action),
170
-
[**Pub Dependencies**](custom-code.md#adding-a-pub-dependency), please check out this
174
+
[**Pub Dependencies**](custom-code.md#adding-a-pubspec-dependency), please check out this
Copy file name to clipboardExpand all lines: docs/resources/control-flow/overview.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,15 +72,15 @@ data or performing calculations. In FlutterFlow, you can use
72
72
73
73
***[Actions](functions/action-flow-editor.md):** Sequence of Logic performed in response to
74
74
user interactions. For example:
75
-
***Updating State Variables:** Functions that modify the current state or data of the app,
75
+
***[Updating State Variables:](../../ff-concepts/state-management/state-variables.md)** Functions that modify the current state or data of the app,
76
76
page, or
77
77
component.
78
78
79
79
***Widget-specific Functions:** Functions applicable to various widgets that need specific
80
80
actions, such as scrolling to an item in a ListView, clearing text fields, or calling third-party
81
81
integration functions.
82
82
83
-
***Custom Actions:** More complex actions written in **Flutter & Dart** that can be added as a node to
83
+
***[Custom Actions:](../../ff-concepts/adding-customization/custom-actions.md)** More complex actions written in **Flutter & Dart** that can be added as a node to
84
84
the action flow editor.
85
85
86
86
***[Navigation:](../../ff-concepts/navigation-routing/nav-overview.md)** Functions that handle
Copy file name to clipboardExpand all lines: docs/resources/data-representation/global-properties.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,18 @@ keywords: [Global Properties, FlutterFlow, Data Representation]
9
9
10
10
# Global Properties
11
11
12
-
Global properties are accessible across all pages of your app. They act as a utility function to accomplish a common task regardless of the type of app you are developing.
12
+
Global properties are **built-in variable**s in FlutterFlow that you can use across all pages of your app. These properties are predefined by FlutterFlow, meaning you cannot create or modify them yourself. They are designed to help you perform common tasks efficiently, no matter what type of app you’re developing.
13
13
14
-
For instance, you may need to redirect to a different page if a user is not logged in. Or, you may want to enable specific functionality based on the platform. In such scenarios, global properties are useful.
14
+
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.
15
15
16
-
You can access these properties via the **Set from Variable menu > Global Properties**.
16
+
You can access these properties through the **Set from Variable** menu **> Global Properties**.
keywords: [Data Representation, FlutterFlow, Variables, Data Types, Global Data, Encapsulation]
8
8
---
9
9
10
10
# Overview
@@ -28,7 +28,7 @@ Variables are used in practically all areas of the app, from the user interface
28
28
29
29
To create a variable, start by defining its name and data type. If it's going to contain a list, you can specify that. Certain variables, such as page state and component state variables, are non-nullable by default, meaning they must contain a value. After defining the variable, you can assign a value to it.
30
30
31
-
Learn more about creating [app state variables](../data-representation/app-state.md), [page state variables](../../resources/ui/pages/page-lifecycle/#page-state), and [component state variables](../../ff-concepts/state-management/generated-code.md#component-state).
31
+
Learn more about creating [app state variables](../data-representation/app-state.md), [page state variables](../../resources/ui/pages/page-lifecycle/#page-state), and [component state variables](../ui/components/custom-components/component-lifecycle#component-state).
32
32
33
33
### Setting and using variables
34
34
@@ -52,9 +52,9 @@ Learn more about data types [**here**](data-types.md).
52
52
53
53
All variables in FlutterFlow are mutable. This means you can change their values at runtime based on user interactions or other events in your app. FlutterFlow also supports immutable data, such as [Constants](constants.md) that cannot be changed once they have been set.
54
54
55
-
## Global data
55
+
## Global Properties
56
56
57
-
Global data are accessible from anywhere within the app. They are helpful, especially when the data is required frequently or by various components or pages. In FlutterFlow, they are available as [Global Properties](global-properties.md).
57
+
Global properties in FlutterFlow 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](global-properties.md) to simplify common tasks.
Copy file name to clipboardExpand all lines: docs/resources/ui/pages/page-elements.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ and offers customization with a variety of styles and functionalities.
22
22
23
23
The AppBar is divided into the following sections:
24
24
25
-
-**Leading:** Typically holds a menu or back button, providing navigation control.
25
+
-**Leading:** Typically holds a **menu** or **back icon** that provides navigation control. By default, if there is a [**drawer**](#drawers) or [**page navigation**](../../../ff-concepts/navigation-routing/page-navigation.md) with ["Allow Back Navigation" enabled](../../../ff-concepts/navigation-routing/page-navigation.md#navigate-to-action), a specific icon (such as a menu or back arrow) is displayed. However, you can override this with another [**Icon widget**](../../ui/widgets/built-in-widgets/icons.md) if desired, allowing for more tailored navigation options.
26
26
-**Title:** Primarily serves to indicate the content of the active screen or to display the
27
27
name of the application, aiding users in recognizing their context within the app. This section
28
28
can also be customized with different widgets for a more tailored visual representation.
@@ -57,6 +57,17 @@ The AppBar is divided into the following sections:
57
57
</iframe>
58
58
</div>
59
59
60
+
### Enable Default Button
61
+
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](../../../ff-concepts/navigation-routing/page-navigation.md) or when a [Drawer](#drawers) is present on the page.
62
+
63
+
However, it's important to note that this default icon won't appear in the FlutterFlow canvas during the design stage. It only becomes visible when the app is running, and the conditions for showing the button are met.
64
+
65
+
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-to-your-page).
66
+
67
+
:::tip[Generated Code]
68
+
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 a back navigation option or Drawer is detected when you run the app.
69
+
:::
70
+
60
71
## Floating Action Button (FAB)
61
72
62
73
**Floating Action Button (FAB)** is a distinctive circular button that hovers over content, commonly
0 commit comments