retrofit.dart icon indicating copy to clipboard operation
retrofit.dart copied to clipboard

unused baseUrl parameter warning

Open SaurabhS120 opened this issue 8 months ago • 0 comments

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 avatar Jun 05 '24 06:06 SaurabhS120