retrofit.dart
retrofit.dart copied to clipboard
unused baseUrl parameter warning
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';
}