how to use local flutter package in another flutter application?

孤者浪人 提交于 2019-11-30 11:22:28

问题


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

回答1:


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

make local dependency

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


来源:https://stackoverflow.com/questions/51238420/how-to-use-local-flutter-package-in-another-flutter-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!