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.06k stars 241 forks source link

Prefix import is lost in generated files #675

Open woprandi opened 1 month ago

woprandi commented 1 month ago

Describe the bug When we import classes with prefix, the prefix is lost in the generated file which causes errors

To Reproduce

import 'models.dart' as prefix;

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

  @GET('/config')
  Future<prefix.Config> getConfig();
}

Generated code :

  @override
  Future<Config> getConfig() async {

Expected behavior Generated code should use prefix if used in the input code