SlideShare a Scribd company logo
1 of 25
Animate With
Khushbu Thakker
@KhushbuThakker
Android & Flutter Developer
Hyperlink Infosystem
khushbuthakker1210@gmail.com
https://github.com/khushbuThak
ker/
What is Animation??
● Animated c
● Using Animation makes your application more interactive and
makes your users excited to use the application.
● Today we cannot imagine any Mobile App without animations.
When you move from one page to another, tap a Button (or
InkWell)… there is an animation. Animations are everywhere.
● Ex: Twitter Likes animation, ioS swipe down list animation
(Bouncing animation), Barchart animation , Facebook shimmer
effect
Two Categories
Tween Animation Physics Based-
Animation
Implicit Animation
● Flutter includes a series of widgets that are animated version of existing that
you are:
● These widgets automatically animate changes to their properties
When you rebuild the widget with new value with Stateful widget’s set state,
widget will handle animation from previous value to new value
○ Align -> AnimatedAlign , Container -> AnimatedContainer
○ DefaultTextStyle -> AnimatedDefaultTextStyle
○ Opacity -> AnimatedOpacity
○ Padding -> AnimatedPadding, Positioned -> AnimatedPositioned
Three Pillar of Animation
1. The Ticker
2. An Animation
3. An Animation Controller
Animation Class
● Flutter renders everything to the screen itself without depend on native views
● An Animation is nothing else but a value (of a specific type) that can change
over the lifetime of the animation.
● With Flutter’s animation library, you can add motion and create visual
effects for the widgets in your UI.
● It is unaware of what is happening on the screen because it’s not bound to
any view on the screen, But it has listeners to check out the state of the
animation during each frame change.
Animation Controller
● An animation controller is, as the name suggests, a way to control (trigger,
fling or stop) an animation.
● The Animation Controller : Subclass of Animation.
● Define the Lower bound and Upper bound (Default : 0 to 1)
● Needs Ticker Provider
● Every Flutter animation needs at least two elements to be created:
A Tween to get generate values for the animation
An Animation Controller as parent
● The Animation Controller also gives us control over how the animation
behaves.
○ Dismissed - stopped at the beginning
○ Forward - animating in forward direction (0 to 1)
○ Completed - stopped at the end
○ Reverse - animating from 1 to 0
The Ticker
● In simple words, a Ticker is a class which sends a signal at almost regular
interval (around 60 times per second). Think of your watch which ticks at
each second.
● At each tick, the Ticker invokes callback method(s) with the duration since
the first tick, after it was started.
IMPORTANT
All tickers, even if started at different times, will always be synchronized.
This is very useful to synchronize animations
Tween Animation
● Short for in-betweening.
● In tthe beginning and ending points are defined, as well as a timeline, and a
curve that defines the timing and speed of the transition. The framework
calculates how to transition from the beginning point to the end point.
● Changing the value range and even the type of the output value (e.g. to a
Color) is possible with a Tween. There are many pre-built ones such as
ColorTween or TextStyleTween.
Initial
Final
-
Hero Widget
Key Points
● Widget that flies from one screen to another
● This animation style is commonly known as Shared element transitions or Shared element
animations
● Two hero widgets in different routes with same tag name
● Navigator manages stack containing app’s routes
● Pushing or Popping a route triggers the animation
● timeDelation property makes the animation slow as per our given time
Behind the scenes - How Hero works?
- Before transition, source Hero waits in source route widget tree.
- Overlay is Empty.
- Destination route does not yet exists.
Pushing route to navigator triggers animation at t = 0.0
- Calculates Destination Hero’s path, off screen,u sing curved motion
- Places Destination Hero in Overlay, at same location and size as Source Hero
- As hero flies, its rectangular bounds are animated using
CreateRectTween property
When flight completes
- Hero widget will be moved from Overlay to Destination.
- Overlay is empty now.
- Destination Hero appears in its final position in the Destination route.
- Source Hero is restored to its route.
1) Standard Hero Animation
- Specify route using MaterialPageRoute, CupertinoPageRoute or custom route
using PageRouteBuilder
- Change the size of Image at the end of Transition by wrapping the
Destination’s Image in SizedBox
- Change the location of the Image by placing the Destination’s Image in a
Layout Widget
2) Radial Hero Animation
- Animates Circular shape into Square shape
- MaterialRectCenterArcTween defines the tween animation by interpolating
two tweens using the center point of each Hero
- Build destination route using PageRouteBuilder
Dhruva Shastri
@dhruvashastri12
Business Developer
All Events
Ambassador
WTM Ahmedabad
Animation With Flutter.pptx

More Related Content

Similar to Animation With Flutter.pptx

Scct2013 topic 4_animation
Scct2013 topic 4_animationScct2013 topic 4_animation
Scct2013 topic 4_animation
Anies Syahieda
 
Graphical Animation - Lesson 2
Graphical Animation - Lesson 2Graphical Animation - Lesson 2
Graphical Animation - Lesson 2
Jamie Hutt
 
Advanced animation techniques
Advanced animation techniquesAdvanced animation techniques
Advanced animation techniques
Charles Flynt
 

Similar to Animation With Flutter.pptx (20)

Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
 
Trends in Computer Graphics
Trends in Computer GraphicsTrends in Computer Graphics
Trends in Computer Graphics
 
Unit vi
Unit viUnit vi
Unit vi
 
CSS Animations & Transitions
CSS Animations & TransitionsCSS Animations & Transitions
CSS Animations & Transitions
 
Procedure of animation in 3 d autodesk maya tools & techniques
Procedure of animation in 3 d autodesk maya tools & techniquesProcedure of animation in 3 d autodesk maya tools & techniques
Procedure of animation in 3 d autodesk maya tools & techniques
 
How to implement react native animations using animated api
How to implement react native animations using animated apiHow to implement react native animations using animated api
How to implement react native animations using animated api
 
Animation
AnimationAnimation
Animation
 
Unity animation workshop 2021-22
Unity animation workshop 2021-22Unity animation workshop 2021-22
Unity animation workshop 2021-22
 
Scct2013 topic 4_animation
Scct2013 topic 4_animationScct2013 topic 4_animation
Scct2013 topic 4_animation
 
Graphical Animation - Lesson 2
Graphical Animation - Lesson 2Graphical Animation - Lesson 2
Graphical Animation - Lesson 2
 
Animation
AnimationAnimation
Animation
 
animation
animationanimation
animation
 
Unity3d scripting tutorial
Unity3d scripting tutorialUnity3d scripting tutorial
Unity3d scripting tutorial
 
02 unity 3_d_part_1
02 unity 3_d_part_102 unity 3_d_part_1
02 unity 3_d_part_1
 
What is the Hero Class in Flutter Development.pptx
What is the Hero Class in Flutter Development.pptxWhat is the Hero Class in Flutter Development.pptx
What is the Hero Class in Flutter Development.pptx
 
Python lecture 10
Python lecture 10Python lecture 10
Python lecture 10
 
unity basics
unity basicsunity basics
unity basics
 
Animation
AnimationAnimation
Animation
 
Advanced animation techniques
Advanced animation techniquesAdvanced animation techniques
Advanced animation techniques
 
Animation
AnimationAnimation
Animation
 

Recently uploaded

CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
Muhammad Subhan
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Recently uploaded (20)

JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi Daparthi
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 

Animation With Flutter.pptx

  • 2. Khushbu Thakker @KhushbuThakker Android & Flutter Developer Hyperlink Infosystem khushbuthakker1210@gmail.com https://github.com/khushbuThak ker/
  • 3. What is Animation?? ● Animated c ● Using Animation makes your application more interactive and makes your users excited to use the application. ● Today we cannot imagine any Mobile App without animations. When you move from one page to another, tap a Button (or InkWell)… there is an animation. Animations are everywhere. ● Ex: Twitter Likes animation, ioS swipe down list animation (Bouncing animation), Barchart animation , Facebook shimmer effect
  • 4. Two Categories Tween Animation Physics Based- Animation
  • 5.
  • 6. Implicit Animation ● Flutter includes a series of widgets that are animated version of existing that you are: ● These widgets automatically animate changes to their properties When you rebuild the widget with new value with Stateful widget’s set state, widget will handle animation from previous value to new value ○ Align -> AnimatedAlign , Container -> AnimatedContainer ○ DefaultTextStyle -> AnimatedDefaultTextStyle ○ Opacity -> AnimatedOpacity ○ Padding -> AnimatedPadding, Positioned -> AnimatedPositioned
  • 7. Three Pillar of Animation 1. The Ticker 2. An Animation 3. An Animation Controller
  • 8. Animation Class ● Flutter renders everything to the screen itself without depend on native views ● An Animation is nothing else but a value (of a specific type) that can change over the lifetime of the animation. ● With Flutter’s animation library, you can add motion and create visual effects for the widgets in your UI. ● It is unaware of what is happening on the screen because it’s not bound to any view on the screen, But it has listeners to check out the state of the animation during each frame change.
  • 9. Animation Controller ● An animation controller is, as the name suggests, a way to control (trigger, fling or stop) an animation. ● The Animation Controller : Subclass of Animation. ● Define the Lower bound and Upper bound (Default : 0 to 1) ● Needs Ticker Provider ● Every Flutter animation needs at least two elements to be created: A Tween to get generate values for the animation An Animation Controller as parent
  • 10. ● The Animation Controller also gives us control over how the animation behaves. ○ Dismissed - stopped at the beginning ○ Forward - animating in forward direction (0 to 1) ○ Completed - stopped at the end ○ Reverse - animating from 1 to 0
  • 11. The Ticker ● In simple words, a Ticker is a class which sends a signal at almost regular interval (around 60 times per second). Think of your watch which ticks at each second. ● At each tick, the Ticker invokes callback method(s) with the duration since the first tick, after it was started. IMPORTANT All tickers, even if started at different times, will always be synchronized. This is very useful to synchronize animations
  • 12. Tween Animation ● Short for in-betweening. ● In tthe beginning and ending points are defined, as well as a timeline, and a curve that defines the timing and speed of the transition. The framework calculates how to transition from the beginning point to the end point. ● Changing the value range and even the type of the output value (e.g. to a Color) is possible with a Tween. There are many pre-built ones such as ColorTween or TextStyleTween.
  • 15. Key Points ● Widget that flies from one screen to another ● This animation style is commonly known as Shared element transitions or Shared element animations ● Two hero widgets in different routes with same tag name ● Navigator manages stack containing app’s routes ● Pushing or Popping a route triggers the animation ● timeDelation property makes the animation slow as per our given time
  • 16. Behind the scenes - How Hero works?
  • 17. - Before transition, source Hero waits in source route widget tree. - Overlay is Empty. - Destination route does not yet exists.
  • 18. Pushing route to navigator triggers animation at t = 0.0 - Calculates Destination Hero’s path, off screen,u sing curved motion - Places Destination Hero in Overlay, at same location and size as Source Hero
  • 19. - As hero flies, its rectangular bounds are animated using CreateRectTween property
  • 20. When flight completes - Hero widget will be moved from Overlay to Destination. - Overlay is empty now. - Destination Hero appears in its final position in the Destination route. - Source Hero is restored to its route.
  • 21. 1) Standard Hero Animation - Specify route using MaterialPageRoute, CupertinoPageRoute or custom route using PageRouteBuilder - Change the size of Image at the end of Transition by wrapping the Destination’s Image in SizedBox - Change the location of the Image by placing the Destination’s Image in a Layout Widget
  • 22. 2) Radial Hero Animation - Animates Circular shape into Square shape - MaterialRectCenterArcTween defines the tween animation by interpolating two tweens using the center point of each Hero - Build destination route using PageRouteBuilder
  • 23.

Editor's Notes

  1. Animation object is the object that gets the values that are given and translates those to meaningful animations.