Skip to content

Commit d63ea6e

Browse files
authored
Pooja/minor updates (#115)
* Add more clarifications to certain parts * Rearrange custom code pubspec information. * Add more clarifications and fix links
1 parent ad2ceff commit d63ea6e

File tree

10 files changed

+89
-28
lines changed

10 files changed

+89
-28
lines changed

docs/ff-concepts/adding-customization/custom-actions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ Flow.
118118

119119
<p></p>
120120

121+
121122
:::tip[LOOKING for other CUSTOM action properties?]
122123
To learn more about Custom Action settings, such as the
123124
[**Exclude From Compilation toggle**](custom-code.md#exclude-from-compilation),
124125
[**Include Build Context toggle**](custom-code.md#include-buildcontext),
125126
and other properties like [**Callback Actions**](custom-code.md#add-a-callback-action),
126-
[**Pub Dependencies**](custom-code.md#adding-a-pub-dependency), please check out this
127+
[**Pubspec Dependencies**](custom-code.md#adding-a-pubspec-dependency), please check out this
127128
[**comprehensive guide**](custom-code.md).
128129
:::
129130

docs/ff-concepts/adding-customization/custom-code.md

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,24 @@ Here's an example of an Action that returns a _nullable_ integer.
217217

218218
![return-value-actions.png](imgs/return-value-actions.png)
219219

220-
#### Adding a Pub Dependency
220+
## Adding a Pubspec Dependency
221221

222222
:::tip[Scope]
223-
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).
224224
:::
225225

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

229-
1. [Choosing dependency](#1-choosing-dependency)
230-
2. [Copying dependency/package name](#2-copying-dependency-name)
231-
3. [Copying import statement](#3-copying-import-statement)
229+
:::info[Flutter Favourite Packages]
232230

233-
##### 1. Choosing dependency
231+
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
234238

235239
You will find varieties of dependencies for a specific requirement, and choosing the best one can be
236240
challenging. This section helps you identify the right dependency by examining its score.
@@ -257,7 +261,9 @@ one.
257261

258262
![Dependency-score.png](imgs/Dependency-score.png)
259263

260-
##### 2. Copying dependency name
264+
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
261267

262268
To use the dependency code in our code editor, copy its name with the version. To do so, click
263269
the **Copy to Clipboard** icon.
@@ -278,7 +284,7 @@ section at the bottom right side.
278284

279285
![img_1.png](imgs/img_1.png)
280286

281-
##### 3. Copying import statement
287+
#### Copying import statement
282288

283289
An import statement points to where the dependency's code is located. When making a custom widget or
284290
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.
288294

289295
![img_2.png](imgs/img_2.png)
290296

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:
291303

304+
<div style={{
305+
position: 'relative',
306+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
307+
height: 0,
308+
width: '100%'
309+
}}>
310+
<iframe
311+
src="https://demo.arcade.software/EAqWwTSfjumXzJ3xB6FX?embed&show_copy_link=true"
312+
title=""
313+
style={{
314+
position: 'absolute',
315+
top: 0,
316+
left: 0,
317+
width: '100%',
318+
height: '100%',
319+
colorScheme: 'light'
320+
}}
321+
frameborder="0"
322+
loading="lazy"
323+
webkitAllowFullScreen
324+
mozAllowFullScreen
325+
allowFullScreen
326+
allow="clipboard-write">
327+
</iframe>
328+
</div>
329+
330+
<p></p>
331+
332+
:::note
333+
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).
334+
:::
292335

293336

294337

docs/ff-concepts/adding-customization/custom-widgets.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ this example, we will create a `ProductRatingBar` widget that uses a pub.dev dep
6161

6262
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.
6363

64-
## Adding a pub.dev dependency
64+
## Add Dependency to Custom Widgets
6565

6666
In this example, we are using the
6767
[**flutter_rating_bar**](https://pub.dev/packages/flutter_rating_bar) dependency to create a
@@ -95,6 +95,10 @@ FlutterFlow:
9595
</iframe>
9696
</div>
9797

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+
98102
## Using a Custom Widget
99103
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:
100104

@@ -167,7 +171,7 @@ FlutterFlow also allows you to view your custom widget once it is successfully c
167171
To learn more about Custom Widget settings, such as the
168172
[**Exclude From Compilation toggle**](custom-code.md#exclude-from-compilation),
169173
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
171175
[**comprehensive guide**](custom-code.md).
172176
:::
173177

docs/resources/control-flow/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ data or performing calculations. In FlutterFlow, you can use
7272

7373
* **[Actions](functions/action-flow-editor.md):** Sequence of Logic performed in response to
7474
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,
7676
page, or
7777
component.
7878

7979
* **Widget-specific Functions:** Functions applicable to various widgets that need specific
8080
actions, such as scrolling to an item in a ListView, clearing text fields, or calling third-party
8181
integration functions.
8282

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
8484
the action flow editor.
8585

8686
* **[Navigation:](../../ff-concepts/navigation-routing/nav-overview.md)** Functions that handle

docs/resources/data-representation/global-properties.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ keywords: [Global Properties, FlutterFlow, Data Representation]
99

1010
# Global Properties
1111

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

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

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**.
17+
18+
<p></p>
1719

1820
![global-properties.avif](../imgs/global-properties.avif)
1921

20-
:::note
21-
Global properties are exposed by FlutterFlow. You can't create one by yourself.
22+
:::caution
23+
Global properties are built-in variables exposed by FlutterFlow. You can't create one by yourself.
2224
:::
2325

2426
## List of Global Properties

docs/resources/data-representation/overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Overview
44
description: Explore the essentials of data representation in app development, focusing on the use of variables in FlutterFlow.
55
tags: [Data Representation, FlutterFlow, Variables]
66
sidebar_position: 0
7-
keywords: [Data Representation, FlutterFlow, Variables]
7+
keywords: [Data Representation, FlutterFlow, Variables, Data Types, Global Data, Encapsulation]
88
---
99

1010
# Overview
@@ -28,7 +28,7 @@ Variables are used in practically all areas of the app, from the user interface
2828

2929
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.
3030

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).
3232

3333
### Setting and using variables
3434

@@ -52,9 +52,9 @@ Learn more about data types [**here**](data-types.md).
5252

5353
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.
5454

55-
## Global data
55+
## Global Properties
5656

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

5959
## Encapsulation
6060

docs/resources/ui/components/custom-components/component-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ created.
7070

7171
:::note[STATE VARIABLES]
7272
A state variable holds information or data about your UI at any given moment. To learn more
73-
about **states and state management, [refer here.](../../../../ff-concepts/state-management/generated-code.md)**
73+
about **states and state management, [refer here.](../../../../ff-concepts/state-management/state-variables.md)**
7474
:::
7575

7676
**Component state** refers to the information that a component tracks about its current condition or

docs/resources/ui/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ A Page usually contains a combination of widgets and components.
6060
![everything-widget.png](imgs%2Feverything-widget.png)
6161

6262
Let's talk about widgets first,
63-
which are the the atomic elements or building blocks of the UI structure in FlutterFlow.
63+
which are the atomic elements or building blocks of the UI structure in FlutterFlow.
6464

6565
Each widget can be thought of as an atom or a molecule, depending on its complexity and its parent-child
6666
relationship. For example, an atomic widget (such as `TextField`) cannot hold a child element, but

docs/resources/ui/pages/page-elements.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and offers customization with a variety of styles and functionalities.
2222

2323
The AppBar is divided into the following sections:
2424

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.
2626
- **Title:** Primarily serves to indicate the content of the active screen or to display the
2727
name of the application, aiding users in recognizing their context within the app. This section
2828
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:
5757
</iframe>
5858
</div>
5959

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+
6071
## Floating Action Button (FAB)
6172

6273
**Floating Action Button (FAB)** is a distinctive circular button that hovers over content, commonly

docs/resources/ui/pages/page-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ trigger specific actions in response to a phone shake gesture.
101101

102102
:::note[State Variables]
103103
A state variable holds information or data about your UI at any given moment. To learn more
104-
about **states and state management, [refer here](../../../ff-concepts/state-management/generated-code.md)**
104+
about **states and state management, [refer here](../../../ff-concepts/state-management/state-variables.md)**
105105
:::
106106

107107

0 commit comments

Comments
 (0)