type 'ExpandIterable<InterfaceType, MethodElement>' is not a subtype of type 'Iterable<MethodElementImpl>' of 'iterable'

444

Reported Issue : https://github.com/trevorwang/retrofit.dart/issues/345

Temp fix:

retrofit_generator:
git:
  url: https://github.com/Chimerapps/retrofit.dart.git
  ref: 9f90296751984b359937c38563da5b19db5550f5
  path: generator

UPDATE

As the Jun 4, 2021 we get new package update, that fix the problem.

retrofit_generator 2.0.0+1
Share:
444
Player 2nd
Author by

Player 2nd

Updated on December 30, 2022

Comments

  • Player 2nd
    Player 2nd over 1 year

    I want to create a api services using dio and build_runner. But when I run flutter pub run build_runner this command on terminal I got this error

    [SEVERE] retrofit_generator:retrofit on lib/web_services/api_services.dart:

    type 'ExpandIterable<InterfaceType, MethodElement>' is not a subtype of type 'Iterable' of 'iterable'

    This is my api services code.

    part 'api_services.g.dart';
    
    @RestApi(baseUrl: Preferences.hrmsAPI)
    abstract class RestClient {
      factory RestClient(Dio dio) = _RestClient;
    
      @FormUrlEncoded()
      @GET('config')
      Future<WrappedResponse> config();
    
      @FormUrlEncoded()
      @GET('profile')
      Future<WrappedResponse> profile(@Header('Authorization') String token);
    }