Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Key Widgets
  • UI Components
  • Design & Animations
  • Forms & Gestures
  • Navigation & Routing
  • Flutter Interview Questions
  • Dart
  • Android
  • Kotlin
  • Kotlin Android
  • Android with Java
  • Android Studio
Open In App
Next Article:
Recipe Finder Application in Flutter
Next article icon

Creating a Simple Application in Flutter

Last Updated : 13 Mar, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Flutter is an open-source cross-platform mobile application development SDK created by Google. It is highly user-friendly and builds high-quality mobile applications. The intention behind this article is to guide readers through the process of building an application through Flutter by creating a simple Flutter App on Android Studio. To start creating a Flutter application, we have to first create a flutter project and many other things. To do so, follow the steps mentioned below:

There are two ways to create a new flutter project based on IDE you using. Select according to your IDE.

Table of Content

  • Create a New Flutter Project Using Android Studio
  • Create a New Flutter Project Using Visual Studio Code


Create a New Flutter Project Using Android Studio

Step 1: Open the Android Studio IDE and select Start a new Flutter project.

Note:  if you like to create a flutter project using terminal use the below command and jump right into step 6.

$ flutter create flutter_app

replace the ‘ flutter_app ‘ with your project name

creating a new project


Step 2: Selecting Type of Application

Select the Flutter Application as the project type. Then click Next.

selecting the application builder


Step 3: Verify the Flutter SDK Path

Verify the Flutter SDK path specifies the SDK’s location (select Install SDK… if the text field is blank).

Step 4: Enter Project Details

Enter a project name (for example, myapp). Then click Next.

naming the application

Note:
- Project name: flutter_app
- Flutter SDK Path: <path-to-flutter-sdk>
- Project Location: <path-to-project-folder>
- Description: Flutter based simple application


Step 5: Click Finish and wait till Android Studio Creates the Project

naming the flutter package


Step 6: Edit the code

After successfully creating a file, we can edit the code of the application to show the output we want. Android Studio creates a fully working flutter application with minimal functionality. Let us check the structure of the application and then, change the code to do our task.

The structure of the application and its purpose are as follows?

file structure in flutter

We have to edit the code in main.dart as mentioned in the above image. We can see that Android Studio has automatically generated most of the files for our flutter app. Replace the dart code in the lib/main.dart file with the below code:

main.dart:

Dart
// Importing important packages require to connect // Flutter and Dart import 'package:flutter/material.dart';  // Main Function void main() {        // Giving command to runApp() to run the app.   runApp(const MyApp()); }  // Widget is used to create UI in flutter framework.  class MyApp extends StatelessWidget {   const MyApp({Key? key}) : super(key: key);  // This widget is the root of your application.   @override   Widget build(BuildContext context) {     return MaterialApp(                // title of the application       title: 'Hello World Demo Application',              // theme of the widget       theme: ThemeData(         primarySwatch: Colors.lightGreen,       ),              // Inner UI of the application       home: const MyHomePage(title: 'Home page'),     );   } }  // This class is similar to MyApp instead it // returns Scaffold Widget class MyHomePage extends StatelessWidget {   const MyHomePage({Key? key, required this.title}) : super(key: key);   final String title;    @override   Widget build(BuildContext context) {     return Scaffold(       appBar: AppBar(         title: Text(title),         backgroundColor: Colors.green,         foregroundColor: Colors.white,       ),              // Sets the content to the       // center of the application page       body: const Center(                      // Sets the content of the Application           child: Text(         'Welcome to Android Studio!',       )),     );   } } 

Output:

android_studio_output


Create a New Flutter Project Using Visual Studio Code

Step 1 : Open the Visual Studio Code IDE

Note:  if you like to create a flutter project using terminal use the below command and jump  right into step 7.

$ flutter create flutter_app

replace the ‘ flutter_app ‘ with your project name

Go to View->Command Palette Or press Ctrl+Shift+P. it will automatically open Command Palette.

commandpalette

Step 2 : Search for “Flutter: New Project”

Select Flutter: New Project.

flutternew

Step 3 : Select the Flutter Application as the project type.

typeofapp

Step 4 : Select folder

After selecting type of application, it will ask you to select folder to generate the code in that folder, select an empty folder if you already have, otherwise create a new one and select.

selectfolder

Step 5 : Enter the Name of the project and click on Enter.

appname

Step 6 : Folder Structure

It will generate all required files and folders. Now open main.dart which is in geeksforgeeks->new_project->geeks_for_geeks->lib->main.dart

Write---Post-Improvement---Google-Chrome-11-03-2025-11_15_03

Step 7 : Edit Code

We have to edit the code in main.dart as mentioned in the above image. We can see that Android Studio has automatically generated most of the files for our flutter app.

Replace the dart code in the lib/main.dartfile with the below code:
main.dart:

Dart
// Importing important packages require to connect // Flutter and Dart import 'package:flutter/material.dart';  // Main Function void main() { // Giving command to runApp() to run the app.  // The purpose of the runApp() function is to attach // the given widget to the screen.   runApp(const MyApp()); }  // MyApp extends StatelessWidget and overrides its // build method. class MyApp extends StatelessWidget {   const MyApp({Key? key}) : super(key: key);  // This widget is the root of your application.   @override   Widget build(BuildContext context) {     return MaterialApp(                // title of the application       title: 'Hello World Demo Application',              // theme of the widget       theme: ThemeData(         primarySwatch: Colors.lightGreen,       ),              // Inner UI of the application       home: const MyHomePage(title: 'Home page'),     );   } }  // This class is similar to MyApp instead it // returns Scaffold Widget  class MyHomePage extends StatelessWidget {   const MyHomePage({Key? key, required this.title}) : super(key: key);   final String title;    @override   Widget build(BuildContext context) {     return Scaffold(       appBar: AppBar(         title: Text(title),         backgroundColor: Colors.green,         foregroundColor: Colors.white,       ),              // Sets the content to the       // center of the application page       body: const Center(                      // Sets the content of the Application           child: Text(         'Welcome to Visual Studio Code!',       )),     );   } } 


Output:

visual_studio_output




Next Article
Recipe Finder Application in Flutter
author
aditya_taparia
Improve
Article Tags :
  • Flutter
  • Flutter
  • Flutter-Plugins

Similar Reads

  • Flutter - Creating a Simple Pokémon App
    Embark on an exciting journey into the vibrant world of Pokémon with an innovative mobile app, that we will be building in this article - 'PokeDex.' Powered by the versatile Flutter framework and integrated with the extensive Pokemon API, this app redefines the Pokémon experience. Flutter is a cutti
    6 min read
  • Creating a Finance Tracker Application in Flutter
    Developing a new tracker for finance is a good practice to improve your skills and build a helpful application. Through Flutter, an open-source UI toolkit developed by Google, it is possible to design for iOS/ Android, web, and desktop. Here you will find out the recipe of how to create a finance tr
    6 min read
  • Photo Editing Application in Flutter
    With the introduction of the powerful image_editor_plus package, editing images directly within your Flutter app has become significantly more accessible. In this article, we'll dive deep into building a user-friendly image editor app. Users will have the ability to select an image from their camera
    7 min read
  • Recipe Finder Application in Flutter
    This app will display a list of recipes in a card format, each containing the recipe title, a rating, the cooking time, and a thumbnail image to give users a visual preview. The app is dynamic and flexible, allowing you to easily update the recipe list or modify the UI as needed. By the end of this
    5 min read
  • Flutter - Creating App Intro Screens
    Flutter is known for its easiness to create cross-platform applications. Either it is creating introduction screens for the app or any screen. We got an easy way to create Intros for the app using the intro_slider library of Flutter. In this article, we are going to implement it in the sample app.
    4 min read
  • How to Create a Desktop Window Application in Flutter?
    The Flutter team recently released Flutter version 2.10 with Desktop support. Desktop support allows you to compile Flutter source code to a native Windows, macOS, or Linux desktop app. Flutter’s desktop support also extends to plugins—you can install existing plugins that support the Windows, macOS
    3 min read
  • EBook reader Application in Flutter
    EBook reader Application brings the library to your fingertips. This application will be the travel partner of every book lover who loves to read books of their choice. The app is developed using Flutter and provider state management. It uses the Google Books API to fetch the data of books. The app
    8 min read
  • Creating a Calculator using Calculator Widget in Flutter
    If you need a Calculator in Flutter or need to do a small calculation in your flutter application, Writing your own code going to be tough, but Flutter gives you a SimpleCalculator Widget, Which allows you to create a Beautiful simple calculator. Only you need to set up the package in pubspec.yaml f
    3 min read
  • How to Build a ToDo Application in Flutter?
    Flutter offers a stable framework for constructing richly UI-driven cross-platform applications. In this article, we will learn to build a ToDo Flutter Application. What is the ToDo Application?The ToDo application helps users manage and organize their tasks and responsibilities more easily. Managin
    6 min read
  • Simple Age Calculator App using Flutter
    Flutter SDK is an open-source software development kit for building beautiful UI which is natively compiled. In this article, we'll build a simple Flutter app that calculates a person's age based on their birthdate. To do this, we'll need to take input from the user, perform the calculations, and di
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences