我正在尝试运行命令“flutter packages pub run build_runner build”,但返回时出现错误,有人可以帮助我吗? 这是我的代码这是回报

问题描述

我正在尝试运行命令“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:\srs\innovation\chopper\chopper_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:\srs\innovation\chopper\chopper_api>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)