import 'dart:convert';
import 'package:http/http.dart';
import '../../../Helper/Logger.dart';
import '../../../Model/Response/Riders/get_rider_model.dart';

class RidersProvider {

  Future<GetRiderPoolsModel?> getRiders(String urldata,) async {
    GetRiderPoolsModel? getRiderPoolsModel;

    logger.i('GetRiderURlData : ${urldata}');
    try {

      final url = Uri.parse('$urldata');

      final response = await get(url, headers: {
        'Content-Type': 'application/json',
        'Accept': 'application/json',
        // 'Authorization': '$token',
      });
      print('getRiderPoolsModelresponsebody!!!!!!!!${response.body}');
      print('getRiderPoolsModelurldata!!!!!!!!${urldata.toString()}');
      Map<String, dynamic> parsedJson = json.decode(response.body.toString());

      getRiderPoolsModel = GetRiderPoolsModel.fromJson(parsedJson);

    } catch (e) {
      print(e.toString());
      print("error");
    }
    return getRiderPoolsModel;
  }

}