flutter的插件引用的兩種方式
pub網絡庫引用方式
本地庫引用
一般是用pub直接引用插件就基本滿足需求了,但是所下載的插件針對不同的工程會有自定義的修改(改個顏色/字體/文字),而使用pub就會存在多個工程公用這一個插件的問題,那么就需要把這個插件拷貝下,單獨放到這個工程里獨自引用了
1.工程目錄下新建plugins文件夾用來存放本地插件

image.png
在工程中找到pubspec.yaml
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
#pub插件引用
# webview_flutter: ^0.3.0
#本地插件引用 注意縮進格式
webview_flutter:
path: plugins/webview_flutter