flutterdartretrofit

Flutter Error: Type 'ParseErrorLogger' not found


I have a flutter project using retrofit that was working fine.

I decided to move my freezed models and retrofit files to a separate project in order to be reused with another project. I updated my imports and pubspec.yaml to properly include the new project and receive no errors in VSCODE.

When I goto to build my project, I am receiving the following on all my retorfit .g generated files:

../gtp-flutter-data/lib/data/providers/cart_api_service.g.dart:24:9:
Error: Type 'ParseErrorLogger' not found.
  final ParseErrorLogger? errorLogger;

I have no errors in either the new or the main data project, but this appears when building.

Any suggestions on what is going on?


Solution

  • I finally figured it out, albeit I’m not sure why what I did worked. I ended up solving this by temporarily commenting out retrofit in the main project pubspec.yaml and building the project.

    After this build it did not matter whether retrofit was included or commented out anymore in the pubspec.yaml of the main project.