how to use local flutter package in another flutter application?

How to use local flutter package in another flutter application?

I created a package using following command:

flutter create --template=package my_new_package


and then in my application source code => main.dart

import "package:my_new_package/my_new_package.dart" // can not find the package


locate this file in your flutter application => pubspec.yaml

make local dependency

dependencies:
flutter:
sdk: flutter
my_new_package:
path: ./my_new_package

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

Chart JS +ng2-charts not working on Angular+2