Quick Learnology

Flutter Basics

  • Creating a new project. 

Using platform android studio 

As you have installed flutter plugin, Now find the File>New>New Flutter Project. 

Or  

You can create new project just by clicking on Create New Flutter Project button on opening window popup. 

After that just Fill the desired labels and click on the Finish button. 

  • An Overview of files and folders generated in Flutter Project. 
  1. (/.idea) folder

This is the folder which contains some configuration files related to Android studio. As we are working with the flutter framework, we don’t need these right now. 

  1. (/android) folder

It contains the complete android project as we can also create it without flutter. So, when in the end flutter code gets converted into native code for android it gets injected into this folder and which gets build into an android application. This is also a folder which is used by flutter SDK not a folder we as flutter developers work on. 

  1. (/build) folder

This folder contains the output of our flutter application.  It is generated and managed by flutter SDK. We are not advised to change anything in this folder, flutter SDK automatically makes changes in this folder while developing the application. 

  1. (/ios) folder

It Contains the complete ios project. So, In the end when flutter code gets converted into native code for ios it gets injected into this folder and which gets build into an ios application. This is also a folder which is used by flutter SDK not a folder we as flutter developers work on. 

  1. (/lib) folder 

Lib stands for library. This is a very important folder in which we as developers spend most of our time while developing our application. Here we store our .dart files which are used by our application. 

  1. (/test) folder

This folder contains the test files for our flutter application. These files help us to write automated tests for our flutter application. As a fresher we don’t care about this folder but as we became more mature flutter developers and able to write tests for our applications. 

  1. (.gitignore) file

This file is related to a “git” version control system which is a source code management tool. It is an optional file if we are developing our application locally. 

  1. (.metadata) file

This file which is used by flutter SDK to store some metadata about our flutter application. 

  1. (.packages) file

It is a file generated by flutter SDK which takes care of some internal dependencies. It is been managed automatically by Flutter. 

  1. (analysis_options.yaml) file

This file is used to configures the analyzer, which statically analyzes Dart code to check for errors, warnings, and lints. 

  1. (pubspec.yaml) file

It’s a configuration file for our flutter project. It allows us to manage dependencies of our project. Here we can configure the third-party packages our project might be using. We can configure another things here like fonts, images we want to use in our application. 

  1. (pubspec.lock) file

This file is related to (pubspec.yaml) file. It is automatically generated based on pubspec.yaml. It is required by flutter but this is not something to worry about. 

  1. (README.md) file

This file holds a small description of our project which might be useful while hosting our project on a version control system like Github, Bitbucket ,etc.