Skip to content

Latest commit

 

History

History
90 lines (63 loc) · 2.59 KB

getting-started.md

File metadata and controls

90 lines (63 loc) · 2.59 KB
layout title sidebar permalink
page
Getting Started with Flutter
home_sidebar
/getting-started/

This quickstart guide describes how to create and run your first Flutter app on iOS or Android.

  • Placeholder for TOC {:toc}

Before you begin

To write Flutter apps, you will need to install the Flutter SDK. You also need to set up a Linux or Mac development machine to run and test your apps on Android or iOS. See Flutter Setup for instructions on how to set up your development environment.

Create your first Flutter app

To create a starter project, open a terminal and run the flutter command .

Here is an example:

$ flutter create myapp

The above command creates a Flutter project directory called myapp that contains a simple demo app that uses Material Design.

In the project directory, the code for your app is in myapp/lib/main.dart.

Run your Flutter app

Use the flutter run command to run your Flutter app on all connected devices and simulators. (The flutter devices command will list connected devices and simulators.)

To run your app from the command-line:

  1. Open a terminal and change directories to the root of your app (the same directory that contains the pubspec.yaml file for your project).
  2. Run the following command.
$ flutter run

Alternatively, if you are using the Atom editor with the Flutter package, you can start your Flutter app by selecting the /lib/main.dart file in the project and pressing the Run App shortcut in the main editor screen. The shortcut depends on the operating system of the development machine you are using:

  • Linux: Ctrl+R
  • Mac: Command+R

If everything works, you should see your starter app on your device or simulator.

Figure 1. iOS (iPhone 6s Plus)
Figure 2. Android (Nexus 6)

Next steps

Please reach out to us at our mailing list. We'd love to hear from you!

You might also want to check out our Introduction to Flutter's Widget Framework and our Debugging guide.

Happy Fluttering!