【问题标题】:Problem with flutter retrofit @Multipart annotation颤振改造@Multipart注释的问题
【发布时间】:2021-06-04 18:31:07
【问题描述】:

在我正在开发的 Flutter 应用程序中,我使用 Retrofit.dart 包进行网络。

我使用 @Multipart@Part 注释发送带有图像文件的 Multipart POST 请求。

我最近在pubspec.yaml 更新了一些包版本。之后我收到一条错误消息,提示 >Undefined name Multipart used as an annotation. 和 >Undefined name Part used as an annotation

我在他们随包提供的文档中找不到有关 Multipart 请求的任何信息。

谁能解释我正在做的事情有什么问题,或者有没有其他方法可以使用flutter-retrofit发送多部分请求

@MultiPart()
@POST(EditProfile) //URL
Future<LoginResponse> editProfile(@Part(name: 'name') String name,
@Part(name: 'email') String email, @Part(name: 'image') File image);

【问题讨论】:

    标签: flutter dart multipart


    【解决方案1】:

    请使用明确的版本代码更新您的 pubspec.yml。

    并且目前不要启用 null-safety。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-16
      • 2021-05-05
      • 2022-01-12
      • 2021-10-20
      • 1970-01-01
      • 1970-01-01
      • 2022-10-04
      相关资源
      最近更新 更多