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

unused baseUrl parameter warning #676

Closed SaurabhS120 closed 2 weeks ago

SaurabhS120 commented 1 month ago

I am passing baseUrl through @RestApi, it is showing a warning that I am not using the baseUrl parameter from Auto-generated(g.dart) file

With the following comment, this issue can be resolved // ignore_for_file: unused_element example :

// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'api_service.dart';

// **************************************************************************
// RetrofitGenerator
// **************************************************************************

// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element

class _ApiService implements ApiService {
  _ApiService(
    this._dio, {
    this.baseUrl,
  }) {
    baseUrl ??= 'https://fakestoreapi.com';
  }
SaurabhS120 commented 2 weeks ago

PR is merged for this issue