preface
It has been nearly two years since FlutterUnit was opened on April 15, 2020. Not many Flutter open source projects can be maintained for two years and run well. Due to various administrative and objective reasons, FlutterUnit is not updated very frequently. However, updates to Flutter version are maintained in time to ensure that Flutter can run.
For a long time, I spent my spare time on the volume. Now the fifth volume has been finished and will be put on sale this Wednesday. FlutterUnit will also be improved and improved with my in-depth study of Flutter framework.
In 2021, There was no great breakthrough in FlutterUnit. The major updates were the collection of component catalog and drawing catalog, and the development of server-side interfaces. The most important update point of FlutterUnit 2.0 is the code specification modification of all component cases, plus in-app version updates.
1. History of FlutterUnit 1.0 to 2.0
FlutterUnit’s time-light axis has been built into the FlutterUnit 2.0 app as a little egg, you can find it yourself. The following is a review of the development of FlutterUnit based on the screenshots of the time-optical axis:
2. Standardization of code
Now that you have Dart Analysis for the const keyword in your new project, take this opportunity to review and optimize the component sample code in FlutterUnit. After all, the first batch of code was produced two years ago, and there may have been some non-standard code due to cognitive limitations. In order to give beginners as much standard sample code as possible, all component code is reviewed.
For older projects, there may be no const keyword checking; simply add flutter_lints under the dev_dependencies dependency of pubspec.yaml.
The main problems are: const constructs and the modification of const keywords
Useless package imports:
Empty security legacy, non-empty objects do not need to be nulled:
A single attribute can be used without the Container component, or with unnecessary Container wrapping:
Unnecessary this:
If the function returns no value:
Final keyword modifier, and life variables of unknown type, or using the var keyword:
In addition, there is a small detail that you can control for Dart Analysis checks. Just set it in rules in analysis_options.yaml. For example, if you do not want to verify the format of the file name due to the uniqueness of the project, you can cancel the check by using file_names: false. Avoid_print: false also means do not check the print method.
About lints all specifications, can be in the dart – lang. Making. IO/linter/lint… To view:
3. In-app updates
When entering the application, the server interface checks the latest version and compares it with the current application version. If an upgrade is required, a small red dot will be displayed to guide the user to view it, as shown in the left picture below. The picture on the right below will show the new version. Click to download it.
The little red dot | Update the interface |
---|---|
Update/download status is managed via Flutter_bloc, so when downloading, you can switch to another screen without worrying about resetting. After the application is downloaded, the r_upgrade plug-in is used to install the application.
Download the interface | Update the interface |
---|---|
In-app upgrades require a combination of front end and back end, which is briefly described here. The following is the interface for obtaining the current information of the APP, which records the latest version, download address, app size and other information. In addition, there may be interfaces for adding, deleting and modifying the corresponding information.
Version updates are not just implemented in the APP, but also involve the maintenance of data on the server. For example, after the updated version, apK file upload, update the database application information, if manually to do it is too tedious. So I wrote a small tool class in Flutter_unit_tool. Once the app is packaged, I can automatically upload files and update app information in the database by changing the version number.
4. Update the drawing catalogue
Drawing collection is divided into five kinds of drawing, including basic drawing, animation gesture, particle drawing, interesting drawing, art gallery five kinds of collection. Among them, there are many cases, so that my niece always likes to take my mobile phone to play drawing collection, and in the future, she will continue to collect some fresh and interesting things to play.
Drawing collection – Basic drawing | Draw collection – Animated gestures |
---|---|
For example, you can play a game of tic-tac-toe with a friend here, or view the scatter plot effect of animation curve:
Tic-tac-toe chess | A scatter diagram |
---|---|
Or try taking regular polygons out of circles; Or the ability to rotate around a fixed point. These geometric explorations may allow you to get back to your roots and find some inspiration outside of programming.
Take shape in the round | Rotation about a fixed point |
---|---|
In addition, according to the case of drawing small volume, several particle cases are included:
Random particle generator | Particle splitting |
---|---|
For more interesting drawing examples, check out the app for yourself, and if you have any interesting drawing examples, please share them in FlutterUnit, where you’ll be able to display your drawings and tag them with your name.
5. Outlook and future of FlutterUnit
So far, FlutterUnit is still maintained by me alone. The original intention of FlutterUnit is to jointly maintain a collection of Flutter with the power of open source. May be my influence limit, may also be now really love to share too few people, white piao can, pay no talk. Just as the saying goes, poverty means being alone, and accomplishment means helping the world. When your strength is small, just be yourself, and you can move forward slowly even without company.
Future FlutterUnit will continue to have a collection of components and drawings, as new components will be released from time to time. In addition, the focus is on the improvement of the back-end Flutter_unit_server by bringing the component data of FlutterUnit online and keeping the local database as cache. In this way, offline use and online synchronization of the latest data can be achieved to complete seamless access.
Although the online synchronization function of the front and back end user system and collections has been preliminarily realized, it is not necessary to open it at present. For now, I prefer FlutterUnit as a stand-alone card checker learning tool until the component data is wired. Finally, it is hoped that more people will join in the maintenance of FlutterUnit and submit samples of components and drawings. That’s all I want to say. Happy birthday to me on March 28