post<T> method
Implementation
Future<T> post<T>(
String endpoint, {
required dynamic data,
required T Function(Map<String, dynamic>) fromJson,
}) async {
try {
final response = await _dio.post(
endpoint,
data: data,
);
return fromJson(response.data as Map<String, dynamic>);
} on DioException catch (e) {
throw Exception(_handleError(e));
}
}