Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 改装发电机:升级到零安全版本后,在颤振时改装碰撞_Flutter_Dart_Retrofit_Dart Null Safety - Fatal编程技术网

Flutter 改装发电机:升级到零安全版本后,在颤振时改装碰撞

Flutter 改装发电机:升级到零安全版本后,在颤振时改装碰撞,flutter,dart,retrofit,dart-null-safety,Flutter,Dart,Retrofit,Dart Null Safety,我正在尝试将我的颤振应用程序升级为空安全应用程序,但我遇到了改装代码生成器的问题 我有一个RestAPI抽象类,声明如下: @RestApi(baseUrl:ApiConsts.authBaseURL) 抽象类IAuthApi{ 工厂IAuthApi(Dio Dio)=\u IAuthApi; @POST(ApiConsts.verifyPath) 未来的verifyToken(@Body()VerifyBody); } 数据类别如下: @JsonSerializable(includeIf

我正在尝试将我的颤振应用程序升级为空安全应用程序,但我遇到了
改装
代码生成器的问题

我有一个
RestAPI
抽象类,声明如下:


@RestApi(baseUrl:ApiConsts.authBaseURL)
抽象类IAuthApi{
工厂IAuthApi(Dio Dio)=\u IAuthApi;
@POST(ApiConsts.verifyPath)
未来的verifyToken(@Body()VerifyBody);
}
数据类别如下:

@JsonSerializable(includeIfNull:false)
类验证体{
@JsonKey(名称:“授权类型”)
字符串grantType;
@JsonKey(名称:'client_id')
字符串clientId;
字符串用户名;
字符串otp;
字符串域;
弦乐观众;
字符串范围;
VerifyBody(this.username、this.otp、,
{this.grantType=ApiConsts.GRANT_类型,
this.clientId=ApiConsts.CLIENT\u ID,
this.realm=ApiConsts.SMS,
this.academy=ApiConsts.academy,
this.scope=ApiConsts.AUTH\u scope});
工厂VerifyBody.fromJson(映射json)=>\u$VerifyBodyFromJson(json);
映射到JSON()=>$VerifyBodyToJson(此);
}
@JsonSerializable(includeIfNull:false)
类访问令牌{
@JsonKey(名称:“访问令牌”)
字符串访问令牌;
@JsonKey(名称:“刷新令牌”)
字符串刷新令牌;
@JsonKey(名称:“id_令牌”)
字符串idToken;
字符串范围;
@JsonKey(名称:'expires_in')
呼气素;
@JsonKey(名称:“令牌类型”)
字符串类型;
AccessToken(this.AccessToken、this.refreshtToken、this.idToken、this.scope、this.expiresIn、,
这是一种特殊类型);
factory AccessToken.fromJson(Map json)=>u$AccessTokenFromJson(json);
Map to JSON()=>$AccessTokenToJson(这个);
}
当我运行命令生成改装代码时
pub-run-build\u-runner-build——删除冲突的输出

我得到以下错误:

[SEVERE] retrofit_generator:retrofit on lib/services/api/AuthAPI.dart:

type 'ExpandIterable<InterfaceType, MethodElement>' is not a subtype of type 'Iterable<MethodElementImpl>' of 'iterable'
[严重]改装\u生成器:在lib/services/api/AuthAPI.dart上改装:
类型“ExpandIterable”不是“Iterable”的类型“Iterable”的子类型
有人遇到过类似的情况吗?

这是一个已报道的问题

它将在下一版本中修复

对于临时修复:

retrofit_generator:
  git:
    url: https://github.com/Chimerapps/retrofit.dart.git
    ref: 9f90296751984b359937c38563da5b19db5550f5
    path: generator

这很有效。令人惊叹的。非常感谢你