newsdataapi 0.0.2
newsdataapi: ^0.0.2 copied to clipboard
Official Dart/Flutter client for the Newsdata.io News API: real-time, historical, crypto & market news with retries, pagination and typed errors.
Changelog #
0.0.2 #
- First release via automated tokenless OIDC publishing from GitHub Actions (Trusted Publisher configured on pub.dev). No source changes.
0.0.1 #
Initial release.
NewsDataApiClientwith typed named-parameter methods for all 8 endpoints (latest,archive,crypto,sources,market,count,cryptoCount,marketCount).- Client-side parameter validation (mutually-exclusive groups,
sentiment_scorerequiressentiment,size1–50,from_date/to_daterequired on count endpoints,rawQueryparsing). - Typed exception hierarchy:
NewsdataException→NewsdataValidationException,NewsdataApiException(→NewsdataAuthException,NewsdataRateLimitException,NewsdataServerException),NewsdataNetworkException. - Retries with exponential backoff and
Retry-Afterparsing (integer seconds + HTTP-date). - Two pagination helpers:
scrollAll(merged) andpaginate(Stream<NewsdataResponse>). - Configurable
http.Clientinjection, request timeout, and optional logger callback (API key is redacted in logged URLs). - Typed
Articledeserialization with all server fields including AI enrichments (aiTag,aiRegion,aiOrg,sentiment,sentimentStats). - 34 unit tests using
package:http/testingmocks — no network needed. - Compatible with Dart 3.0+ and Flutter 3.0+; works on iOS, Android, Web, and Desktop in pure Dart with no platform channels.