With the 2.0 release version of Flutter, there was a huge commotion in the programming industry, especially among the mobile application frameworks. A commotion that generated countless receptive comments on social networks and several questions being asked on specific programming sites.
This commotion is given by the absurd growth of this Framework in recent years.
See Flutter’s popularity chart below compared to other similar frameworks on the famous Stack Overflow website. Notice how the framework has outperformed its main competitors in the past year.
What is Flutter?
Flutter is a framework developed by Google that gives developers the power to program a single source code and compile their application for several different operating systems.
Flutter uses the Dart programming language. A language also developed by Google and which is an integral part of the Framework.
At the time of writing this article, it allows the compilation of applications for Android, iOS, Web, Windows, Linux and Mac systems.
In addition to the platforms mentioned above, there is also evidence that Flutter will compile for Fuschia.
At first glance, those who already work with the Java language can repair a familiar philosophy. After all, one of the biggest attractions of the Java language is precisely the ability of your Virtual Machine (the famous JVM) to run a single source code on several different systems.
However, the main difference with Flutter is the fact that it will compile the code in the Dart language directly into the native language of the chosen platform, that is, without the need for a virtual machine (as is the case with Java).
See the difference in the illustration below:
How is the Flutter structured?
To understand the structure of Flutter, we first need to understand the concept of Widget.
Everything that is displayed to the user is a Widget: The application itself is a Widget. Each screen of the application is a Widget. The internal components of the screen, such as text boxes, buttons and labels are Widgets. Larger components, formed by groups of smaller elements, are also Widgets. That is, a Widget is the fundamental piece of Flutter.
With the HTML language it is possible to structure entire web pages using tags that are repeated. From the same point of view, the organization of an application in Widgets can be summarized in the same way. The main difference is that a Widget can be used as a basis for other more complex Widgets that can be used anywhere in the application, as if they were reusable components.
It may seem confusing at first, especially for someone who is coming from an Android application programming environment, who is used to concepts like Activities and Fragments. In Flutter, everything is a Widget. Which makes the learning and development process much simpler and easier.
What is the Pub?
One of the most interesting points is that Pub is a package manager for both Dart and Flutter, that is, with the same platform, you will be able to add utilities to facilitate the control of the application and to provide a better interface for your users.
For the Dart language, the Pub offers several packages that help and facilitate the life of the developer in several aspects, especially in terms of state management, data storage and connectivity.
For Flutter, the Pub offers a much greater number of options, ranging from audio and video players to packages of buttons and animations for you to use in your projects.
It is worth mentioning that dozens of new packages are being sent daily by the programmers themselves to further enrich the Pub, both for Dart and Flutter.
Where can I learn more about Flutter?
If you want to know:
- What Widgets are and how they are organized;
- What are the widgets that “come from the factory”;
- Ways of working with user interaction, such as taps, swipes, buttons and text;
- How to manage persistent data (using a local database);
- How to make HTTP calls and handle your data;
- And much more.
Read its official documentation.
There are also several tutorials that focus on deepening different aspects of Flutter. A good tip is to explore countless other tutorials in the great Awesome Flutter index.