Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do packages harm flutter application?

Tags:

flutter

dart

I'm using too many packages in my flutter application, isn't a good thing to do so? do many packages harm the application's performance?

like image 411
Yusuf Abdelaziz Avatar asked Apr 23 '20 16:04

Yusuf Abdelaziz


People also ask

Should you use packages Flutter?

Flutter supports using shared packages contributed by other developers to the Flutter and Dart ecosystems. This allows quickly building an app without having to develop everything from scratch.

How many packages are in Flutter?

dev has a growing ecosystem of over 24,000 packages to help you add functionality to your Flutter application and leverage solutions created by the community.

Is Flutter enough for app development?

Of course, you can also create your own components, and for this, Flutter is truly excellent. Creating good looking custom UI elements is very easy, and you will have them working on both Android and iOS. This makes Flutter a perfect choice for mobile apps with advanced, custom UI designs.

What is package in Flutter?

Packages, according to Flutterdocs, can be explained as “shared packages contributed by other developers to the Flutter and Dart ecosystems. This allows developers to quickly build an app without having to develop everything from scratch.”

Why flutter packages are the best choice for app development?

With Flutter Packages, Flutter becomes more preferable for writing easy-to-use and customizable codes for building applications running well on iOS, Android, Windows, Linux, etc. Even many of the developers praise the ingenuity of these packages as while developing an application, they need not think about STARTING FROM THE SCRATCH.

What is a shared package in flutter?

Flutter supports using shared packages contributed by other developers to the Flutter and Dart ecosystems. This allows quickly building an app without having to develop everything from scratch. What is the difference between a package and a plugin?

How do I upgrade a package in flutter?

To upgrade to a new version of the package, for example to use new features in that package, run flutter pub upgrade ( Upgrade dependencies in IntelliJ or Android Studio) to retrieve the highest available version of the package that is allowed by the version constraint specified in pubspec.yaml .

What is a plugin in flutter?

A plugin package is a special kind of package that makes platform functionality available to the app. Plugin packages can be written for Android (using Kotlin or Java), iOS (using Swift or Objective-C), web, macOS, Windows, Linux, or any combination thereof. For example, a plugin might provide Flutter apps with the ability to use a device’s camera.


1 Answers

After looking over the web I couldn't find a single article that talks about this issue, not even the flutter documentation.

But on their section about optimizing the app, the flutter team says about reducing app size(which can also affect performance obviously):

Some of the other things you can do to make your app smaller are:

Remove unused resources

Minimize resource imported from libraries

Support a limited number of screen densities

Compress PNG and JPEG files

looking at :

Remove unused resources

Minimize resource imported from libraries

You can conclude that inclding packages does not mainly hurt performance, but importing alot of resources from these packages into your file and not using them effeciently can hurt it (look at @jamesdlin 's comment:to understand why is that (its about tree shaking process)

If the packages you import have a lot of code that can't be tree-shaken away (e.g. code in the package is very interconnected), then it can impact the size of your binary.

And as a final note, from my usage of flutter and often usage of alot of packages in my apps (to save alot of boilerplate), I can't say that I notice any performance issues due to many packages being present in my app

like image 174
Haidar Avatar answered Oct 22 '22 07:10

Haidar