Slide 1

Slide 1 text

Flutter & Dart Introduction By Ali Yazdi [email protected] linkedin.com/in/aliyazdi75

Slide 2

Slide 2 text

Contents ● Flutter and its advantages ● Flutter’s language: Dart ● Flutter architectural ● Flutter UI and Widgets ● Thinking declaratively

Slide 3

Slide 3 text

Build apps for any screen Flutter transforms the app development process. Build, test, and deploy beautiful mobile, web, desktop, and embedded apps from a single codebase.

Slide 4

Slide 4 text

Fast Flutter code compiles to ARM or Intel machine code as well as JavaScript, for fast performance on any device.

Slide 5

Slide 5 text

Productive Build and iterate quickly with Hot Reload. Update code and see changes almost instantly, without losing state.

Slide 6

Slide 6 text

Flexible Control every pixel to create customized, adaptive designs that look and feel great on any screen.

Slide 7

Slide 7 text

DevTools A full suite of performance and debugging tools: ● Inspect the UI layout and state of a Flutter app ● CPU/Network/memory profiling for a Flutter or Dart app ● Source-level debugging of a Flutter or Dart app ● Analyze code and app size

Slide 8

Slide 8 text

Performance inspector How much time took for flutter to render the specific frame.

Slide 9

Slide 9 text

Extensive Flutter docs Find documentation for everything Flutter - from interactive examples and tutorials, to building and deploying your first Flutter app: ● Code and website documentation, website, tutorials and youtube videos and sample usage inside class documentation, medium, github, youtube channel by flutter team, huge community in socials

Slide 10

Slide 10 text

Extensive Flutter docs

Slide 11

Slide 11 text

Extensive Flutter docs https://api.flutter.dev/flutter/widgets/AspectRatio-class.html

Slide 12

Slide 12 text

Open Source Flutter is an open source framework by Google and is one of the fast growing repositories of github as you can see the graph :)

Slide 13

Slide 13 text

Dart: The platforms Dart’s compiler technology lets you run code in different ways: ● Native platform: ○ Dart VM with just-in-time (JIT) ○ Ahead-of-time (AOT) compiler for producing machine code. ● Web platform: ○ Dart can compile for development or production purposes. Its web compiler translates Dart into JavaScript.

Slide 14

Slide 14 text

Flutter architectural: Embedder A platform-specific embedder provides an entrypoint; ● Coordinates with the underlying operating system for access to services like rendering surfaces, accessibility, and input: ○ UTF-8 Text input, Clipboard copy & paste, window title and icon ○ Mouse-hovering/buttons and keyboard ● The embedder is written in ○ Java and C++ for Android ○ Objective-C/Objective-C++ for iOS and macOS ○ C++ for Windows and Linux

Slide 15

Slide 15 text

Flutter architectural: Engine The Flutter Engine is a portable runtime for hosting Flutter applications. ● It implements Flutter's core libraries: ○ Animation and graphics (through Skia) ○ File and network I/O ○ Plugin architecture ○ A Dart runtime and compile toolchain ● The engine is responsible for rasterizing composited scenes whenever a new frame needs to be painted

Slide 16

Slide 16 text

Flutter architectural: Web On the web, Flutter provides a reimplementation of the engine on top of standard browser APIs. There are two options for rendering Flutter content on the web: ● HTML, Flutter uses HTML, CSS, Canvas, and SVG. (Better app size) ● WebGL, Flutter uses a version of Skia compiled to WebAssembly called CanvasKit. (higher graphical fidelity)

Slide 17

Slide 17 text

Integrating with other code ● Platform channels ○ For mobile and desktop apps, Flutter allows you to call into custom code through a platform channel ● Foreign Function Interface (FFI) ○ FFI is available for C-based APIs ● js package ○ Call JavaScript APIs from Dart code, or vice versa

Slide 18

Slide 18 text

Flutter architectural: Framework It includes a rich set of platform, layout, and foundational libraries, composed of a series of layers. ● Foundational: lowest-level utility classes and building block services like animation, painting, and gestures ● Rendering: provides an abstraction for dealing with layout ● The Material and Cupertino libraries offer comprehensive sets of controls that use the widget layer’s composition primitives to implement the Material or iOS design languages.

Slide 19

Slide 19 text

It’s all widgets Widgets are the building blocks of a Flutter app’s user interface. ● Widgets are typically composed of many other small, single-purpose widgets that combine to produce powerful effects ● Determine the visual representation of a widget by overriding the build() function to return a new element tree

Slide 20

Slide 20 text

Flutter implementations of UI Flutter has its own implementations of each UI control, rather than implementation provided by both iOS/Android equivalent. ● Extensibility ● Avoids a significant performance bottleneck ● Decouples the application behavior from any operating system dependencies. The application looks and feels the same on all versions of the OS

Slide 21

Slide 21 text

The Widget Tree Widgets form a hierarchy based on composition. Each widget nests inside its parent and can receive context from the parent. This structure carries all the way up to the root widget.

Slide 22

Slide 22 text

Thinking declaratively

Slide 23

Slide 23 text

The Only Resource: flutter.dev

Slide 24

Slide 24 text

Thanks for your attention 💙 QA Email: [email protected] Linkedin: linkedin.com/in/aliyazdi75