← Flutter tutorial

Flutter

Introduction to Flutter

Flutter is a UI toolkit, written in Dart, for building natively-compiled apps from a single codebase, the same code can ship to iOS, Android, web, and desktop.

Example: the entry point of a Flutter app

import 'package:flutter/material.dart';

void main() {
  runApp(
    const Center(
      child: Text('Hello, Flutter!', textDirection: TextDirection.ltr),
    ),
  );
}

Renders a single line of centered text reading "Hello, Flutter!".

Instead of dragging elements in a visual designer, you describe your UI in code as a tree of widgets, and Flutter draws it. runApp() is the entry point that starts a Flutter app, notice it's ultimately just calling Dart's own main() function from the Dart tutorial, since Flutter apps are, underneath everything, ordinary Dart programs.

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

void main() {
  runApp(
    const Center(
      child: Text('Hello, Flutter!', textDirection: TextDirection.ltr),
    ),
  );
}
Output
Renders a single line of centered text reading "Hello, Flutter!".
Ready to go further?

These free tutorials are a preview of what a Code Secure Academy cohort covers, project work and all.

Explore our tracks
Don't miss out

Ready to build something real?

Create a free account to enroll in a track, and get notified the moment a cohort opens.

Create free account