Flutter之包管理

添加Pub仓库包

Pub(https://pub.dev/ )是Google官方的Dart Packages仓库

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.0
  # 新添加的依赖
  english_words: ^3.1.3

依赖本地包

dependencies:
    pkg1:
        path: ../../code/pkg1

依赖Git

在根目录

dependencies:
  pkg1:
    git:
      url: git://github.com/xxx/pkg1.git

不在根目录

dependencies:
  package1:
    git:
      url: git://github.com/flutter/packages.git
      path: packages/package1

你可能感兴趣的:(Flutter之包管理)