Dart Tutorial

Learn Dart and Flutter, from your first line to a published app

Two free courses that go in order. 185 short lessons, each with code you can run in the browser and an exercise to try yourself.

Covers Dart 3 and current Flutter with Material 3. No sign-up.

void main() {
  final learners = ['Asha', 'Bikram', 'Chen'];

  for (final (i, name) in learners.indexed) {
    print('${i + 1}. Welcome, $name!');
  }

  final total = learners.length;
  print('$total people started Dart today.');
}
Output
1. Welcome, Asha!
2. Welcome, Bikram!
3. Welcome, Chen!
3 people started Dart today.
Course 1 Dart 15 chapters, 102 lessons The language: basics, functions, collections, null safety, OOP, async, Dart 3 features and tooling. Course 2 Flutter 16 chapters, 83 lessons The framework: widgets, layout, navigation, state management, data, animation, testing and release.

The Dart course

Start at chapter 1 if you are new to programming. If you already know another language, skim the first three chapters and slow down at null safety.

  1. 1

    Getting Started with Dart

    What Dart is, how to install it, and how to write, run and comment your first program.

    4 lessons
  2. 2

    Dart Basics

    Variables, data types, numbers, strings, booleans, operators and reading input: the building blocks of every Dart program.

    9 lessons
  3. 3

    Control Flow

    Make decisions with if, else and switch, repeat work with loops, and control exactly when a loop stops or skips.

    6 lessons
  4. 4

    Functions

    Write reusable blocks of code: parameters, return values, arrow syntax, closures, higher-order functions and recursion.

    7 lessons
  5. 5

    Collections

    Store and process groups of values with lists, sets and maps, then filter, transform and combine them.

    10 lessons
  6. 6

    Null Safety

    Understand nullable and non-nullable types, the null-aware operators, and late variables, so null errors are caught before your code runs.

    3 lessons
  7. 7
  8. 8

    Records and Patterns

    The Dart 3 features that changed everyday code: records, destructuring, pattern matching, switch expressions and sealed classes.

    4 lessons
  9. 9

    Error Handling

    Deal with things going wrong: catch exceptions with try and catch, clean up with finally, and define your own exception types.

    2 lessons
  10. 10

    Asynchronous Programming

    Write code that waits without freezing: futures, async and await, streams, the event loop, isolates and generators.

    12 lessons
  11. 11

    Files and Directories

    Read, write, check and delete files, work with folders and paths, and handle file system errors using the dart:io library.

    7 lessons
  12. 12

    Libraries and Packages

    Organise code into files and libraries, control what you import, use packages from pub.dev and publish your own.

    4 lessons
  13. 13

    Practical Dart

    The everyday skills of real projects: JSON, HTTP requests, dates and times, regular expressions, command-line apps and testing.

    6 lessons
  14. 14

    Tools and Performance

    Format, lint, debug, log and profile your Dart code, and understand how memory and garbage collection work.

    6 lessons
  15. 15

    Dart Next Steps

    Take your Dart skills further: build practice projects, prepare for interviews, keep a cheat sheet handy, then move on to Flutter.

    3 lessons

The Flutter course

From installing the SDK to publishing on Google Play and the App Store. Begin here once the Dart basics feel comfortable.

Flutter course overview

  1. 1

    Getting Started with Flutter

    What Flutter is, how to install it, and how to create, run and understand your first app.

    5 lessons
  2. 2

    Widgets

    The building blocks of every Flutter screen: stateless and stateful widgets, the widget lifecycle, text, buttons, images and containers.

    8 lessons
  3. 3

    Layout

    Arrange widgets on screen with rows, columns, stacks, lists and grids, and understand how Flutter decides sizes.

    8 lessons
  4. 4

    Material Design and App Structure

    Build complete screens with Scaffold, app bars, navigation bars, drawers, tabs, cards, dialogs and themes.

    6 lessons
  5. 5

    User Input and Forms

    Collect input with text fields, validated forms, checkboxes, switches, sliders, pickers and gestures.

    5 lessons
  6. 6

    Navigation and Routing

    Move between screens, pass data back and forth, and set up URL-based routing with go_router.

    4 lessons
  7. 7

    State Management

    Keep your UI in step with your data: setState, lifting state up, InheritedWidget, ChangeNotifier, Provider, Riverpod and Bloc.

    7 lessons
  8. 8

    Async UI and Networking

    Show data that arrives later: FutureBuilder, StreamBuilder, HTTP requests, JSON models, loading and error states, and pagination.

    6 lessons
  9. 9

    Storing Data

    Keep data on the device with shared_preferences, files and SQLite, and in the cloud with Firebase.

    4 lessons
  10. 10

    Animations

    Bring an app to life with implicit and explicit animations, hero transitions, custom page routes and custom painting.

    4 lessons
  11. 11

    Responsive and Adaptive Design

    Make one app look right on small phones, large phones, tablets, foldables, desktops and the web.

    4 lessons
  12. 12

    Device Features and Plugins

    Use the camera, gallery, location, links, sharing and other native features through plugins, and call native code yourself.

    4 lessons
  13. 13

    Testing, Debugging and Quality

    Test your widgets, find bugs with DevTools, keep the app fast, and make it usable in every language and by everyone.

    7 lessons
  14. 14

    App Architecture

    Organise a growing Flutter app: folder structure, layers, MVVM with repositories, dependency injection and environment configuration.

    3 lessons
  15. 15

    Building and Releasing

    Prepare an app for release: icon, splash screen and name, then build and publish for Android, iOS, web and desktop, and automate it.

    5 lessons
  16. 16

    Flutter Next Steps

    Practice projects, interview questions and a cheat sheet to turn what you have learned into real skill.

    3 lessons

What you will learn #

The two courses start from zero and end with the skills used in real projects. Each lesson explains one idea, shows it in a short program, and finishes with an exercise.

In the Dart tutorial:

In the Flutter tutorial:

How to use this site #

Read the lessons in order the first time. Run every example and change it to see what happens: that is where most of the learning takes place. Use the search box, or press /, to jump to a topic in either course. Mark lessons as done to keep track of where you are. Your progress is stored in your own browser and nowhere else.

Questions people ask before starting

What is Dart used for?

Dart is a programming language from Google. It is best known as the language of Flutter, which builds Android, iOS, web and desktop apps from one codebase. Dart is also used for command-line tools and server-side programs.

Is Dart easy to learn for beginners?

Yes. Dart has a clean, consistent syntax, helpful error messages and a type system that catches mistakes while you type. If you have never programmed before, start at chapter 1 of the Dart course and follow the lessons in order. If you know JavaScript, Java, Kotlin or C#, most of Dart will feel familiar.

Should I learn Dart or Flutter first?

Learn the Dart basics first: variables, functions, classes, null safety, collections and async. Every Flutter widget is a Dart class, so Flutter code is much easier to read once you know the language. You do not need to finish the whole Dart course before starting Flutter. The first seven chapters are enough to begin.

How long does it take to learn Dart and Flutter?

With about an hour a day, most beginners finish the core Dart chapters in four to six weeks, and can build simple Flutter apps a month or two after that. Developers who already know another language move faster.

Do I need to install anything to follow these tutorials?

Not to begin. Examples with a Run button open in DartPad, the official online editor, and that includes many Flutter examples. Each course has a lesson on installing the tools on Windows, macOS and Linux when you are ready.

Which versions do the tutorials cover?

The Dart course covers Dart 3, including sound null safety, records, patterns, sealed classes and class modifiers. The Flutter course uses current stable Flutter with Material 3.

Can I build Android and iOS apps with Flutter?

Yes. One Flutter codebase builds apps for Android, iOS, the web, Windows, macOS and Linux. The Flutter course ends with lessons on publishing to Google Play and the App Store.

Are the tutorials free?

Yes. Every lesson is free to read, with no sign-up and no paywall.

Dart Tutorial is written and kept up to date by Santosh Adhikari, a Flutter and Dart developer. See more of his work at santoshadhikari.com.