美文网首页
Flutter 使用包资源

Flutter 使用包资源

作者: 喜剧收尾_XWX | 来源:发表于2020-07-19 22:42 被阅读0次
    • 访问包仓库 https://pub.dev/
    • 搜索到你想要的包,以provider为例子
    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';
    

    相关文章

      网友评论

          本文标题:Flutter 使用包资源

          本文链接:https://www.haomeiwen.com/subject/nscdkktx.html