diff --git a/generator/lib/src/generator.dart b/generator/lib/src/generator.dart index acfbe62d..e241465e 100644 --- a/generator/lib/src/generator.dart +++ b/generator/lib/src/generator.dart @@ -1316,9 +1316,10 @@ You should create a new class to encapsulate the response. Map.from(extraOptions) ..[_queryParamsVar] = namedArguments[_queryParamsVar]! ..[_path] = namedArguments[_path]! - ..[_baseUrlVar] = extraOptions.remove(_baseUrlVar)!.ifNullThen( - refer(_dioVar).property('options').property('baseUrl'), - ), + ..[_baseUrlVar] = refer('_combineBaseUrls').call([ + refer(_dioVar).property('options').property('baseUrl'), + extraOptions.remove(_baseUrlVar)!, + ]), ) .cascade('data') .assign(namedArguments[_dataVar]!); diff --git a/generator/test/src/generator_test_src.dart b/generator/test/src/generator_test_src.dart index d9753166..d6c6c016 100644 --- a/generator/test/src/generator_test_src.dart +++ b/generator/test/src/generator_test_src.dart @@ -1276,7 +1276,10 @@ abstract class TestModelList { newOptions.headers.addAll(_headers); final _options = newOptions.copyWith( method: 'GET', - baseUrl: baseUrl ?? _dio.options.baseUrl, + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ), queryParameters: queryParameters, path: '', )..data = _data;