Flutter 引用本地库和插件的方法

3 min read

工程目录下新建plugins文件夹用来存放本地插件

在工程中找到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