【问题标题】:Remove flutter plugin from dependenciesRemove flutter plugin from dependencies
【发布时间】:2022-12-16 13:46:39
【问题描述】:

I wanna delete the flutter toast plugin that I have in my project.

dependencies:
  flutter:
    sdk: flutter
  fluttertoast: ^8.0.9

How to remove it safety? I want to:

  • delete this linefluttertoast: ^8.0.9frompubspec.yaml文件
  • 删除这段代码pubspec.lock
fluttertoast:
    dependency: "direct main"
    description:
      name: fluttertoast
      url: "https://pub.dartlang.org"
    source: hosted
    version: "8.0.9"
  • 删除文件中未使用的 flutter toast 导入

可以吗?或者我应该用另一种方式来做吗?

【问题讨论】:

  • 只需运行 flutter pub remove fluttertoast,输入 flutter pub -h 获取更多信息

标签: flutter plugins


【解决方案1】:
  1. Remove fluttertoast from you "pubspec.yaml" file and hit flutter pub get in the terminal and remove the imports from your project.

    Or

    1. Hit flutter pub remove fluttertoast in the terminal and remove the imports.

    This should work.

【讨论】:

  • Run flutter pub remove fluttertoast and remove imports works fine :) Thanks
【解决方案2】:

首先删除fluttertoast: ^8.0.9yamel 文件中的所有配置,然后删除您在dart 文件中使用的所有import。之后运行flutter pub get

【讨论】:

    猜你喜欢
    • 2022-12-27
    • 2020-12-10
    • 1970-01-01
    • 2021-09-24
    • 2022-12-28
    • 1970-01-01
    • 2022-11-20
    • 2022-05-17
    • 2022-12-19
    相关资源
    最近更新 更多