Skip to content
JsDevLife
Menu
  • Home
  • Leetcode in JS
  • About me
  • Contact Us
Menu

Flutter Hello world application

Posted on January 16, 2021 by Vikas Kad

Hello Developers, I have posted my previous post about flutter installation and basic difference, so today we will start the implementation of flutter.

Flutter Hello World App

To start with flutter web development, first of all, we will set up or VS Code IDE to make compatible with flutter development this isn’t mandatory but this will help you for rapid development.

Adding flutter extension to VS Code IDE

  • Open VS Code
  • Go to Extension by clicking below icon
  • Now search for flutter you will get following list then click on install

  • Now your extension is ready to use 

Create a hello world app with CLI

Run following command to create app with CLI


$flutter create hello_world

This will create a basic app for you.

App structure will be as follows:

 

So over there will be a lib folder where we will invest time more to develop our application.
If you see the main.dart file this will be our entry point for our application.
You can remove the auto-generated file and write down the following code to understand more about flutter development.
import ‘package:flutter/material.dart’;

void main() {
runApp(new Center(
child: new Text(‘Hello world’, textDirection: TextDirection.ltr)));
}

So now your main.dart file will look like as above.

Flutter Hello world main.dart file

import ‘package:flutter/material.dart’;

This will import the material based flutter package for our application.
 
void main() {
runApp(new Center(
child: new Text(‘Hello world’, textDirection: TextDirection.ltr)));
}

This will be our app’s entry point where we will create our all widgets and runApp() is the main function where it will start execution of the app.

Running App on Simulator or Emulator:

To run on a simulator or on the emulator, first of all, you need to start it and then run the following command :


$flutter run
This will run your application in the emulator or in the simulator.
That’s it for today, I will post the next tutorials of it soon.
Feel free to reach out to me.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Solving LeetCode Problem 79 – Word Search in JavaScript
  • Solving LeetCode Problem 48: Rotate Image using JavaScript
  • Solving the “Container With Most Water” LeetCode Problem in JavaScript – A Comprehensive Guide
  • LeetCode Solution: 54: Spiral Matrix in JavaScript
  • Solution to LeetCode Problem 31. Next Permutation in JavaScript

Archives

  • 2023 (5)
  • 2022 (20)
  • 2021 (2)
  • 2020 (4)
  • 2019 (14)
  • 2018 (17)

Categories

  • blockchain development
  • Blog
  • crystal
  • flutter
  • flutter.io
  • GitHub
  • Installation
  • Ionic Framework
  • javascript
  • leetcode-in-js
  • masteringInJavasript
  • mcqs
  • MongoDB
  • nodejs
  • Object Oriented Javacript
  • python
  • smart contracts
  • visual studio

Quick Links

  • Home
  • Leetcode in JS
  • About me
  • Contact Us

Terms of service

  • Terms Of Service
  • Disclaimer
©2023 JsDevLife | Design: Newspaperly WordPress Theme