Flutter is an Open-Source UI SDK created by Google. It permits the advancement of iOS/Android applications and utilizations Dart as the programming language. Dart is an Open-Source, customer side programming language. It is not difficult to learn, stable, and it helps many ios – android app development company in bangalore in creating high-performance applications. In this article we are going to learn get started with flutter. There are many interactive widgets to build beautiful flutter apps.
In today’s article we are going to learn get started with flutter project and components of its structure. So let’s start: –
- All right I opened up a new end of base coat.
- If you have not installed flutter sdk on your operating system then first thing you need to do is install flutter.
- Based on your operating system download the flutter sdk for your device.
- After successfully installed flutter let’s back to bezel studio code editor.
- I recommend you to use bezel studio code because it is lightweight and it has large number of extensions that helps you to foster development and most of the programmer using this code editor.
- All right now we’re going to create our first flutter application.
- In this code creating a new flutter application is quite easy.
- The first thing we are going to do is open a folder. We need to click on that and select a directory.
- I’m going to select desktop get started and then select folder. Now we are on get started folder.
- Now if you are on mac simply hold command shift and p together and if you are on windows simply hold ctrl+shift+p together.
- There are many comments appear we just need to find out flutter new project.
- I’m going to search for flutter. We can see flutter new project comment appear. We just need to click on that and then it’s asking for which template we are going to generate. We are going to generate a flutter application.
- So simply click on that and then we have to select a folder to create the project.
- I’m going to select again desktop get started and then select folder now. It’s asking for project name, I’m going to give a name. Note that name should be all lowercase and underscore two separate words. I’m going to give gate underscore started and then press enter the code is generating after a few minutes.
- You can see your flatter project is ready to run. There are lots of viral codes generated.
- Let’s understand all the components of the project.
- Android directory: – This is auto generated source code to create android application.
- ios directory: – This is auto generated source code to create ios application.
- Leave directory: – This is root directory which is containing dart code written using flutter framework main file this is the entry point of the flutter project.
- Test directory: – This is containing dart code to test the flutter application with a test file. There’s had simple code to test your application.
- If directory: – This is auto-generated source code to create web application.
- .gitignore file: – This is git version control file.
- .metadata file: – This is auto generated by the flatter tools.
- .packages file: – This is auto generated to track the flatter packages analysis options.
- .ml file: – This is performs static analysis of our code.
- .ima file: – This is project file used by android studio.
- log file: – This is auto generated by the flutter package manager pub.
- ml file: – This is used by pub here pop is a flutter package manager.
- md file: – This is project description file written in markdown format.
So these are all about components of project structure. Let’s understand dart code of main file line by line. In first line, imports the flutter material package or library. The material package to implement material components like a bar button input dialog alert selection layout and much more things. Then third to five lines of code, this is the entry point of the flatter application. Here calls run function and pass it an object of my app class. The purpose of the run app function is to attach the given widget to this screen.
Then 7 to 30 lines of code, there’s a stateless widget which doesn’t maintain any state of the application. Here my app extends stateless widget and overwrites its bolt method. The purpose of the build method is to create a part of the ui of the application. Here build method uses material app widget to create the root level ui of the application.
It has three properties by default i.e. title, theme and home. Title is used for title of the application. Themes are used to design the fonts and colors of the application primary search for set blue as the overall color of the application. Home is used for the default route of the application means the user defined in it. It displayed when the app starts normally. Now we’re going to do is just delete the my homepage widget that’s already in there because we’re going to learn this from scratch and learn the actual concept behind creating the widgets and the different types of widgets available in the flutter framework.
Add Comment