Skip to main content

Global Properties

Global properties are built-in variables that you can use across all pages of your FlutterFlow app. FlutterFlow defines these properties; you can't create your own or assign values to them.

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.

You can access these properties through Set from Variable > Global Properties.

List of Global Properties​

The following global properties are available:

  • Is User Logged In: Indicates whether a user is currently logged into the app. Use this value to show content or features based on login status. This property is only accessible if you have enabled authentication.

  • Current Time: Returns the current date and time. Use custom formatting to control how the value is displayed.

  • Current Device Location: Returns the user's current location. See how to use the location as a map's initial location.

  • Link To Current Page: Provides the Deep Link of the current page.

  • Current Route Path: Provides the route name of the currently visible page. Use this value to check which page is active before running an action. For example, a push notification might open another page while the home page's On Page Load actions are running. See the example of checking the active route.

  • Current Route Stack: Returns the route names in the app's navigation stack. Use this list for custom back navigation, breadcrumbs, or navigation analytics.

  • Fraction of Screen Width: Returns a specified fraction of the screen width. For example, half the screen width can be used to size a widget to 50% of the available width.

  • Fraction of Screen Height: Returns a specified fraction of the screen height. For example, half the screen height can be used to size a widget to 50% of the available height.

  • Screen Width: Returns the screen width in logical pixels, not physical display pixels.

  • Screen Height: Returns the screen height in logical pixels, not physical display pixels.

  • Is Android: Determines if the user is accessing the app on an Android device. Refer here.

  • Is iOS: Determines if the user is accessing the app on an iOS device. Refer here.

  • Is Web: Determines if the user is accessing the app through a web browser. Refer here.

  • Is Debug Mode: Indicates if the app is currently running in debug mode, useful for displaying features or performing actions only during debugging.

  • Is Dark Mode: Checks if the app's current theme mode is set to dark.

  • Is Light Mode: Checks if the app's current theme mode is set to light.

  • Is On-Screen Keyboard Visible: Checks whether the on-screen keyboard is visible. Use this value to adjust the layout when the keyboard opens. See the bottom navigation example.

  • Current Environment: Returns the current development environment value.

Generated Code

Learn more about the Generated Code behind Global Properties.

Current Time​

The Current Time property returns the current date and time. This option is available when Source is set to Global Properties.

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.

Custom Formatting​

Use Custom Format when you need a date or time format that isn't available among the predefined options.

For example, the custom pattern yyyy/MM/dd || kk:mm displays July 25, 2023, at 10:30 AM as 2023/07/25 || 10:30. The pattern uses these symbols:

  • yyyy represents a four-digit year, like 2023.
  • MM is a two-digit month, such as 07 for July.
  • dd indicates a two-digit day, for instance, 25.
  • kk represents a two-digit hour from 01 to 24, with midnight represented as 24.
  • mm stands for a two-digit minute, such as 30.

Use HH instead of kk for hours from 00 to 23, with midnight represented as 00.

The following explicit patterns show common formats. Example output uses July 25, 2023, at 10:30:45 AM in an English locale.

Custom PatternExample Output
yyyy/MM/dd2023/07/25
dd/MM/yyyy25/07/2023
MMM d, yyyyJul 25, 2023
MMMM d, yyyyJuly 25, 2023
EEEE, MMMM d, yyyyTuesday, July 25, 2023
HH:mm10:30
HH:mm:ss10:30:45
h:mm a10:30 AM

Explicit patterns control field order and separators. Month and weekday names depend on the locale. DateFormat also supports locale-adaptive skeletons, such as yMd and jm. A skeleton's output depends on the locale; jm can use either 12-hour or 24-hour time.

info

For more patterns and information about skeletons, see the DateFormat class documentation.

Current Device Location​

Current Device Location returns the device's location as latitude and longitude. You can access it when Source is set to Global Properties.

Use this value to display the user's location on a map or store it in a backend database.

warning

Use Run mode to test this property; it isn't supported in Test mode. To test on Android, iOS, or desktop platforms, use Local Run.

For example, use the device's location as the initial location of a GoogleMap widget, which accepts a LatLng value:

  1. Select the GoogleMap widget in the widget tree or on the canvas.
  2. In the properties panel, find Initial Location and click Set from Variable.
  3. Set the Source to Global Properties.
  4. Set Available Options to Current Device Location.
  5. Click Confirm.

Is Android/iOS/Web​

Use Is Android, Is iOS, and Is Web in visibility conditions or conditional actions to customize behavior for each platform. Each property returns a Boolean value.

  • Is Android: Show Android-specific instructions or run an action intended for the Android app when this property is true.
  • Is iOS: Show iOS-specific instructions or run an action intended for the iOS app when this property is true.
  • Is Web: Show browser-specific instructions when this property is true. A web app can run in a desktop or mobile browser, so this property doesn't indicate the screen size.

Is On-Screen Keyboard Visible​

Is On-Screen Keyboard Visible returns true when the on-screen keyboard is visible and false when it is hidden. You can access it when Source is set to Global Properties.

Hide Bottom Navigation When the Keyboard Is Visible​

For example, an app with a dog-details form can hide its custom bottom navigation bar while the user types in a text field.

Here's how it looks:

Add Conditional Visibility to the custom bottom navigation. Set the condition to show the navigation only when Global Properties > Is On-Screen Keyboard Visible is false. This keeps the navigation visible when the keyboard is hidden and hides it when the keyboard opens.