dio_helper_api 1.0.1 copy "dio_helper_api: ^1.0.1" to clipboard
dio_helper_api: ^1.0.1 copied to clipboard

A package for implement dio custom for my organization

Dio Helper #

Example #

class WeatherApi { Dio dioApi() { //get base url from env String baseUrl = 'https://api.openweathermap.org';

//Set up the api
Api api = Api(
  baseUrl: baseUrl,
  accessToken: '',
  refreshToken: '',
  onTokenRefreshed: (newToken) {
    debugPrint('New token: $newToken');
  },
  serverCertificate: '',
  connectTimeout: 180,
  receiveTimeout: 180,
  header: {},
);

api.onInit();

return api.dio;

} }

class WeatherService extends GetxService { final WeatherApi api;

WeatherService({required this.api});

//create any tour services }

Dio Documentation #

0
likes
130
points
28
downloads

Publisher

unverified uploader

Weekly Downloads

A package for implement dio custom for my organization

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

dio, flutter

More

Packages that depend on dio_helper_api