createPlan method

Future<Response> createPlan(
  1. Plan planRequest,
  2. String key
)

Implementation

Future<http.Response> createPlan(Plan planRequest, String key) async {
  var url = Constant.baseURL + Constant.createPlan;
  final response = await http
      .post(Uri.parse(url), body: json.encode(planRequest.toMap()), headers: {
    "Content-Type": "application/json",
    "accept": "application/json",
    "x-api-key": key
  });
  return response;
}