makePostRequest method
Implementation
TaskEither<String, Response<Map<String, dynamic>>> makePostRequest(
String path,
Map<String, dynamic> data,
) =>
TaskEither<String, Response<Map<String, dynamic>>>.tryCatch(
() async => dio.post(
path,
data: jsonEncode(data),
options: Options(
headers: <String, dynamic>{
HttpHeaders.contentTypeHeader: "application/json",
},
),
),
(Object error, StackTrace stackTrace) => error.toString(),
);