我正在尝试运行命令"颤振包发布运行build_runner构建",并且返回时出现错误,有人可以帮助我吗?



我正在尝试运行命令"flutter packages pub-run build_runner build",但我收到了一个错误作为返回,有人能帮我吗

这是我的代码


import 'package:chopper/chopper.dart';
part 'post_api_service.chopper.dart';
@ChopperApi(baseUrl: 'https://jsonplaceholder.typicode.com/posts')
abstract class PostApiService extends ChopperService {
@Get()
Future<Response> getPosts();
@Get(path: '/{id}')
Future<Response> getPost(@Path('id') int id);
@Post()
Future<Response> postPost(
@Body() Map<String, dynamic> body,
);
}

这是返回

PS C:srsinnovationchopperchopper_api> flutter packages pub run build_runner build
[INFO] Generating build script...
[INFO] Generating build script completed, took 414ms
[WARNING] Invalidated precompiled build script due to missing asset graph.
[INFO] Precompiling build script......
[INFO] Precompiling build script... completed, took 1.1s
[SEVERE]
type 'Null' is not a subtype of type 'String' in type cast
pub finished with exit code 78
PS C:srsinnovationchopperchopper_api>

只需运行以下命令:

flutter packages pub run build_runner build --delete-conflicting-outputs

相关内容

  • 没有找到相关文章

最新更新