根据我截图的两张图片,我对在 Retrofit 中制作 RestClient 感到困惑。当我删除 Post Method 时,零件文件 (api_service.g.dart) 没有出错。看看这张图片:
但是当我添加 Post Method 时,部分文件(api_service.g.dart)会出错。看起来像这样:
错误是:
error: Target of URI hasn't been generated: 'api_service.g.dart'. (uri_has_not_been_generated at [apps] lib\data\remote\api_service.dart:6)
和
error: The name '_RestClient' isn't a type and can't be used in a redirected constructor. (redirect_to_non_class at [apps] lib\data\remote\api_service.dart:11)
那么,解决方案如何?提前致谢