Slide 1

Slide 1 text

Dhrumil Shah, Shipmnts & GDG Ahmedabad @dhuma1981 Kolkata Flutter: Theming & Animation

Slide 2

Slide 2 text

Dhrumil Shah Mobile Developer, @Shipmnts Co-organizer, @GDGAhmedabad Founder, @Flutter_Flakes

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

“Everything is Widget”

Slide 5

Slide 5 text

Theme is also a widget

Slide 6

Slide 6 text

Theme Widget Kolkata ● @required data = ThemeData ● @require child = Widget ● Theme.of(context) ● Theme.of(context).copyWith

Slide 7

Slide 7 text

ThemeData Kolkata ● primarySwatch ● primaryColor ● accentColor ● bottomAppBarColor ● dividerColor ● buttonTheme ● textTheme ● iconTheme ● tabBarTheme ● ...

Slide 8

Slide 8 text

Theme Demo App

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Let’s edit Theme ● Make everything with RED

Slide 18

Slide 18 text

Let’s edit FAB Theme ● Using Theme Widget ● Using Theme.of(context).copyWith()

Slide 19

Slide 19 text

Let’s edit Body Theme ● Using Theme Widget ● Using Theme.of(context).copyWith()

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Let’s understand Animation

Slide 22

Slide 22 text

Feedback Status User education

Slide 23

Slide 23 text

Types of Animation Kolkata Tween-Based Animations Physics-Base d Animations models path between points A & B by a transform T based on range & timing models real-world behaviors like velocity, mass, friction, momentum etc.

Slide 24

Slide 24 text

Tween-Based Animations / Default Type Kolkata Duration of Animation Value of Animation Upper Bound Value Lower Bound Value Linear Animation Completed Forward

Slide 25

Slide 25 text

Tween-Based Animations / Curve Type Kolkata Duration of Animation Value of Animation Upper Bound Value Lower Bound Value non-Linear Animation Dismissed Completed

Slide 26

Slide 26 text

Different Curve Types Kolkata

Slide 27

Slide 27 text

How animation works?

Slide 28

Slide 28 text

Build Layout Paint Animate Tick animations to change widget state Rebuild widgets to account for state changes Update size and position of render objects Vsync GPU Record display lists for composited layers Layer Tree

Slide 29

Slide 29 text

Key Animation classes

Slide 30

Slide 30 text

AnimationController Kolkata ● An animation itself ● Play-Stop-Reverse-Repeat-Reset-Resume ● AnimateTo-AnimateWith-Fling ● Duration and Value

Slide 31

Slide 31 text

Animation Kolkata ● Animation Status ● Animation Value ● AddListener ● AddStatusListener ● AnimateTo-AnimateWith-Fling ● Duration and Value

Slide 32

Slide 32 text

ImplicitlyAnimatedWidget Kolkata ● No Animation object needed ● Automatically interpolate and animate ● You can change the Curve and Duration ● AnimatedAlign ● AnimatedContainer ● AnimatedDefaultTextStyle ● AnimatedOpacity ● AnimatedPadding ● AnimatedPhysicalModel ● AnimatedPositioned ● AnimatedPositionedDirectional ● AnimatedTheme

Slide 33

Slide 33 text

Some Examples Kolkata

Slide 34

Slide 34 text

And some more Kolkata

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

And That’s it

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

References Kolkata ● Flutter.ioc - Theme & Animation ● Getting Animated from with Fluttter - @nitya ● Animating Flutter - @raoufrahiche ● Flutter Animation: motion awakens - @jansariparth

Slide 39

Slide 39 text

Dhrumil Shah, Shipmnts & GDG Ahmedabad @dhuma1981 Kolkata Thank you!