Flutter installed on device.
Creating a Flutter Package
Create a package
Implement the package
- I use Visual Studio Code to modify Flutter Packages
Test your plugin
Adding license to the LICENSE file
Publishing your package
Handling package interdependencies
Adding Package to a Flutter Project
Updating Flutter Project Package Dependencies
Updating Flutter Packages (Plugins) Automatically
Run Pub Outdated
$ flutter pub upgrade --major-versionsThis will update the
pubspec.yamlfile for you.
Review and resolve your dart code for outdated methods.
Updating Flutter Packages (Plugins) Manually
$ flutter pub deps to view dependency tree.
Update to the latest stable dart version by updating the Android Studio Dart Plugin
in the terminal run
$ dart --versionto get the installed version of dart.
<Repository Path>$ dart --version Dart SDK version: 2.12.1 (stable) (Wed Mar 10 10:18:47 2021 +0100) on "linux_x64" <Repository Path>$
For each Flutter Package view the versions and select the flutter package based on the
Min Dart SDK.
Choose a version that has the same first digit build number.
Example: installed dart is
2.12.01 (stable)so choose packages that support
Min dart SDKof
Choosing the lowest version and adding the
^allows the compiler to determine a compatible version (this is called
Pub upgradeand resolve any package version issue messages
Reference: How to modify an existing pub package to use in your flutter project
Find the repository on GitHub
Fork the repository
Commit and push changes
Add repository as a flutter pubspec yaml depencency
dependencies: flutter: sdk: flutter [package-name]: git: url: https://github.com/[git-username]/[git-repository-name]
From Flutter pub.dev, or local package
From Local Directory
- 2020.07.04 Created file
- 2020.07.05 Added
Adding Flutter Packagessection
- 2020.07.11 Added
Adding package from Githubsection
- 2021-04-09 Added
Updating Flutter Project Package Dependenciessection