Flutter › Flutter Plugin & Package Development
What is the difference between a Dart package and a Flutter plugin, and when would you specifically need to build a plugin rather than simply a pure Dart package?
BeginnerAnswer
A pure Dart package contains only Dart code and can genuinely be used across any Dart environment, including server side or command line applications, whereas a Flutter plugin specifically includes platform specific native code, such as Kotlin or Java for Android and Swift or Objective-C for iOS, and is genuinely required whenever your particular functionality needs to actually interact directly with an underlying native platform capability, such as accessing the device's camera or its GPS sensor, that simply cannot be implemented using pure Dart code alone.
flutter create --template=plugin my_plugin
flutter create --template=package my_dart_packageReal-world example A team building a genuinely simple utility library containing only date formatting helper functions creates a pure Dart package, while a separate team needing direct access to a device's specific native Bluetooth hardware capability instead creates a proper full Flutter plugin.