Flutter: Interactivity
Flutter: Interactivity
Flutter: Interactivity
Flutter
Interactivity
Flutter
Adding Interactivity
Recap
• Widgets
• Stateless and State full widgets
• Single child widgets and multiple child widgets
• Image, List view , Grid view ,Stack
• Hot restart and hot reload
Today
Demo :
• Hello Dilani
• Fuel Consumption Calculator
State
State is information that can be read synchronously when the
widget is build and might change during the life time of the
widget .
Layout widgets
Statefull Widgets
Decoration….?
Drop Downs
• Generics type
Introduction to Gestures
• Gestures are primarily a way for a user to interact with a mobile (or any touch
based device) application. Gestures are generally defined as any physical action /
movement of a user in the intention of activating a specific control of the mobile
device.
• Gestures are as simple as tapping the screen of the mobile device to more
complex actions used in gaming applications.
• Tap: Touching the surface of the device with fingertip for a short period and then
• releasing the fingertip.
• Drag: Touching the surface of the device with fingertip and then moving the
fingertip in a steady manner and then finally releasing the fingertip.
• Panning: Touching the surface of the device with fingertip and moving it in any
direction without releasing the fingertip.
Gesture Events
Tap Vertical drag
• onTapDown • onVerticalDragStart
• onVerticalDragUpdate
• onTapUp
• onVerticalDragEnd
• onTap
• onTapCancel
Horizontal drag
• onHorizontalDragStart
Double tap • onHorizontalDragUpdate
• onHorizontalDragEnd
• onDoubleTap
Pan
Long press • onPanStart
• onPanUpdate
• onLongPress • onPanEnd
onTap……
Advanced gestures
• Flutter also provides a small set of widgets to do specific as well
as advanced gestures. The widgets are listed below:
• Dismissible: Supports flick gesture to dismiss the widget.
• Draggable: Supports drag gesture to move the widget.
• LongPressDraggable: Supports drag gesture to move a widget,
when its parent widget is also draggable.
• DragTarget: Accepts any Draggable widget.
• IgnorePointer: Hides the widget and its children from the gesture
detection process.
• AbsorbPointer: Stops the gesture detection process itself and so
any overlapping widget also can not able to participate in the
gesture detection process and hence, no event is raised.
• Scrollable: Support scrolling of the content available inside the
widget