monart_http 0.2.1
monart_http: ^0.2.1 copied to clipboard
HTTP client foundation for Dart built on monart. Create typed HTTP service objects using Railway-Oriented Programming with semantic outcomes per status code.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.1 - 2026-04-20 #
Changed #
- Widened
monartconstraint from^0.1.1to>=0.1.1 <1.0.0so that minor releases of monart (e.g. 0.2.0, 0.3.0) resolve without requiring a new monart_http release.
0.2.0 - 2026-04-16 #
Added #
-
HttpLoggerinterface — inject any logging backend viaHttpClientConfiguration.logger. ImplementlogRequest,logResponse, andlogErrorto forward to Sentry,package:logging, or any other sink. -
NullHttpLogger— no-op implementation, used as the default logger. -
DevToolsHttpLogger— logs→/←/✗entries with method, URI, status, elapsed time, and request/response bodies to the Flutter DevTools Logging tab viadart:developer. Logs are ephemeral and never appear in production builds. -
HttpCacheinterface — inject any caching backend viaHttpClientConfiguration.cache. Implementfetchto cache responses in Hive, Redis, or any other store. -
NullHttpCache— always executes the request, used as the default cache. -
InMemoryHttpCache— Map-based cache with configurable TTL (default 5 min). Expired entries are evicted on the next access to the same key.
Changed #
HttpClientConfigurationnow acceptslogger(HttpLogger) andcache(HttpCache) instead of the removedlogStrategyandcacheStrategyenums. ThecacheExpiresInparameter has also been removed — passexpiresIndirectly toInMemoryHttpCacheinstead.
Removed #
LogStrategyenum — replaced by theHttpLoggerinterface.CacheStrategyenum — replaced by theHttpCacheinterface.HttpLogInterceptor— superseded byDevToolsHttpLoggerand the injectableHttpLoggercontract.
0.1.1 - 2026-04-17 #
Fixed #
- Bumped
diolower bound from5.0.0to5.2.0, whereDioExceptionwas introduced. The previous constraint allowed resolvingdio 5.0.0–5.1.x, which still used the oldDioErrorname and caused compilation failures on lower-bound analysis.
0.1.0 - 2026-04-17 #
Added #
-
HttpClientConfiguration— shared configuration per HTTP client: base URI, default headers, connect/receive timeouts, and log strategy. -
LogStrategyenum —none(default) orstdout(logs to Flutter DevTools). -
HttpMethodenum —get,post,put,patch,delete. -
HttpResponse— thin wrapper around the raw Dio response exposingstatusCode,statusMessage,body, andheaders. -
HttpServiceBase<Value>— abstract base class for typed HTTP service objects. Subclass and declaremethod,pathTemplate,configuration, andfromResponse. Optional overrides:pathParams,headers,queryParams,body. CallingrunAsync()dispatches the request and returnsFuture<Result<Value>>. -
ResponseProcessor— maps HTTP status codes to semantic outcome names (e.g.404→['notFound', 'clientError'],422→['unprocessableContent', 'clientError']). Unrecognised codes fall back to family-level outcomes based on their range. -
ExceptionProcessor— maps Dio and network exceptions to outcome names:timeout,sslError,connectionError,requestCancelled,uncaughtError. -
HttpLogInterceptor— logs→/←/✗entries with method, URI, status, elapsed time, and request/response bodies to the Dart developer console (Flutter DevTools Logging tab). Activated viaLogStrategy.stdout.