Mobile App Development

Flutter Tutorial for Beginners: Build Your First App

November 27, 2026 · 10 min read

Flutter Tutorial for Beginners: Build Your First App

This Flutter tutorial takes you from an empty folder to a working to-do app that runs on Android, iOS and the web, in about an hour. You will install Flutter, learn how widgets and state work, build the app step by step, test it automatically and prepare it for release. No previous mobile experience is needed, although basic programming knowledge helps.

The tutorial is up to date for Flutter 3.50, released on 11 November 2026 alongside Dart 3.14. That release changed something every beginner meets on day one: the Material widgets now come from a separate package, material_ui, rather than from the Flutter SDK itself. Older tutorials still show the previous import, so the code here follows the new approach from the start.

What Is Flutter and Why Learn It?

Flutter is Google's open-source framework for building apps from a single codebase. You write the code once in Dart, and Flutter compiles it to native code for Android and iOS, and to JavaScript or WebAssembly for the web, plus desktop and embedded targets. Flutter draws its own interface with its rendering engine, so your app looks the same on every device.

Three things make it beginner-friendly. Everything on screen is a widget, so there is one main idea to learn. Hot reload shows code changes in about a second without losing the app's state. And the documentation and community are large, with answers for almost any question. Google releases a new stable version about every three months. If you are still choosing a framework, compare Kotlin Multiplatform and Flutter or Flutter and React Native first.

Step 1: Install Flutter

Follow the official installation guide for your operating system. In short, you need:

  • The Flutter SDK, which includes Dart.
  • An editor: VS Code with the Flutter extension, or Android Studio with the Flutter plugin.
  • Android Studio for the Android SDK and an emulator, on Windows, macOS or Linux.
  • Xcode on a Mac if you want to run the app on an iPhone or the iOS Simulator.

Then check your set-up and create the project. These are the commands you will use throughout the tutorial:

flutter --version          # this tutorial assumes Flutter 3.50 or later
flutter doctor             # lists anything missing: Android Studio, Xcode, licences
flutter create tasks       # new projects already depend on package:material_ui
cd tasks
flutter run                # choose an emulator, simulator, connected phone or Chrome
flutter test               # runs the widget test
flutter build appbundle    # Android App Bundle for Google Play; use "flutter build ipa" on a Mac for iOS

The flutter doctor command is your friend: it lists exactly what is missing, such as Android licences or Xcode command-line tools, and how to fix it.

Step 2: Create the Project

Running flutter create tasks generates a complete starter app. The folders that matter for now are:

  • lib/main.dart: your app's code. Everything in this tutorial goes here.
  • pubspec.yaml: the project's name, version and dependencies, including material_ui.
  • test/: automated tests.
  • android/ and ios/: native project files, which you rarely touch until release.

If you upgrade an older project instead, Flutter's migration guide explains how a single dart fix command adds the material_ui package and swaps the imports for you.

Step 3: Understand Widgets and State

A Flutter interface is a tree of widgets. A Text widget shows text, a Column stacks children vertically, Padding adds space and a Scaffold provides the basic screen layout with an app bar. You build screens by nesting small widgets inside bigger ones.

There are two kinds you will write yourself. A StatelessWidget depends only on the values passed into it, so it never changes on its own. A StatefulWidget has a State object holding data that can change, such as a list of tasks. When that data changes, you call setState, and Flutter runs the build method again and updates the screen efficiently. That one pattern powers the whole app below.

Step 4: Build the To-Do App

Replace the contents of lib/main.dart with this complete app:

// lib/main.dart - a complete to-do app (Flutter 3.50+, using the standalone material_ui package)
import 'package:material_ui/material_ui.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Tasks',
      theme: ThemeData(colorSchemeSeed: Colors.indigo),
      darkTheme: ThemeData(colorSchemeSeed: Colors.indigo, brightness: Brightness.dark),
      home: const TodoScreen(),
    );
  }
}

class Todo {
  Todo(this.title);
  final String title;
  bool done = false;
}

class TodoScreen extends StatefulWidget {
  const TodoScreen({super.key});

  @override
  State<TodoScreen> createState() => _TodoScreenState();
}

class _TodoScreenState extends State<TodoScreen> {
  final _todos = <Todo>[];
  final _controller = TextEditingController();

  void _add() {
    final title = _controller.text.trim();
    if (title.isEmpty) return;
    setState(() => _todos.add(Todo(title)));
    _controller.clear();
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    final remaining = _todos.where((todo) => !todo.done).length;
    return Scaffold(
      appBar: AppBar(title: Text('Tasks ($remaining left)')),
      body: Column(
        children: [
          Padding(
            padding: const EdgeInsets.all(16),
            child: Row(
              children: [
                Expanded(
                  child: TextField(
                    controller: _controller,
                    decoration: const InputDecoration(labelText: 'New task'),
                    onSubmitted: (_) => _add(),
                  ),
                ),
                const SizedBox(width: 12),
                FilledButton(onPressed: _add, child: const Text('Add')),
              ],
            ),
          ),
          Expanded(
            child: ListView.builder(
              itemCount: _todos.length,
              itemBuilder: (context, index) {
                final todo = _todos[index];
                return Dismissible(
                  key: ObjectKey(todo),
                  onDismissed: (_) => setState(() => _todos.removeAt(index)),
                  child: CheckboxListTile(
                    title: Text(todo.title),
                    value: todo.done,
                    onChanged: (value) => setState(() => todo.done = value ?? false),
                  ),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}

Here is what each part does:

  • TodoApp sets up MaterialApp with light and dark themes generated from one seed colour, so the app follows the phone's dark mode automatically.
  • Todo is a plain Dart class holding a title and a done flag.
  • TodoScreen is stateful because the list changes. Its State keeps the tasks and a TextEditingController that reads what the user types.
  • _add ignores empty input, adds the task inside setState so the screen updates, and clears the text field.
  • dispose releases the controller when the screen goes away, which prevents memory leaks.
  • ListView.builder creates rows only as they scroll into view, so it stays fast with long lists.
  • Dismissible lets users swipe a task away, and CheckboxListTile ticks it off; the app bar counts what is left.

Step 5: Run It and Use Hot Reload

Start an emulator or connect a phone with developer mode enabled, then run flutter run, or press Run in your editor. Add a few tasks, tick one off and swipe another away. Now change the seed colour from indigo to teal and save the file. With hot reload, the colour changes in about a second and your tasks are still there. This tight feedback loop is the main reason developers enjoy Flutter.

Try running the same code in Chrome with flutter run -d chrome. Without any changes, you have a web version of the app.

Step 6: Test Your App

Flutter includes a test framework that can drive your widgets without a device. Replace test/widget_test.dart with:

// test/widget_test.dart - run with: flutter test
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';
import 'package:tasks/main.dart';

void main() {
  testWidgets('adds a task and ticks it off', (tester) async {
    await tester.pumpWidget(const TodoApp());

    await tester.enterText(find.byType(TextField), 'Buy milk');
    await tester.tap(find.text('Add'));
    await tester.pump();
    expect(find.text('Buy milk'), findsOneWidget);
    expect(find.text('Tasks (1 left)'), findsOneWidget);

    await tester.tap(find.byType(Checkbox));
    await tester.pump();
    expect(find.text('Tasks (0 left)'), findsOneWidget);
  });
}

Run flutter test and the test types a task, taps Add, checks the task appears, ticks it and confirms the counter updates. Tests like this catch broken features before your users do. As the app grows, add unit tests for logic and integration tests on real devices; our mobile app testing checklist covers the full picture.

Debugging Your App

When something looks wrong, Flutter DevTools is the first place to go. Open it from your editor while the app runs to inspect the widget tree, see why a widget has a certain size, watch rebuilds and find slow frames in the performance view. Use debugPrint for quick logging, set breakpoints in VS Code or Android Studio to pause the app and examine variables, and read error messages carefully: Flutter's layout errors usually say exactly which widget overflowed and by how many pixels.

Making It Accessible

Flutter's standard widgets already work with TalkBack on Android and VoiceOver on iOS, and the app above respects the user's text size. Keep it that way by giving icon-only buttons a tooltip or semantic label, keeping text contrast high, making tap targets at least 48 by 48 pixels and testing with large text and a screen reader turned on. The principles in our web accessibility checklist apply to apps too.

Step 7: Build and Release

For Android, flutter build appbundle creates the App Bundle that Google Play requires. For iOS, flutter build ipa on a Mac produces an archive for TestFlight and the App Store. Before submitting, set the app name, icon, version and signing details, and check each store's requirements. Our guide on how to publish an app on Google Play and the App Store walks through accounts, reviews and testing rules.

On iOS, Flutter now uses Swift Package Manager by default for native dependencies, replacing CocoaPods, which stops accepting updates in December 2026. New projects are set up correctly already.

What to Learn Next

  1. Save data: store tasks with shared_preferences for simple values, or a database such as drift or sqflite.
  2. Navigation: move between screens with Navigator or the go_router package.
  3. State management: as apps grow, use Provider, Riverpod or Bloc instead of setState everywhere.
  4. Networking: fetch JSON from an API with the http package and display it.
  5. A back end: add sign-in and cloud data with Firebase or Supabase; see our Firebase vs Supabase comparison.
  6. Design: learn theming, adaptive layouts for tablets and foldables, and accessibility; our guide to mobile app design trends shows where things are heading.

Curious how native development compares? Our Swift vs Kotlin guide explains the languages behind native iOS and Android apps. For practice ideas, browse our list of mobile app ideas.

Common Beginner Mistakes

  • Changing state without setState: the data changes but the screen does not.
  • Forgetting to dispose controllers: text, animation and scroll controllers leak memory if not disposed.
  • Huge build methods: split screens into small widgets so they are easier to read and rebuild efficiently.
  • Skipping const: marking unchanging widgets const lets Flutter skip rebuilding them.
  • Heavy work on the UI thread: parse large data or process images in an isolate so animations stay smooth.
  • Ignoring the analyser: run flutter analyze; its warnings point to real bugs surprisingly often.

Frequently Asked Questions

Is Flutter good for beginners?

Yes. You learn one language, Dart, and one main idea, widgets, and hot reload makes experimenting quick. Many developers build their first working app within a day.

Do I need to learn Dart before Flutter?

Not separately. Learn Dart basics, such as variables, functions, classes and lists, as you go. If you know JavaScript, Java or C#, Dart will feel familiar within hours.

Can I build iOS apps with Flutter on Windows?

You can write and test the app on Windows using Android and web targets, but building and publishing the iOS version requires a Mac with Xcode, or a cloud build service that provides one.

Why does my Flutter tutorial import package:flutter/material.dart?

That import was standard before Flutter 3.50. The bundled Material library is now deprecated in favour of the material_ui package, so new code should import package:material_ui/material_ui.dart. Run dart fix to migrate older projects.

How long does it take to learn Flutter?

Most developers can build simple apps within one or two weeks of regular practice and become productive on real projects within two to three months. Learning state management, testing and release processes takes longer.

Is Flutter still worth learning in 2027?

Yes. Google ships four stable releases a year, Flutter is used for phones, the web, desktops, TVs and cars, and demand for Flutter developers remains strong.

Turn Your App Idea Into a Real Product

Our Flutter team builds production apps for Android, iOS and the web, from first prototype to store launch and beyond. Contact our team to talk about your app.

Want this built for you?

Our team offers Website Deploy On Vercel — get a free quote.

View Services