如何修复改造颤振中生成文件中的错误?

时间:2021-05-05 10:44:11

标签: flutter retrofit code-generation

我有问题 我在颤振和生成文件中使用改造。但是我有错误

我的代码

@RestApi(baseUrl: Environments.baseUrl)
abstract class AuthRequests {

  factory AuthRequests(Dio dio, {String baseUrl}) = _AuthRequests;

  @POST('login')
  Future<User> login(@Body() UserParams params);
}

错误

error: The parameter 'baseUrl' can't have a value of 'null' because of its type, but the implicit default value is 'null'. (missing_default_value_for_parameter at [itrapp] lib/features/auth/data/network/auth_api.g.dart:10)

0 个答案:

没有答案