Making Your Own Packages
Now that you know how to use a package, you might want to know how to make your own package and how you can write platform-specific code to be used inside a Flutter app.
Creating the Package
Making a package is a lot like making an app.
If you’re using Android Studio, you just need to use File -> New -> New Flutter Project.
If you only need to use multi-platform Dart code for your package, choose the Flutter Package option, if you also need to add iOS(Objective-C/Swift) or Android(Java/Kotlin) code, choose Flutter Plugin.
Interaction between Dart code and platform-specific code is described in Integrating Native Code: Making Plugin Packages.
If you’re using the command line, run this command:
| flutter create --template=package ... |
Get Programming Flutter now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.