Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 73 ยท Getting started

What Is Flutter?

Learn what Flutter is, why it draws every pixel itself, how Dart and the Impeller engine fit in, and how it compares to native apps and React Native.

Flutter is a toolkit for building apps that run on phones, the web, desktops and embedded screens from one codebase. You write the app once in a language called Dart, and Flutter produces an Android app, an iOS app, a Windows, macOS or Linux program, or a website. The same screens, the same logic and the same animations come out on every platform.

What makes Flutter different from most cross-platform tools is how it puts things on the screen. It does not ask the phone to create a native button or a native list. It brings its own drawing engine and paints every pixel itself. In this lesson you will learn what that means, why the team chose it, and when Flutter is a good fit. You will also see exactly what you can run on this site and what you cannot.

The cross-platform idea

Without a cross-platform tool, a company that wants an app on Android and iOS usually builds two apps: Kotlin or Java for Android, Swift for iOS. That means two codebases, two teams and two sets of bugs. Cross-platform tools try to share most of that work.

There are three broad strategies:

Three ways to share code

Web view An app that shows a web page inside a native shell.
Native bridge Your code asks the OS to create real native widgets.
Own renderer The toolkit draws everything itself. This is Flutter.

Flutter trades native widgets for full control of every pixel.

1 / 2

Flutter belongs to the third group. Because it controls the drawing, a Flutter screen looks the same on a five-year-old Android phone and on the newest iPhone. The cost is that Flutter has to re-create things the operating system normally gives you for free, such as scrolling physics, text selection and accessibility. The Flutter team has done that work for you, and you will rarely notice it.

Dart: the language underneath

Flutter apps are written in Dart, a language from Google. If you know Java, C#, Kotlin, Swift or TypeScript, Dart will feel familiar within a day: it has classes, generics, async/await, and a strong static type system with null safety. You will learn the parts you need in the Dart chapter, starting with Dart Basics for Flutter.

Dart is unusual because it can be compiled in two very different ways:

  • During development it runs in a virtual machine with just-in-time (JIT) compilation. That is what makes hot reload possible: Flutter injects your changed code into the running app without restarting it.
  • For release it is compiled ahead of time (AOT) to native ARM or x64 machine code, or to JavaScript or WebAssembly for the browser. There is no interpreter at run time, so the app starts fast and runs smoothly.

Here is a tiny Dart program. It cannot run on this site, so it is a plain read-only block:

DART
void main() {
  const name = 'Flutter';
  print('Hello from $name!');
}

How Flutter draws the screen

A Flutter app has three layers:

  1. The framework, written in Dart. It contains the widgets (buttons, lists, text), layout, animation and gestures. This is the part you work with every day.
  2. The engine, written in C++. It handles low-level drawing, text layout, input events and the Dart runtime.
  3. The embedder, a thin piece of platform-specific code that gives the engine a window, a surface to draw on and access to touch, keyboard and the clock.

The engine paints with a graphics renderer. Flutter used Skia for years and now uses Impeller on iOS and Android. Impeller prepares its graphics programs (shaders) ahead of time, which removes the stutter some early Flutter apps had the first time an animation ran. You do not choose the renderer in your code, but it is good to know the names because you will see them in release notes and performance discussions.

flowchart TD
    A["Your Dart code<br/>widgets and logic"] --> B["Flutter framework<br/>(Dart)"]
    B --> C["Flutter engine<br/>(C++, Impeller)"]
    C --> D["Embedder<br/>(Android, iOS, web, desktop)"]
    D --> E["GPU and screen"]

Your code only talks to the framework. The layers below do the drawing.

Everything is a widget

In Flutter the user interface is described with widgets. A widget is a small, immutable description of part of the screen: a piece of text, a row, some padding, a whole page. Widgets nest inside other widgets and form a tree. You build screens by combining many small widgets rather than configuring one big one.

Here is what a simple screen looks like in real Flutter code (read-only here):

DART
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Hello')),
        body: const Center(child: Text('My first Flutter screen')),
      ),
    );
  }
}

Read it from the outside in: an app contains a page (Scaffold), which has a top bar and a body, and the body centers a piece of text. We will take this apart properly in Everything Is a Widget.

Flutter compared with its neighbors

Native (Kotlin / Swift) React Native Flutter
Language Kotlin, Swift JavaScript or TypeScript Dart
UI approach Platform widgets Bridges to platform widgets Draws its own widgets
Codebases for iOS + Android Two One One
Look and feel Exactly native Native widgets, platform differences Identical everywhere (can imitate native)
Access to new OS features Day one Usually soon, via libraries Via plugins; sometimes later
Web and desktop Not applicable Limited Supported by the same codebase

None of these is "best". Native gives you the deepest platform access. React Native is attractive if your team already knows React (see the React tutorial). Flutter shines when you want one consistent, highly customized design on many platforms and fast, predictable animation.

Flutter is a good choice for apps with custom branding, lots of animation, or a small team that must ship to several platforms. It is a weaker choice for apps that are mostly thin wrappers over a platform feature, or for websites that depend on search-engine indexing of page text.

What is real and what is a stand-in on this site

Be clear about what you are looking at. The Flutter SDK and the Dart runtime need a native toolchain, an emulator or a device, so they cannot run in your browser. That means:

  • Dart and Flutter code in this tutorial is read-only. Every Dart snippet is real code that works in a real Flutter project, but you cannot press Run on it.
  • The live examples are stand-ins, written in JavaScript (and sometimes TypeScript), that imitate how Flutter's ideas work inside: a tree of widgets, a rebuild, a layout pass, a navigation stack. They teach the mechanism, not the real API.

Each lesson tells you which is which. When you start building for real, install the SDK as described in Setting Up and Running Your First App.

The first stand-in is a mini widget tree. Widgets are plain objects that describe the UI; a function turns the description into text, one indented line per widget.

JS A widget tree as plain objects

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The output mirrors the Dart example above: a tree, nested from the outside in. Real Flutter keeps this tree too, and rebuilds it cheaply whenever your data changes.

The second stand-in shows the "own renderer" idea. A tiny engine takes the same description and paints it onto a character grid instead of a screen. Notice that the description does not know how it will be drawn; the engine decides.

JS One description, any renderer

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Flutter works the same way at a much larger scale: your widgets describe what to show, and the engine decides how to paint it on each platform.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. How does Flutter put a button on the screen?

    Flutter ships its own engine (Impeller or Skia) and paints every pixel, which is why the UI looks the same on every platform.
  2. 2. Which language do you write Flutter apps in?

    Flutter apps are written in Dart. It is compiled to native code for release builds.
  3. 3. Why is hot reload possible during development?

    In development, Dart uses just-in-time compilation. Release builds are compiled ahead of time to native code.
  4. 4. Why can you not run Dart code on this site?

    The real code is read-only. The live stand-ins imitate the mechanics, such as widget trees and rebuilds.

Summary

  • Flutter builds mobile, web and desktop apps from one Dart codebase.
  • It draws every pixel itself with its own engine (Skia, now mostly Impeller) instead of using native widgets.
  • Dart runs in a VM with hot reload during development and compiles to native code for release.
  • The UI is a tree of small, immutable widgets that you combine.
  • On this site, Dart code is read-only and the live examples are JavaScript or TypeScript stand-ins.

Next: Setting Up and Running Your First App