get method

Future get({
  1. required String url,
  2. Map<String, String>? header,
})

GET

Implementation

Future<dynamic> get({required String url, Map<String, String>? header}) async {
  dynamic responseJson;

  try {
    final response = await http.get(Uri.parse(url), headers: headers ?? header);
    responseJson = _returnResponse(response);
  } on SocketException {
    throw FetchDataException('No Internet connection');
  }

  return responseJson;
}