Dart Tutorial

Flutter Lesson 1 of 83 2 min read

What Is Flutter? An Introduction for Beginners

What is Flutter and why use it? Learn how Flutter builds Android, iOS, web and desktop apps from one Dart codebase, and how it works.

On this page

Flutter is Google’s open-source toolkit for building apps. You write the app once, in Dart, and Flutter builds it for:

  • Android and iOS
  • Web
  • Windows, macOS and Linux

How it is different #

Most cross-platform tools translate your code into each platform’s own buttons and lists. Flutter does not. It ships its own rendering engine and draws every pixel itself. The result is an app that looks and behaves the same on every device, with smooth animation.

Everything is a widget #

A Flutter screen is a tree of widgets. A widget is a Dart class that describes one part of the interface: some text, a button, padding around something, a row of things, a whole page.

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('My first app')),
        body: const Center(
          child: Text('Hello, Flutter!'),
        ),
      ),
    );
  }
}

Press Run to see it. Reading from the outside in:

WidgetJob
MaterialAppSets up the app: theme, navigation, text direction
ScaffoldThe basic page layout: app bar, body, floating button
AppBarThe bar across the top
CenterCentres its child
TextShows a string

There is no separate layout language. The interface is ordinary Dart: classes, constructors and named parameters.

Why developers choose Flutter #

ReasonIn practice
One codebaseOne team builds every platform
Hot reloadSave a file and see the change in under a second
FastCompiled to native machine code
ConsistentThe same look on old and new devices
Rich widgetsMaterial and Cupertino components, all customisable
Big ecosystemTens of thousands of packages on pub.dev
FreeOpen source, backed by Google and a large community

When it may not fit #

  • Apps that are mostly thin layers over deep platform-specific features can be simpler to write natively.
  • Content websites that depend on search traffic are better built with ordinary HTML. Flutter web suits app-like experiences.
  • A Flutter app carries its engine, so the smallest possible download size is not its strength.

What this course covers #

You will go from installing Flutter to publishing an app: widgets, layout, navigation, state management, networking, storage, animation, responsive design, testing and release.

Try it yourself #

Run the example. Change the two strings, then change Center to Align with alignment: Alignment.topLeft and run it again.

Practise in the playground Updated by Santosh Adhikari