以 flutter
默认包管理位置:flutter\packages\flutter
作为演示,实际是在项目目录中
首先看这个目录下有一个 pubspec.yaml
配置文件
直接安装
此处cmd,下载最新的包
如果是 Dart 使用,运行
dart pub add http
如果是 Flutter 使用,运行:
flutter pub add http
执行结束你就会发现pubspec.yaml
中多出了配置项
dependencies:
http: ^0.13.5
手动安装
很简单,先配置pubspec.yaml
,然后下载包
dart pub get
或者 flutter pub get