FlogHttpUpload constructor

FlogHttpUpload({
  1. required String url,
  2. Map<String, String> headers = const {},
  3. Map<String, dynamic> fields = const {},
  4. String fileField = 'file',
  5. String method = 'POST',
  6. void onError(
    1. Object error, {
    2. int? statusCode,
    })?,
  7. Dio? dio,
})

Implementation

FlogHttpUpload({
  required this.url,
  this.headers = const {},
  this.fields = const {},
  this.fileField = 'file',
  this.method = 'POST',
  this.onError,
  Dio? dio,
}) : _dio =
         dio ??
         Dio(
           BaseOptions(
             // Sin timeouts, una red móvil intermitente cuelga la subida
             // (y lo que la esté esperando) indefinidamente.
             connectTimeout: const Duration(seconds: 15),
             sendTimeout: const Duration(minutes: 2),
             receiveTimeout: const Duration(seconds: 30),
           ),
         );