Skip to content

Commit 8221378

Browse files
committed
Separate out variables and create new content for it.
1 parent 589f8ee commit 8221378

12 files changed

+458
-45
lines changed

docs/resources/data-representation/app-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: /resources/data-representation/app-state
33
title: App State
44
description: Learn how to effectively utilize App State Variables in FlutterFlow to maintain and manage global application states across all pages and components.
55
tags: [App State, FlutterFlow, Data Representation]
6-
sidebar_position: 4
6+
sidebar_position: 5
77
keywords: [App State, FlutterFlow, Data Representation]
88
---
99

docs/resources/data-representation/constants.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: /resources/data-representation/constants
33
title: Constants
44
description: Explore the importance of using Constants in FlutterFlow to define unchanging values throughout your application.
55
tags: [Constants, FlutterFlow, Data Representation]
6-
sidebar_position: 5
6+
sidebar_position: 6
77
keywords: [Constants, FlutterFlow, Data Representation]
88
---
99

docs/resources/data-representation/custom-data-types.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: /resources/data-representation/custom-data-types
33
title: Custom Data Types
44
description: Learn how to create and utilize custom data types in FlutterFlow to handle complex data structures that predefined types can't cover.
55
tags: [Custom Data Types, FlutterFlow, Data Representation]
6-
sidebar_position: 2
6+
sidebar_position: 3
77
keywords: [Custom Data Types, FlutterFlow, Data Representation]
88
---
99

@@ -21,13 +21,11 @@ Custom data types have several key advantages:
2121
- **Efficient**: Simplifies complex data handling, reducing errors and redundant code.
2222

2323
:::info
24-
2524
- Use custom data type when predefined data types, such as _integer_ and _string_ may not be enough to store certain kinds of information.
2625
- FlutterFlow also supports some [**Built-in Data Types**](data-types.md#built-in-data-types).
27-
2826
:::
27+
![custom-data-types.avif](..%2Fimgs%2Fcustom-data-types.avif)
2928

30-
![custom data type](../imgs/custom-data-type.avif)
3129
When you create a custom data type, it internally creates a Struct. A struct, or structure, is a composite data type that lets you combine fields of different data types to construct a data structure to suit your specific needs.
3230

3331
:::info

docs/resources/data-representation/data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: /resources/data-representation/data-types
33
title: Data Types
44
description: Dive into the diverse range of data types supported by FlutterFlow, from basic primitives like integers and strings to complex composite types and built-in functionalities tailored for app development.
55
tags: [Data Types, FlutterFlow, Data Representation]
6-
sidebar_position: 1
6+
sidebar_position: 2
77
keywords: [Data Types, FlutterFlow, Data Representation]
88
---
99

docs/resources/data-representation/enums.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: /resources/data-representation/enums
33
title: Enums
44
description: Learn how Enums can enhance the management of application states, product types, and process statuses by providing a robust method to handle predefined sets of values.
55
tags: [Enums, FlutterFlow, Data Representation]
6-
sidebar_position: 3
6+
sidebar_position: 4
77
keywords: [Enums, FlutterFlow, Data Representation]
88
---
99

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

Lines changed: 236 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ slug: /resources/data-representation/global-properties
33
title: Global Properties
44
description: Discover the role of Global Properties in FlutterFlow, which provide universal access across all pages of your app to facilitate common tasks and enhance functionality.
55
tags: [Global Properties, FlutterFlow, Data Representation]
6-
sidebar_position: 6
6+
sidebar_position: 7
77
keywords: [Global Properties, FlutterFlow, Data Representation]
88
---
99

@@ -27,23 +27,250 @@ Global properties are built-in variables exposed by FlutterFlow. You can't creat
2727

2828
A list of all the available global properties is as follows:
2929

30-
- **Is User Logged In:** Indicates whether a user is currently logged into the app. Useful for providing exclusive features to registered users or adjusting UI elements based on login status.
31-
- **Current Time:** Retrieves the current date and time.
32-
- **Current Device Location:** Obtains the user's current location, useful for updating the user's position on Google Maps or storing in a backend database.
30+
- **Is User Logged In:** Indicates whether a user is currently logged into the app. Useful for providing exclusive features to registered users or adjusting UI elements based on login status. This property is only accessible if you have enabled authentication of any type.
31+
32+
- **Current Time**: Fetches the current date and time. Explore [custom formatting](#current-time) options to tailor the DateTime display to your needs.
33+
34+
- **Current Device Location:** Obtains he user's current location, ideal for updating their position on Google Maps or storing it in a backend database. [Check out examples](#current-device-location) on how to retrieve and save the current device location.
35+
3336
- **Link To Current Page:** Provides the deep link of the current page. Learn more about [adding deep links here](../../ff-concepts/navigation-routing/deep-dynamic-linking.md#adding-deep-link).
3437
- **Fraction of Screen Width:** Determines the proportional width of the device's screen.
3538
- **Fraction of Screen Height:** Determines the proportional height of the device's screen.
3639
- **Screen Width:** Provides the total width of the current device's screen in pixels.
3740
- **Screen Height:** Provides the total height of the current device's screen in pixels.
38-
- **Is Android:** Determines if the user is accessing the app on an Android device.
39-
- **Is iOS:** Determines if the user is accessing the app on an iOS device.
40-
- **Is Web:** Determines if the user is accessing the app through a web browser.
41+
- **Is Android:** Determines if the user is accessing the app on an Android device. See [example](#is-androidiosweb).
42+
- **Is iOS:** Determines if the user is accessing the app on an iOS device. See [example](#is-androidiosweb).
43+
- **Is Web:** Determines if the user is accessing the app through a web browser. See [example](#is-androidiosweb).
4144
- **Is Debug Mode:** Indicates if the app is currently running in debug mode, useful for displaying features or performing actions only during debugging.
4245
- **Is Dark Mode:** Checks if the app's current theme mode is set to dark.
4346
- **Is Light Mode:** Checks if the app's current theme mode is set to light.
44-
- **Is On-Screen Keyboard Visible:** Checks if the on-screen or soft keyboard is visible. This is helpful in making UI adjustments if keyboard is visible on screen.
47+
- **Is On-Screen Keyboard Visible:** Checks if the on-screen or soft keyboard is visible. This is helpful in making UI adjustments if keyboard is visible on screen. See a [quick example](#is-on-screen-keyboard-visible).
4548

4649

4750
:::tip[Generated Code]
4851
Learn more about the [**Generated Code**](../../ff-concepts/state-management/generated-code.md#global-state) behind Global Properties.
49-
:::
52+
:::
53+
54+
### Current Time
55+
56+
The **Current Time** property allows you to retrieve the current date and time. This option is available when the Source is set to Global Properties.
57+
58+
You can use this property to display the current date and time on the screen or pass it to a FlutterFlow or custom widget for further processing.
59+
60+
#### Custom formatting
61+
62+
Sometimes, you might need to display dates and times in a format that we don't support. This is where the custom date and time formatting comes into play. *Custom Format* enables you to represent date and time data in a multitude of ways.
63+
64+
For example, you can enter the text like '*yyyy/MM/dd || kk:mm*', and the date time will be displayed as '2023/07/25 || 10:30'.
65+
66+
In the above example, '*yyyy/MM/dd || kk:mm* is the custom format. Here's what it stands for:
67+
68+
- `yyyy` represents a four-digit year, like "2023".
69+
- `MM` is a two-digit month, such as "07" for July.
70+
- `dd` indicates a two-digit day, for instance, "25".
71+
- `kk` is for a two-digit hour in 24-hour format, like "10".
72+
- `mm` stands for a two-digit minute, such as "30".
73+
74+
Here are some more format specifiers that you can use the build the custom format:
75+
76+
- `d`: Day of the month. E.g., "2" for February 2nd.
77+
- `E`: Abbreviated weekday. E.g., "Mon" for Monday.
78+
- `EEEE`: Full weekday. E.g., "Monday".
79+
- `LLL`: Abbreviated standalone month. E.g., "Feb".
80+
- `LLLL`: Full standalone month. E.g., "February".
81+
- `M`: Month of year. E.g., "2" for February.
82+
- `Md`: Month and day. E.g., "2/2".
83+
- `MEd`: Abbreviated weekday, month, and day. E.g., "Mon, 2/2".
84+
- `MMM`: Abbreviated month. E.g., "Feb".
85+
- `MMMd`: Abbreviated month and day. E.g., "Feb 2".
86+
- `MMMEd`: Abbreviated weekday, month, and day. E.g., "Mon, Feb 2".
87+
- `MMMM`: Full month. E.g., "February".
88+
- `MMMMd`: Full month and day. E.g., "February 2".
89+
- `MMMMEEEEd`: Full month, weekday, day. E.g., "Monday, February 2".
90+
- `QQQ`: Abbreviated quarter. E.g., "Q1".
91+
- `QQQQ`: Full quarter. E.g., "1st quarter".
92+
- `y`: Year. E.g., "2023".
93+
- `yM`: Year and month. E.g., "2023/2".
94+
- `yMd`: Year, month, day. E.g., "2023/2/2".
95+
- `yMEd`: Weekday, year, month, day. E.g., "Mon, 2023/2/2".
96+
- `yMMM`: Abbreviated month and year. E.g., "Feb 2023".
97+
- `yMMMd`: Abbreviated month, day, year. E.g., "Feb 2, 2023".
98+
- `yMMMEd`: Weekday, month, day, year. E.g., "Mon, Feb 2, 2023".
99+
- `yMMMM`: Full month and year. E.g., "February 2023".
100+
- `yMMMMd`: Full month, day, year. E.g., "February 2, 2023".
101+
- `yMMMMEEEEd`: Weekday, full month, day, year. E.g., "Monday, February 2, 2023".
102+
- `yQQQ`: Abbreviated quarter, year. E.g., "Q1 2023".
103+
- `yQQQQ`: Full quarter, year. E.g., "1st quarter 2023".
104+
- `H`: Hour in day (24-hour). E.g., "15" for 3 PM.
105+
- `Hm`: Hour, minute (24-hour). E.g., "15:30".
106+
- `Hms`: Hour, minute, second (24-hour). E.g., "15:30:45".
107+
- `j`: Hour in day (12-hour). E.g., "3 PM".
108+
- `jm`: Hour, minute (12-hour). E.g., "3:30 PM".
109+
- `jms`: Hour, minute, second (12-hour). E.g., "3:30:45 PM".
110+
- `m`: Minute in hour. E.g., "30".
111+
- `ms`: Minute, second. E.g., "30:45".
112+
- `s`: Second in minute. E.g., "45".
113+
- `G`: Era designator. E.g., "AD" in "AD 2023".
114+
- `L`: Standalone month. E.g., "7" for July.
115+
- `c`: Standalone day. E.g., "2" for Tuesday.
116+
- `h`: Hour in AM/PM (1~12). E.g., "3" for 3 AM.
117+
- `H`: Hour in day (0~23). E.g., "15" for 3 PM.
118+
- `S`: Fractional second. E.g., "123" for 123 milliseconds.
119+
- `D`: Day in year. E.g., "50" for the 50th day of the year.
120+
- `a`: AM/PM marker. E.g., "AM" or "PM".
121+
- `k`: Hour in day (1~24). E.g., "24" for midnight.
122+
- `K`: Hour in AM/PM (0~11). E.g., "0" for 12 AM.
123+
- `Q`: Quarter. E.g., "4" for the fourth quarter.
124+
125+
:::info
126+
For more detailed information, please refer to the [DateFormat class documentation](https://pub.dev/documentation/intl/latest/intl/DateFormat-class.html).
127+
:::
128+
129+
![img.png](..%2Fimgs%2Fimg.png)
130+
131+
### Current Device Location
132+
133+
This property is used to get the current device location (aka geolocation). You can access this when the **Source** is set to **Global Properties**.
134+
135+
You can use this property to get the user's current location to update on Google Maps or store it in the backend database.
136+
137+
:::warning
138+
At present, testing this property isn't possible in Test mode, but you can use the Run mode for this purpose. To run it on Android, iOS or desktop platforms, use [Local Run](../../testing-deployment-publishing/running-your-app/local-run.md).
139+
:::
140+
141+
142+
143+
#### Get Current Device Location: Example
144+
145+
Let's see an example of getting the current device location and passing it to a widget (that supports accepting LatLong, for example, Google Maps).
146+
147+
Here is an example of how you can retrieve the current device location:
148+
149+
1. Select the **widget** (e.g., GoogleMap) from the widget tree or canvas area.
150+
2. Move to the properties panel, find the **Initial Location** property, and click on **Set from Variable**.
151+
3. Set the **Source** to **Global Properties**.
152+
4. Set the **Available Options** to the **Current Device Location**.
153+
5. Click **Confirm**.
154+
155+
<div style={{
156+
position: 'relative',
157+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
158+
height: 0,
159+
width: '100%'
160+
}}>
161+
<iframe
162+
src="https://demo.arcade.software/Ab5qrwm0dPxrU8VfZYXr?embed&show_copy_link=true"
163+
title=""
164+
style={{
165+
position: 'absolute',
166+
top: 0,
167+
left: 0,
168+
width: '100%',
169+
height: '100%',
170+
colorScheme: 'light'
171+
}}
172+
frameborder="0"
173+
loading="lazy"
174+
webkitAllowFullScreen
175+
mozAllowFullScreen
176+
allowFullScreen
177+
allow="clipboard-write">
178+
</iframe>
179+
</div>
180+
181+
<p></p>
182+
183+
#### Save the Current Device Location: Example
184+
185+
Here's how you can save the user's current location (Geolocation) in the Firestore document.
186+
187+
1. Create a **LatLng** field in your Firestore Schema.
188+
189+
<div style={{
190+
position: 'relative',
191+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
192+
height: 0,
193+
width: '100%'
194+
}}>
195+
<iframe
196+
src="https://demo.arcade.software/iUAVKZ8OwWDlRZ6H8LbT?embed&show_copy_link=true"
197+
title=""
198+
style={{
199+
position: 'absolute',
200+
top: 0,
201+
left: 0,
202+
width: '100%',
203+
height: '100%',
204+
colorScheme: 'light'
205+
}}
206+
frameborder="0"
207+
loading="lazy"
208+
webkitAllowFullScreen
209+
mozAllowFullScreen
210+
allowFullScreen
211+
allow="clipboard-write">
212+
</iframe>
213+
</div>
214+
215+
<p></p>
216+
217+
2. After this, you need to set this field from a variable source and select **Current Device Location** from the **Global Properties**.
218+
219+
<div style={{
220+
position: 'relative',
221+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
222+
height: 0,
223+
width: '100%'
224+
}}>
225+
<iframe
226+
src="https://demo.arcade.software/qoVy38WlG6zrHHv3PRHQ?embed&show_copy_link=true"
227+
title=""
228+
style={{
229+
position: 'absolute',
230+
top: 0,
231+
left: 0,
232+
width: '100%',
233+
height: '100%',
234+
colorScheme: 'light'
235+
}}
236+
frameborder="0"
237+
loading="lazy"
238+
webkitAllowFullScreen
239+
mozAllowFullScreen
240+
allowFullScreen
241+
allow="clipboard-write">
242+
</iframe>
243+
</div>
244+
245+
### Is Android/iOS/Web
246+
247+
Use these properties when you want to tailor the user experience for specific platforms. These properties determine whether the user is accessing the app on Android, iOS, or the Web. Knowing the user's platform is essential for customizing functionality to suit each environment. For instance, certain custom widgets or actions might be exclusive to Android.
248+
249+
These properties allow you to implement platform-specific features and ensure your app behaves optimally across different devices. Some examples:
250+
251+
- **Is Android**: Enable a custom push notification feature that only works on Android devices. By checking if the platform is Android, you can conditionally display a setup screen for this feature.
252+
253+
- **Is iOS**: Optimize custom animations or gestures specifically for iOS. By detecting if the user is on an iOS device, you can enable these iOS-specific interactions while providing alternatives for other platforms.
254+
255+
- **Is Web**: Implement a file upload feature with a drag-and-drop interface optimized for desktop environments. By checking if the platform is Web, you can provide an enhanced file handling experience that suits web users.
256+
257+
### Is On Screen Keyboard Visible
258+
259+
This property helps check if the on-screen or soft keyboard is visible on screen. You can access this when the Source is set to Global Properties.
260+
261+
#### Hiding bottom navigation bar when a keyboard is visible: Example
262+
Consider an app where users can input dog details, and a custom bottom navigation bar is present. When users enter dog details, the on-screen keyboard appears, causing the bottom navigation bar to appear over the keyboard. To optimize screen space and improve the user experience, you might want to hide the bottom navigation bar in such instances.
263+
264+
Here's how it looks:
265+
266+
<div class="video-container"><iframe src="https://www.loom.
267+
com/embed/25c52f020c154bf8a8e8acb3b138677e?sid=8670a445-a2fe-4996-81bd-36fea5ac8117" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
268+
269+
<p></p>
270+
271+
To build such behavior, you can add [Conditional Visibility](../../resources/ui/widgets/widget-commonalities.md#conditional) on the bottom navigation. While adding, use the "Is On-Screen Keyboard Visible" that will hide the bottom navigation bar whenever the keyboard is displayed.
272+
Using "Is On-Screen Keyboard Visible" to hide bottom navigation
273+
274+
<div class="video-container"><iframe src="https://www.loom.
275+
com/embed/8458a825c31c4f18951a8351ee9e408d?sid=f92c9cad-1c4f-4431-8854-bfe648996731" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
276+

0 commit comments

Comments
 (0)