whenMethodHttp<T> method

T whenMethodHttp<T>(
  1. String method, {
  2. required T onStream(),
  3. required T onFuture(),
})

Implementation

T whenMethodHttp<T>(
  String method, {
  required T Function() onStream,
  required T Function() onFuture,
}) {
  switch (method) {
    case 'getSse':
    case 'postSse':
    case 'putSse':
    case 'patchSse':
    case 'deleteSse':
      return onStream();
    // case 'download':
    //   return onDownload();
    default:
      return onFuture();
  }
}