I have been using Flutter for three months and have now developed two small applications. One is a replacement for a small program that I was already using in my work, which was originally written in Easy Language. The second application is a simple RSS reader that I created by imitating an open-source project.
Flutter is a front-end framework that allows you to build, test, and publish beautiful applications for mobile, web, desktop, and embedded platforms using a single codebase.
I came across Flutter by chance while browsing on my mobile version of Google Chrome. I was attracted to its cross-platform capabilities. Most front-end frameworks in the market either allow you to build apps or websites, and they require learning different programming languages. Learning any one of them is not easy.
When I started searching online, I found a lot of information about Flutter's growing popularity. Although it still has some distance to cover compared to other mature frameworks, its cross-platform capabilities make it a good choice for developing cross-platform software. Additionally, the Dart language used in Flutter is relatively simple. So, I chose Flutter in the end.
First Application#
The first application I developed using Flutter is a calculation tool primarily designed for salespeople in my current job. We were already using a small program written in Easy Language, but it could only be used on computers. It would be more convenient for salespeople to use it on their phones. This application is likely to be useful for salespeople, so I developed it to test the waters and consider further development.
The entire replication process took about two months. I worked on it mostly in the evenings after work. It took me six weeks to develop the first page because I was learning while doing it. I also standardized some commonly used components and worked on screen adaptation. The second page didn't take much time for component layout, but I spent three evenings working on data processing. Overall, it took me a week to complete the second page.
Second Application#
The second application is a simple RSS reader.
I found an open-source project to imitate and learn how to write programs, especially in terms of file structure and code formatting. I removed all unnecessary features from the project. The most time-consuming part was parsing the feed, which is the core functionality of this project. Without it, there wouldn't be much left. I spent a week analyzing how the source code was implemented and another week learning and validating the code. I only implemented the core functionalities, such as parsing and adding a feed source, browsing titles, and reading the full article. Although it may seem like a few small features, it took me a month to complete them, including two weeks of writing code and learning Isar database and Riverpod state management. Storing and retrieving feed data required a database for quick querying, which I hadn't dealt with before. In the first application, I used Provider for state management, but it had a major limitation when it came to managing state across widget trees. Riverpod state management, on the other hand, is a wrapper for Provider and functions like a global variable, not limited by the widget tree.
In the end, I developed a simple application. The biggest takeaway was that reading the project's source code helped me understand file structure better than before, and I also discovered the incredibly useful Isar database.
My Programming Experience#
Before this, I had only learned Python, C, and WeChat mini-programming as hobbies. I learned the basics of syntax and basic usage.
In college, I had to use microcontrollers for my graduation project, and they required programming in C. I also learned about mini-programming during my graduation project. At that time, I was working on a graduation project called "Power Training Counter Based on the Internet of Things." I needed a mini-program to display the data recorded on the device on WeChat. I only had one month to complete the graduation project, so I worked on it from morning till night every day. It took me less than a week to learn the syntax required for the mini-program. I used ESP8266 with Arduino to write the code for the microcontroller, and it took me less than two weeks to validate the code required for the module and combine everything together. I also spent a week designing and assembling the casing. After that, I used and modified the device in practice.
I have also learned the basics of Python syntax and can write some office automation scripts.
Flutter uses the new Dart language, but I didn't learn Dart syntax. Based on my experience of self-learning other programming languages, I knew it wasn't necessary for beginners. If you have a basic understanding of programming, you can start writing Flutter programs without learning Dart syntax. Writing code allows for faster feedback.
With my basic knowledge and experience, I can understand some code without learning Dart syntax. I mainly rely on the official tutorials and documentation. If I don't understand something, I search for it on Google. Although I still have some gaps in my understanding, I can generally write a program.
Beginner's Development: Setting Up the Development Environment#
Flutter was the first front-end framework development environment I set up. However, the process of configuring the Flutter environment can be unexpectedly challenging. It took me four nights to set up the Flutter environment on my Windows computer.
During the configuration process, I encountered various problems that were not mentioned in most installation tutorials. Each problem took at least an hour to solve, and I was afraid that I wouldn't be able to overcome this configuration step. Sometimes, when I couldn't find a solution, I wanted to give up. However, Flutter is a framework that allows for cross-platform development, so I persevered. Fortunately, the second half of the configuration process went smoothly; otherwise, I might have given up.
In conclusion, the Flutter development environment is not beginner-friendly.
Beginner's Development: Using Components#
Once I got through the configuration of the development environment, I didn't face many issues while writing a simple program in Flutter. Flutter uses widgets to build all UI components. The component styles are directly built within the widgets, and the interaction and business logic are also written within the widgets. In Flutter, widgets are used throughout all pages and components. Each component or page can be considered as a widget, and they can be nested within each other to form a widget tree. When writing code, there is no need to think about layers. To explain further, it would require delving into the underlying principles of Flutter, which I have only briefly understood. It hasn't been a significant part of my usage, so I haven't delved deeper.
To use components, I mainly refer to the official documentation, which is quite detailed. There are also many tutorials available online, which make it easy to learn.
Beginner's Development: State Management#
Components have interactions, which means they have different states. In Flutter, managing states in real-time when interactions occur can be done in various ways. There are many state management solutions in the community, each with its pros and cons. Initially, I didn't have much knowledge about this, so I chose the official third-party package called Provider for state management. Provider wraps a class that can listen to widget changes, making it relatively convenient compared to building it from scratch. It works fine for simple state management, but it becomes challenging when it comes to managing state across widget trees or pages. This is a significant limitation.
Later, I learned about Riverpod, which is powerful. It is a wrapper for Provider but is as simple to use as a global variable. It is sufficient for general state management and easy to get started with. You can find tutorials that will help you get started, while it took me four nights to barely understand how to use Provider. Otherwise, I wouldn't have known how to use it.
Beginner's Development: Application Packaging#
Since I only have a Windows computer, I can only package Android and Windows applications.
If you have never packaged an Android application before, the process can be quite complicated. The most important part of packaging an app is configuring the signing. You can use the built-in functionality of Android Studio to create a signature, but most tutorials online are either incomplete or difficult to understand. So, I gave up on that method and found a way to create a signature using the command line. It seemed simpler to me, but it still required some time to find tutorials and try them out. Many tutorials online are incomplete.
After that, I followed online tutorials to configure the code for automatic signing during the packaging process. Once you follow the instructions, it should work fine. It may take some time to get familiar with it initially, but once you do, it's a one-time setup. You only need to configure it once for each project.
Packaging a Windows application is relatively simple. You don't need any configuration; just one command line is enough.
Beginner's Development: Application Distribution#
Normally, an application needs to be listed on major app stores for distribution. However, if you haven't done it before, the registration process can be time-consuming. Currently, I don't have the necessary information about it, but you can use the Pgyer app internal testing distribution platform. It's free and doesn't require registration.
Conclusion#
I have summarized the entire development process of a Flutter application. Overall, this is the first time I have developed a complete app for actual use. It is relatively easy to get started with.
However, I don't know if Flutter can handle more complex applications. I still need to explore that further.
For hobbyists, Flutter is a good choice. It has good development efficiency, and many things are already available. It is perfectly suitable for simple applications.