flightbyte 1.0.0
flightbyte: ^1.0.0 copied to clipboard
Official Dart client for the FlightByte flight status API. Look flights up, subscribe to changes and verify signed webhooks.
1.0.0 #
- First release.
FlightByteClientwithflights(get,timeline),subscriptions(create,list,listAll,get,update,delete,pause,resume,sendTest,deliveries,events,secret,rotateSecret) andcountries(list,get,flagUrl).- Typed models for flights, subscriptions, deliveries and webhook events, with
unknownfallbacks for enum values added later. FlightTimeline.count, the entry count the API sends with a flight's timeline, falling back toentries.lengthwhen absent.- A sealed
FlightByteExceptionhierarchy that maps every API error status.PaymentRequiredExceptionreads all three 402 reasons, includingcredits_exhaustedwithbalanceandexpiresAtwhen prepaid credits are used up. Webhook.verify,Webhook.constructEventandWebhook.signforx-flightbyte-signaturewebhook signatures. An empty signing secret throws anArgumentError, since anyone can sign with an empty key.- An empty path parameter (a subscription id, a carrier, a flight number, a date, a country code) throws an
ArgumentErrorbefore anything is sent, instead of asking for another URL. - Every failure to get a response is a
FlightByteConnectionException, including what your ownhttp.Clientordart:iothrows directly, such as a TLSHandshakeException. A timeout aborts the request in flight. client.lastRateLimitfrom theX-RateLimit-*headers.X-API-Keynever leaves the API's origin. Redirects are followed only on the same scheme, host and port, for GET and HEAD and at most five hops; any other redirect throws anUnexpectedStatusExceptionwith the 3xx status andheaders['location']. Browsers follow redirects themselves, so this applies to the Dart VM and Flutter on mobile and desktop.