我正在尝试运行命令‘运行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>发布于 2022-04-19 10:46:13
只需运行以下命令:
flutter packages pub run build_runner build --delete-conflicting-outputshttps://stackoverflow.com/questions/67666486
复制相似问题