getResponse method

Future getResponse(
  1. bool isPost,
  2. String fullPath,
  3. Map<String, dynamic>? bodyParams,
  4. Map<String, dynamic>? headers,
)

Implementation

Future<dynamic> getResponse(
  bool isPost,
  String fullPath,
  Map<String, dynamic>? bodyParams,
  Map<String, dynamic>? headers,
) async {
  dynamic rawResponse;
  if (isPost) {
    rawResponse = await NetworkConfig.getClient().post(
      fullPath,
      bodyParams,
      await createFinalHeader(headers),
    );
  } else {
    rawResponse = await NetworkConfig.getClient().get(
      fullPath,
      bodyParams,
      await createFinalHeader(headers),
    );
  }
  return rawResponse;
}