createItem method

Future<void> createItem(
  1. Map<String, dynamic> itemDetails, {
  2. List<JsendStatusHandler>? statusHandlers,
})

Implementation

Future<void> createItem(Map<String, dynamic> itemDetails,
    {List<JsendStatusHandler>? statusHandlers}) async {
  itemDetails.remove('_id');
  (await jsendResponse.fromAPIRequest(
    APIRequest(
      path: endpoint,
      payload: itemDetails,
      method: 'POST',
    ),
    onSuccess: (jsendResponse res) {
      _setItem(_getSingluarDataFromJsendResponse(res));
    },
    statusHandlers: statusHandlers,
  ));
}