you can use two ways,upload your package to github and access via it,or local..here are the code for it
Path dependency
A Flutter app can depend on a package using a file system path: dependency. The path can be either relative or absolute. Relative paths are evaluated relative to the directory containing pubspec.yaml. For example, to depend on a package, packageA, located in a directory next to the app, use the following syntax:
dependencies:
packageA:
path: ../packageA/
from git
You can also depend on a package stored in a Git repository. If the package is located at the root of the repo, use the following syntax:
2
Answers
You can add it in the
dependency
part and specify a name.And use it as
you can use two ways,upload your package to github and access via it,or local..here are the code for it
Path dependency
A Flutter app can depend on a package using a file system path: dependency. The path can be either relative or absolute. Relative paths are evaluated relative to the directory containing pubspec.yaml. For example, to depend on a package, packageA, located in a directory next to the app, use the following syntax:
from git
You can also depend on a package stored in a Git repository. If the package is located at the root of the repo, use the following syntax:
for more info get an idea from this https://docs.flutter.dev/development/packages-and-plugins/using-packages