有没有办法处理 Visual Studio for mac 中的“非空属性必须包含非空值”警报。好吧,我找不到通过从 csproj 项目文件或配置中删除该行来禁用它的方法。这些警告位于我的数据库模型和视图中,我们的想法是以最佳方式进行。应该说我用的是.Net 6.0
预先感谢您花时间阅读这个问题。
我在尝试使用我的 API 时遇到问题,在跟进这个问题后,我陷入了困境,我尝试了不同版本的不同模拟器,但问题仍然存在。
错误:
DioError [DioErrorType.other]: HttpException: Connection closed before full header was received, uri = http://10.0.2.2:7108/Users/authenticate
Run Code Online (Sandbox Code Playgroud)
扑医生
HTTP 邮递
class AuthenticateRemoteApi extends AuthenticateGateway {
final AuthenticateMapper _authenticateMapper = AuthenticateMapper();
@override
Future<SesionUser> login(Authenticate user) async {
var dio = Dio();
dio.options.headers['content-Type'] = 'application/json';
String url = 'http://10.0.2.2:7108/Users/authenticate';
try {
Response response = await dio.post(url, data: authenticateModelToJson(user));
return _authenticateMapper.fromMap(jsonDecode(response.data));
} catch (e) {
throw Exception(e);
}
}
}
Run Code Online (Sandbox Code Playgroud)