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
"Hero" is a widget that gracefully transitions from one screen to another. For instance, on a product listing page, clicking on a product's image triggers a smooth animation where the image flies to a new screen, revealing detailed information about the product.
9
+
10
+
To add a hero animation you'll need to have the widget present on two screens. On the first page, you'll need to use the Hero Animation checkbox in the properties panel. You'll specify a hero tag
The animation that plays while going from one page of the app to another is known as the navigation transition. While defining a Navigate To Action on any widget, you will notice the transition type is set as Default but you can change that animation easily.
7
+
8
+
You can choose from any of the following transition animations:
9
+
10
+
<!-- gif -->
11
+
12
+
13
+
Here, the transitions are recorded with the duration set to 1000ms to make the animation clearly visible. But inside the app, it's recommended to keep the duration between 200-400ms.
14
+
15
+
16
+
Apply single navigate transition
17
+
To set a transition animation for a single navigate action, follow the steps below:
18
+
19
+
Select a widget on which you want to set the navigation action.
20
+
From the Properties Panel (right), click on +Add inside the Actions section.
21
+
Make sure you have the On Tap tab selected on top.
22
+
Click + Add Action.
23
+
Set the action as Navigate To and choose the page you want the user to be navigated to from the dropdown.
24
+
To change the transition animation, select an animation from the Transition Type dropdown.
25
+
By default, the animations use 300 milliseconds as the duration for which it plays but you can change it by specifying a value inside the Duration (ms) field.
26
+
Click Close.
27
+
28
+
29
+
Change global navigate transition
30
+
To change the default transition animation of your entire app, follow the steps below:
31
+
32
+
Go to the Settings and Integrations page from the Navigation Menu (right).
33
+
Under the General section, select App Details.
34
+
In the Navigation Transition section, check Override Default Transition.
35
+
Now, you can set the Transition Type and Duration from here.
36
+
While defining any Navigate To action, use the Default transition type. FlutterFlow will automatically pick up the global transition animation that you have set.
|**Fade**| Makes the widget gradually appear or disappear. It's widely used for smooth introductions of elements on the screen and to focus user attention by fading in or out content or UI elements.| <imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" />|`Opacity`: the starting or ending visibility of the widget, where 0 is fully transparent and 1 is fully visible|
49
+
|**Fade**| Makes the widget gradually appear or disappear. It's widely used for smooth introductions of elements on the screen and to focus user attention by fading in or out content or UI elements.| <imgsrc={fadeGif}class="xsmall-image"alt="Alt text for your GIF" />|`Opacity`: the starting or ending visibility of the widget, where 0 is fully transparent and 1 is fully visible|
37
50
|**Slide**| Changes the widget's position on the screen. Typically used to introduce widget in a dynamic, visually engaging way, like sliding in menus, pages, or notifications. FlutterFlow supports both vertical and horizontal slide. | <imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Position`: where 0 specifies the widget's current position, -100 specifies 100px to the left (horizontal) or down (vertical), and 100 specifies 100px to the right (horizontal) or up (vertical). <br></br> <br></br> *To make the widget come and go off the screen, make the start and/or final position greater than the width of the device.*|
38
-
|**Scale**| Changes the size of the widget. Often used to draw attention to UI components, like magnifying buttons on hover or animating dialog boxes to appear from a central point. |<imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" />|`Scale`: the starting or ending multiple to scale the widget horizontally (X) or vertically (Y), where 1 represents the current size of the widget. |
39
-
|**Rotate**| Turns the widget clockwise or aniclockwise. It's often used for simple effects like spinning a loading icon.| <imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Turns`: specifies the number of 360 degree rotations. |
40
-
|**Shake**| Creates the shake effect on a widget. Often used to draw attention to an element or indicate an error, like when a user enters incorrect information in a form field.| <imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" />|`Freqeuncy`: Number of shakes per second <br></br> <br></br>`Offset`: Shake distance, a higher value intensifies and a negative value shakes the opposite direction <br></br> <br></br>`Rotation Angle`: Angle of the shake|
41
-
|**Blur**| Creates a focus or un-focus effect on a widget | <imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Radius (X or Y)`: Size of the blur. <br></br><br></br> *To create an unfocus effect, `Final Radius` should be greater than `Initial Radius`. To create a focus effect, `Initial Radius` should be greater than `Final Radius`*. |
42
-
|**Saturate**| Used to enhance visual appeal by making colors more vibrant for focused content or creating a muted effect for background elements. |<imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Strength`: 0 indicates fully desaturated, 100 represents normal saturation and >100 represent the percent saturation |
43
-
|**Tilt**| Creates a transforming effect (3D perspective) on your widget| <imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" /> |...|
44
-
|**Flip**|Creates a flip effect on a widget| <imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" /> |...|
45
-
|**Shimmer**| Creates a shimmer effect on a widget | <imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" /> |...|
46
-
|**Tint**|Creates a color changing effect on a widget|<imgsrc={slideGif}class="xsmall-image"alt="Alt text for your GIF" /> |...|
51
+
|**Scale**| Changes the size of the widget. Often used to draw attention to UI components, like magnifying buttons on hover or animating dialog boxes to appear from a central point. |<imgsrc={scaleGif}class="xsmall-image"alt="Alt text for your GIF" />|`Scale`: the starting or ending multiple to scale the widget horizontally (X) or vertically (Y), where 1 represents the current size of the widget. |
52
+
|**Rotate**| Turns the widget clockwise or aniclockwise. It's often used for simple effects like spinning a loading icon.| <imgsrc={rotateGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Turns`: specifies the number of 360 degree rotations. |
53
+
|**Shake**| Creates the shake effect on a widget. Often used to draw attention to an element or indicate an error, like when a user enters incorrect information in a form field.| <imgsrc={shakeGif}class="xsmall-image"alt="Alt text for your GIF" />|`Freqeuncy`: Number of shakes per second <br></br> <br></br>`Offset`: Shake distance, a higher value intensifies and a negative value shakes the opposite direction <br></br> <br></br>`Rotation Angle`: Angle of the shake|
54
+
|**Blur**| Creates a focus or un-focus effect on a widget | <imgsrc={blurGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Radius (X or Y)`: Size of the blur. <br></br><br></br> *To create an unfocus effect, `Final Radius` should be greater than `Initial Radius`. To create a focus effect, `Initial Radius` should be greater than `Final Radius`*. |
55
+
|**Saturate**| Used to enhance visual appeal by making colors more vibrant for focused content or creating a muted effect for background elements. |<imgsrc={saturateGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Strength`: 0 indicates fully desaturated, 100 represents normal saturation and >100 represent the percent saturation |
56
+
|**Tilt**| Creates a transforming effect (3D perspective) on your widget. Typically used to add a subtle interactive element to UI components, like buttons or cards, indicating user interaction or focus. | <imgsrc={tiltGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Tilt`: The angle at which the widget is viewed. |
57
+
|**Flip**|Flip animation rotates an element around its horizontal or vertical axis, creating a mirror effect. It's often used for flipping cards in a UI to reveal hidden information. | <imgsrc={flipGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Flip`: The angle at which the widget is viewed. |
58
+
|**Shimmer**| Creates a "shiny" effect moving across the screen, often used to signify that data or content is in the process of loading or being fetched. | <imgsrc={shimmerGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Color`: The color of the "shiny" line or gradient that sweeps of the widget. A common practice is to use a slightly lighter shade than the content. <br></br> <br></br> `Angle`: Determines the direction of the shimmer effect across the content. 0 degrees for horizontal and 90 for vertical. |
59
+
|**Tint**|Adds a color overlay effect to your content.|<imgsrc={tintGif}class="xsmall-image"alt="Alt text for your GIF" /> |`Color`: Color of the overlay. <br></br> <br></br> `Strength`: Intensity of the tint. |
47
60
48
61
## Animation curves
49
62
When applying an animation, you'll also be able to specify the curve. An animation curve is essentially a mathematical formula used to interoplate values over time. Changing the animation curve allows you to control the speed and style of the animation.
50
63
64
+
<imgsrc={animationCurves}alt="Alt text for your GIF" />
65
+
66
+
<br></br>
67
+
<br></br>
68
+
FlutterFlow supports a variety of animation curves:
69
+
51
70
| Curve | Description
52
71
| ----- | ----- |
53
72
|**Ease In**| Starts the animation slowly and then accelerates towards the end. It's useful for creating an effect where the motion begins gently and speeds up.|
@@ -58,32 +77,45 @@ When applying an animation, you'll also be able to specify the curve. An animati
58
77
|**Linear**| Progresses at a constant speed throughout the animation. It provides a uniform transition from start to end, with no acceleration or deceleration.|
59
78
60
79
61
-
## Triggering an animation on page load
80
+
## How to trigger an animation on page load
62
81
There are many cases when you might want to trigger an animation when a page or (in the case of a delayed load) widget is loaded onto the screen.
63
82
64
-
Consider an eCommerce use case, where a backend query is used retrieve a list of trending products. There may be some delay between when the page is first loaded and when the actual results are displayed. To improve the user experience we can add some animations to let users know when content is loading, and smoothly transition between a loading widget and a widget that displays the retreived content.
83
+
Consider an eCommerce use case, where a backend query is used retrieve a list of trending products. There may be some delay between when the page is first loaded and when the actual results are displayed. To improve the user experience we can add some animations to let users know when content is loading.
65
84
66
85
<imgsrc={shimmerAnimationFinal}class="small-image"alt="A widget that first shows a container with a shimmer effect, then fades in a widget displaying the product details" />
67
86
68
-
To create an experience like this, we need to:
87
+
To create an experience like this, you need to add a shimmer animation to a widget, and display that widget conditionally (i.e. when the query is loading).
88
+
89
+
<!-- add aracde -->
90
+
91
+
92
+
## Triggering an animation as part of an action flow
93
+
Beyond triggering widget animations on load, you can trigger an animation to occur as part of an action.
69
94
70
-
1. Add a shimmer animation to a widget, and display that widget when the query is loading.
95
+
For example, say you want a like button to be enlarged when a user clicks it.
71
96
97
+
<imgsrc={shimmerAnimationFinal}class="small-image"alt="A widget that first shows a container with a shimmer effect, then fades in a widget displaying the product details" />
72
98
73
-
2. Add a fade animation to the widget that displays the query result, to gradually present it on the screen.
99
+
To create an experience like this, you need to add a a scale effect to the icon button, and trigger it when the button is clicked.
74
100
101
+
<!-- add aracde -->
75
102
103
+
:::note You can give a name to the widget that you want to animate using the action, this will make it easier to find in the action menu::::
76
104
77
105
78
-
## Triggering an animation as part of an action flow
79
-
Beyond triggering widgetanimations on load, you can trigger an animation to occur as part of an action.
106
+
## Applying multiple animations within a single page
107
+
You can apply multiple animations to a single widget. By default, animations are applied at the same time. However, you can stagger animations on a single widget by adding a delay to subsequent animations.
80
108
81
-
For example, say you want a like button to be enlarged when a user clicks it.
109
+
<!-- add diagram that shows how animations run subsequently -->
82
110
111
+
You can also apply animations to multiple widgets on a single page. As above, animations are applied at the same time. However, you can ensure that one widget's animation runs after a second widget's animation by
83
112
113
+
<!-- add diagram that shows how animations run subsequently -->
84
114
85
-
## Staggering animations
115
+
## Setting animation values from variables
116
+
Animation values can be hard-coded or set through a variable to make them dynamic.
86
117
118
+
<!-- add arcade -->
87
119
88
120
## Widget animations in generated code
89
121
FlutterFlow uses the flutter_animate package in the generated code to apply the animation to the widget.
0 commit comments