chopper
chopper copied to clipboard
How to download a file with chopper?
Can i download a file using chopper? if yes, how? i checked the docs and some issues, but i don't see anyone talking about it.
what i tried:
@Get(path: "print/{reservationId}")
Future<Response<File>> downloadInvoice(
@Path("reservationId") int reservationId,
);
and
@Get(path: "print/{reservationId}")
Future<Response> downloadInvoice(@Path("reservationId") int reservationId);
both return the same exception:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Unhandled error FormatException: Missing extension byte (at offset 11) occurred
any help is appreciated.
Hmm, I think it is easier to just use the HTTP class from Dart / Flutter or the https://pub.dev/packages/flutter_downloader