Home > Back-end >  Difference between package and plugin?
Difference between package and plugin?

Time:11-20

Difference between package and plugin? Easy and Basic??

Easy Answer which we can say in the interview . If someone ask!

CodePudding user response:

The simple easy answer to that question is:

A package contains only Dart code. A plugin contains both Dart code and Native code (kotlin/js/swift/...)

A package can use plugins if it wants to. It will still be qualified as a package.

CodePudding user response:

A plug-in is a type of package—the full name is a plug-in package, and it is generally referred to as a plug-in.

Packages:

At minimum, a Dart package is a directory containing a pubspec file. Additionally, packages can contain dependencies (listed in the pubspec), Dart libraries, applications, resources, tests, images, and samples. The pub.dev website lists many packages—developed by Google engineers and generous members of the Flutter and Dart communities—that you can use in your applications.

Plugins:

A plugin package is a special package that enables an application to use platform features. 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 a Flutter app with the ability to use the device's camera.

  • Related