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:
| Widget | Job |
|---|---|
MaterialApp | Sets up the app: theme, navigation, text direction |
Scaffold | The basic page layout: app bar, body, floating button |
AppBar | The bar across the top |
Center | Centres its child |
Text | Shows a string |
There is no separate layout language. The interface is ordinary Dart: classes, constructors and named parameters.
Why developers choose Flutter #
| Reason | In practice |
|---|---|
| One codebase | One team builds every platform |
| Hot reload | Save a file and see the change in under a second |
| Fast | Compiled to native machine code |
| Consistent | The same look on old and new devices |
| Rich widgets | Material and Cupertino components, all customisable |
| Big ecosystem | Tens of thousands of packages on pub.dev |
| Free | Open 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.