Flutter’n Fun

Flutter: Packages vs Plugins

S Sharanya Bharghavi
2 min readMar 30, 2022

While developing flutter we often interchangeably use plugins and packages. But there is a difference between the two. Here is an article about it

What is a Package?

The package is Dart’s technique of organising and sharing a group of functions. Dart Packages are just libraries or modules that can be shared. Dart Package is similar to Dart Application in most ways, with the exception that Dart Package does not have an application entry point, main.

Dart code that relies on the Flutter framework and is only suitable for use in a specific environment forms a flutter package.

A package module created in Dart can be shared across projects and reused. Packages contain only dart code. A package can use plugins in it and it will still qualify as a package.

What is a Plugin?

Plugins are a special type of package. Plugins are specific packages made that have some code that relies on the underlying platform and hence creating one and testing its implementation will need know knowledge of the native platform for which it is developed.

The API of plugins are written in Dart. Implementation of them is written in native code ie. Java/Kotlin(for Android) and Swift/Objective C(for ios) or both, for having cross-platform support.

Note: Both packages and plugins can be found in pub.dev

References:

Developing packages & plugins | Flutter

--

--