How to create a minimal Flutter app via CLI

by stink on Jul 11, 2025 to flutter comments(2)
In this post I will show you how to create a hello world Flutter app using the CLI. The app will run on Windows, MacOS, Linux, iOS, Android and the web.

First, you need to install Flutter. In order to do this, I went here, selected Windows, then Desktop, then the blue "Download and install" button.

Next, open a terminal and type this command:

flutter --version

You should see output like this:

Flutter 3.32.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 077b4a4ce1 (3 days ago) • 2025-07-08 13:31:08 -0700
Engine • revision 72f2b18bb0 (3 days ago) • 2025-07-08 10:33:53 -0700
Tools • Dart 3.8.1 • DevTools 2.45.1

Now, run this command to create a new project:

flutter create myapp -e

This will create a Flutter app in the myapp directory. The -e option is used to create a minimal main.dart without a bunch of comments.

Next, go into your app directory:

cd myapp

Then run the app:

flutter run

When you execute the run command you will see a list of options:

Connected devices:
Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.5965]
Chrome (web)      • chrome  • web-javascript • Google Chrome 138.0.7204.100
Edge (web)        • edge    • web-javascript • Microsoft Edge 138.0.3351.65
[1]: Windows (windows)
[2]: Chrome (chrome)
[3]: Edge (edge)
Please choose one (or "q" to quit):

Select a device and the app should run. The app will be a blank screen with "hello world" in the middle.

If you want to see the code for this app open lib/main.dart:

import 'package:flutter/material.dart';

void main() {
  runApp(const MainApp());
}

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text('Hello World!'),
        ),
      ),
    );
  }
}

Edit: I changed the post title and intro paragraph to reflect the fact that it's all CLI.

Edit 2: I removed two instances of "like this".
  • by bozaloshtsh on Jul 27, 2025
    Have you ever made a web app with flutter? I've heard it's super slow and almost unusable
    • by stink on Jul 31, 2025
      Yes, I have.

      I think it's possible to make a good web app with Flutter. But it's also definitely easy to make a bad one.