Skip to content

Commit

Permalink
fix: rename options and add missing export
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadhorsephile committed Aug 12, 2024
1 parent 2a8b570 commit 68cbc8c
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion example/lib/auth_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ part 'auth_client.g.dart';

@RestApi()
abstract class AuthClient {
factory AuthClient(Dio dio, {String? baseUrl}) = RestClientYmlp;
factory AuthClient(Dio dio, {String? baseUrl, ParseErrorLogger errorLogger}) = RestClientYmlp;

@POST('/api/auth/mqttClient/authentication')
Future<Object?> authenticationUsingPost({
Expand Down
2 changes: 1 addition & 1 deletion example/lib/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ part 'example.g.dart';

@RestApi(baseUrl: 'https://5d42a6e2bc64f90014a56ca0.mockapi.io/api/v1/')
abstract class RestClient {
factory RestClient(Dio dio, {String baseUrl}) = RestClientYmlp;
factory RestClient(Dio dio, {String baseUrl, ParseErrorLogger errorLogger}) = RestClientYmlp;

@GET('/tasks/{id}')
Future<ApiResult<Task?>> getNestApiResultGenericsInnerTypeNullable();
Expand Down
2 changes: 1 addition & 1 deletion example_dartmapper/lib/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ part 'example.g.dart';

@RestApi(baseUrl: "https://5d42a6e2bc64f90014a56ca0.mockapi.io/api/v1/")
abstract class RestClient {
factory RestClient(Dio dio, {String baseUrl}) = _RestClient;
factory RestClient(Dio dio, {String baseUrl, ParseErrorLogger errorLogger}) = _RestClient;

@GET("/tags")
Future<List<String>> getTags();
Expand Down
2 changes: 1 addition & 1 deletion example_dartmapper/lib/json_mapper_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ part 'json_mapper_example.g.dart';
parser: Parser.DartJsonMapper,
)
abstract class ApiService {
factory ApiService(Dio dio, {String baseUrl}) = _ApiService;
factory ApiService(Dio dio, {String baseUrl, ParseErrorLogger errorLogger}) = _ApiService;

@GET("/tasks")
Future<List<Task>> getTasks(@Query("dateTime") DateTime dateTime);
Expand Down
2 changes: 1 addition & 1 deletion example_protobuf/lib/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ part 'example.g.dart';

@RestApi(baseUrl: "https://5d42a6e2bc64f90014a56ca0.mockapi.io/api/v1/")
abstract class RestClient {
factory RestClient(Dio dio, {String baseUrl}) = _RestClient;
factory RestClient(Dio dio, {String baseUrl, ParseErrorLogger errorLogger}) = _RestClient;

@POST("/tags")
Future<Result> getProtoBufInt(@Body() Params message);
Expand Down
2 changes: 1 addition & 1 deletion example_relative_base_url/lib/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ part 'example.g.dart';

@RestApi(baseUrl: 'tasks')
abstract class TasksRestClient {
factory TasksRestClient(Dio dio, {String baseUrl}) = _TasksRestClient;
factory TasksRestClient(Dio dio, {String baseUrl, ParseErrorLogger errorLogger}) = _TasksRestClient;

@GET('/tasks/{id}')
Future<List<Task?>> getTaskById();
Expand Down
4 changes: 2 additions & 2 deletions generator/lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class RetrofitGenerator extends GeneratorForAnnotation<retrofit.RestApi> {
static const String _baseUrlVar = 'baseUrl';
static const String _errorLoggerVar = 'errorLogger';
static const _queryParamsVar = 'queryParameters';
static const _optionsVar = 'options';
static const _optionsVar = '_options';
static const _localHeadersVar = '_headers';
static const _headersVar = 'headers';
static const _dataVar = 'data';
Expand Down Expand Up @@ -2397,7 +2397,7 @@ ${bodyName.displayName} == null
Code('try {'),
child,
Code('} on Object catch (e, s) {'),
Code('$_errorLoggerVar?.logError(e, s, options);'),
Code('$_errorLoggerVar?.logError(e, s, $_optionsVar);'),
Code('rethrow;'),
Code('}'),
],
Expand Down
1 change: 1 addition & 0 deletions retrofit/lib/retrofit.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export 'dio.dart';
export 'http.dart';
export 'error_logger.dart';

0 comments on commit 68cbc8c

Please sign in to comment.