Preface
Recently, there is a demand for a cross-platform desktop application. It needs to support windows
the / linux
/ mac
system. It needs to make a small interface for updating the application. The main function is to download the update file and replace it locally. It is a very simple small function.
It took a few minutes to build UI
an unoptimized sample interface:
Since our client programmers are very busy recently and have no time to do this function, I happen to be free and interested. I investigated several development frameworks for cross-platform applications . go
Since my main language is It can be used if you click it. The compiled application is very small and easy to use.go
wails
webview
webview
At this time, it suddenly occurred to me flutter
that desktop application development is now also supported. The main reason for using it is to fancy:
GitHub
has many starsGoogle
Endorsement from major manufacturers- Active community
dart
Simple and easy to use- Starting from the mobile terminal, the mobile terminal development is relatively complete.
- High performance
Let’s try it out! If it works well, it can be promoted in the team later.
Advantages and disadvantages of flutter
advantage
- Fast development cycle: Although hot reloading is now supported by most frameworks, it should also be mentioned that the hot reloading function makes the development cycle faster. You can see the effects of code changes in real time while your app is running, which helps with rapid debugging and iterative development.
- Beautiful user interface:
flutter
Provides rich built-in widgets and custom drawing options, allowing developers to easily create beautiful and highly customized user interfaces. - High performance:
flutter
UsingSkia
graphics engine for rendering can achieve high-performance user interface experience on different platforms. It also provides smooth animations and transitions through built-in hardware acceleration features. - Single code base: Developers only need to maintain a single code base to build applications for multiple platforms, which simplifies code maintenance and team collaboration.
- Rich community support:
flutter
We have a large and active community that provides a large number of resources, plug-ins and solutions to help developers solve problems and accelerate the development process.
shortcoming
- App size: Since
flutter
the app needs to contain its own runtime engine and framework, the initial size of the app may be larger. WhileGoogle
there are ongoing efforts to reduce application size, this may still be a problem for some applications. - Platform specificity: While it
flutter
is possible to build cross-platform applications, in some cases the features and behavior of a specific platform may not be fully abstracted, requiring platform-specific custom development. This should be a problem that all cross-platform applications need to face. - Third-party library support: Although
flutter
the community provides many plugins and libraries, there may be relatively few third-party libraries in some specific areas compared to some other platforms. Especially for desktop development, there is currently relatively little support. - Update frequency:
flutter
The framework is constantly evolving, and new versions bring new features and improvements, but this may also result in the need to frequently update your app to maintain compatibility with the latest version. After all, it is something new, andbug
it is a good thing to practice it more.
My cross-platform development experience
Specializing in mobile phonegap
( cordova
) => Specializing in desktop electron
=> Compatible with small programs uniapp
=> Mobile desktop flutter
.
Summarize
flutter
The difficulty of getting started is not bad, the overall development experience is not bad, and the Chinese community is also quite strong. Basically, all questions can be answered by searching.
However, it still took me a day to make the above-mentioned small application (setting up a development environment, familiarizing myself with its framework structure, basic syntax, data requests, etc.). Mainly, I encountered a coding pit and could not find a solution for a long time.
I want to complain here. The application I made has a decompression function, but I encountered an gbk
encoding problem. flutter
It is really not friendly to Chinese users. This problem took me a long time, and finally I had to go through the source code to solve it (maybe I am too bad = -=!).
Cross-platform provides convenience, but also increases complexity, and there is still a need for developers' breadth of knowledge. When using these cross-platform development frameworks, if they are relatively low-level, you will inevitably have to deal with native ones. Generally, you can still find solutions if you look around for problems.
When choosing between using flutter
or other technologies, trade-offs and decisions should be made based on project needs and team experience.