brix_network 1.2.0
brix_network: ^1.2.0 copied to clipboard
REST calls for brix – Dio by default, any client possible. Every call returns a Result; backend messages, field errors and logout on 401 handled.
1.2.0 #
PrettyNetworkLogger: rounded boxes and the brix mark▰, matchingBrixLoggerfrom brix 1.3.0.
1.1.0 #
BrixApi.download: files (PDF, image, spreadsheet, …) as aDownloadedFile– bytes,contentType,fileName(fromContent-Disposition),isPdf,isImage,sizeLabel– with optionalonProgress. An error answer instead of the file is read like any other call.NetworkRequest.wantsBytes/onReceiveProgressfor your ownNetworkClient;DownloadedFile.fromBytes(bytes, headers: …)builds the file.- The console log shows a file as
<binary 245 KB · application/pdf>.
1.0.1 #
- README: flow diagrams showing what happens on a tap / in a call.
1.0.0 #
First release.
BrixApi:get,post,put,patch,delete,upload,request– every call returns a brixResult, data parsed withJson.DioNetworkClient(default): timeout, retries for GET / PUT / DELETE only, cancel (RequestCancel), upload progress;NetworkClientto use any other library.ResponseReader: envelope (Node, NestJS, Laravel, custom), FastAPI, Django REST and custom readers; messages and field errors from any error shape.StandardStatus.map(status →Failure), replaceable withstatusMapper.- 401 →
onUnauthorizedonce for many calls,logoutOn401to skip paths (login). - Identical GETs at the same time share one request.
PrettyNetworkLogger: one readable box per call, secrets hidden, off in release builds.