[Lao Meng Flutter] 6 toolkits that greatly improve the efficiency of Flutter development

[Lao Meng Flutter] 6 toolkits that greatly improve the efficiency of Flutter development

Lao Meng's Guide : This article introduces 6 toolkits that greatly improve Flutter's development efficiency.

[1] Powerful logging package

Printing logs in the process of developing Flutter is one of the common debugging methods, but the built-in log printing of Flutter is very simple. Here is a powerful software package: logger .

Logger is an easy-to-use and extensible logger that can print beautiful logs. Inspired by the Android logger, the logs are divided into different levels:

logger.v("Verbose log");

logger.d("Debug log");

logger.i("Info log");

logger.w("Warning log");

logger.e("Error log");

logger.wtf("What a terrible failure log");

When the inside release version, testers do not have the phone connected to your computer, so there can not be, by the console log when you print bug logger_flutter this plugin can solve this problem, this plug-in by shaking the phone call or LogConsole.open(context)display the log directly on the phone.

Logger pub address: pub.dev/packages/lo...

logger_flutter pub address: pub.dev/packages/lo...

[2] Convert Json data to model

Normally, the data returned by the server interface is in json format. It is very tedious to convert data in json format into entity classes, especially complex json data. It is recommended that you use the JsonToDart plug-in, Android Studio and VS Code editors. Anyone can install this plug-in, which can help us convert data in json format into entity classes.

Detailed usage and installation: laomengit.com/guide/data_...

[3] View the UI effect on mobile phones with different resolutions

The biggest advantage of Flutter development is its cross-platform. When the development is completed, I want to check the effect on mobile phones with different resolutions. Do I need to buy one for each mobile phone for testing?

Flutter Interact in 2019 showed us how to debug applications on multiple platforms and devices at the same time

The following toolkit device_preview allows you to view the effect of UI on devices of different resolutions on one device.

More than that, it also has other cool features:

  • Change device orientation
  • Dynamic system configuration: language, dark mode, text scaling
  • Freely adjustable resolution and safe area equipment
  • Keep application state
  • Screenshot

device_preview address: pub.dev/packages/de...

[4] Use stable and master at the same time

When developing a project, we usually use the stable channel to build a stable version, but at the same time we also want to experience the new version, new features, that can only be switched to the master channel , but at this time the version of the stable project is also switched, switching back and forth is very Trouble, in addition to re-downloading a large number of files every time you switch, there may also be exceptions. Every version upgrade will cause many people to encounter the problem that the project cannot be compiled.

So how can a stable channel and a master channel exist at the same time ? Use stable channel for normal development and master channel when you want to experience the new version .

The fvm plugin will help you. fvm is short for Flutter Version Management and is a simple CLI for managing Flutter SDK versions.

pub address: pub.dev/packages/fv...

[5] Internationalization Toolkit

Some people may think that my project does not require internationalization, only Chinese is required, but I still strongly recommend that you join internationalization for the following reasons:

  • No one knows what will happen in the future. Whether or not to support internationalization is a matter of one word from the boss.
  • Increasing internationalization will not increase your workload. You can leave it blank for languages in other countries without translation.

The Intl plug-in can help us quickly complete internationalization.

Detailed use: laomengit.com/guide/intl/...

[6] Application upgrade function

Finally, I will introduce the application upgrade function package that I developed by myself. The upgrade function should be one of the necessary functions of the application.

Currently supports Android and iOS:

Detailed use: laomengit.com/plugin/upgr...

communicate with

Laomeng Flutter blog (330 control usage + actual combat introduction series): laomengit.com