Flutter 使用包资源

2020-07-19  本文已影响0人  喜剧收尾_XWX
  1. Depend on it
    Add this to your package's pubspec.yaml file:
dependencies:
  provider: ^4.3.1
  1. Install it
    You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

  1. Import it
    Now in your Dart code, you can use:
import 'package:provider/provider.dart';
上一篇 下一篇

猜你喜欢

热点阅读