trevorwang / retrofit.dart

retrofit.dart is an dio client generator using source_gen and inspired by Chopper and Retrofit.
https://mings.in/retrofit.dart/
MIT License
1.08k stars 251 forks source link

Error: Type 'ParseErrorLogger' not found #722

Open chriskikoti opened 2 weeks ago

chriskikoti commented 2 weeks ago

ParseErrorLogger not found Retrofit REST client generates .g.dart and adds errorLogger to constructor of the generated file (i.e. .g.dart) of type ParseErrorLogger errorLogger but that class ParseErrorLogger is not found

To Reproduce Here is a code that I use to generate REST client:

`part 'auth_client.g.dart';

@RestApi() abstract class AuthClient { factory AuthClient(Dio dio, {String baseUrl}) = _AuthClient;

@POST('auth/register') Future signup(@Body() body);

@POST('auth/login') Future getUser(@Body() body); }`

dependencies: retrofit: ^4.4.1 logger: ^2.4.0 json_annotation: ^4.9.0

dev_dependencies: build_runner: ^2.4.13 json_serializable: ^6.8.0 retrofit_generator: ^9.1.4

Expected behavior To have a working generated class with extension .g.dart

My environment Java version: 17 Flutter SDK version: 3.24.4 OS: Ubuntu 24.04

sirjager commented 2 weeks ago

Facing the same issue, with latest retrofit package

joknjokn commented 2 weeks ago

Worked for me: https://github.com/trevorwang/retrofit.dart/issues/715#issuecomment-2415813794