Writing your first app in Flutter.

Flutter SDK is Google’s UI toolkit for crafting beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

Flutter Logo

Get the Flutter SDK

To install Flutter on your machine, follow these steps.

Windows install

macOS install

Linux install

Update your path

Add Flutter to the PATH.

Set up an Editor

Android Studio

VS Code

Create and run a simple Flutter app

Create a new Flutter app by running the following from the command line or terminal:

flutter create helloworld_app

A helloworld_app directory is created, containing Flutter’s starter app.

Navigate to this directory:

cd helloworld_app

To launch the app in the Simulator/Emulator, ensure that it is running and enter:

flutter run

Write your first ‘Hello World!’ App in Flutter

Replace the default code with the below code to create ‘Hello World!’ App.

import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
);
}
}

class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('My First App'),
),
body: Center(
child: Container(
child: Text('Hello World!'),
),
),
);
}
}

We’ve created our first Flutter application and we have it running on an emulator. 🙌

Play around with Flutter using this example application.

For more information, view Flutter documentation here.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store