Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:dio/dio.dart';
- import 'package:ementodo/core/utils/constants.dart';
- class ApiProvider{
- final Dio _dio =Dio();
- var apikey =Constants.apiKey1;
- // Current weather api call
- Future<dynamic> callCurrentWeather(cityName) async {
- var response =await _dio.get(
- //Constants is a static class in utils folder in core
- "${Constants.baseUrl}/data/2.5/weather",
- queryParameters: {
- "q":cityName,
- "appid": apikey,
- "units": "metric"
- }
- );
- return response;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement