Aman Verma
Ophilia

Ophilia

Creating Hello World App in Flutter

Aman Verma's photo
Aman Verma

Published on Jul 18, 2021

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Flutter is a wonderful open-source cross-platform developed and maintained by Google. Well, let's dive in today and create our very first app written in flutter.

So before we start, make sure you have a development environment for flutter ready, if not here is how to do it: flutter.dev/docs/get-started/install

Once you are done with it, run flutter doctor command to see everything is ok, before we start.

So we will start with creating a new flutter project using the command flutter create helloworld. This will create a new project in a folder named helloworld.

Open that project in your preferred code editor. Navigate to the lib folder, inside it there is a file named main.dart. It already contains boilerplate code for the default flutter app. Default flutter app is nothing but a counter incrementor app that increases the counter and shows the current counter value on the screen.

We will remove the code from MyHomePage class such that it looks like this

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
     return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: 
    );
  }
}

Now we will specify a child for the Center, and it would be Text because we want to display a text. We would add the following line

Text("Hello World")

and this would be all.

You have created a Hello World application in Flutter. Keep Learning :)

If you want to watch a detailed video on the same , here it is

 
Share this