如何解决我正在尝试运行命令“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 举报,一经查实,本站将立刻删除。