postRequest method

Future postRequest(
  1. String path,
  2. Map data
)

Implementation

Future<dynamic> postRequest(String path, Map data) async {
  var url = Uri.https(AppConstants.apiEndPoint, '$path');

  String body = json.encode(data);
  return _http.post(url, body: body, headers: {
    'Authorization': '${AppConstants.apiKey}',
    'Content-Type': 'application/json'
  });
}