driving_weather 0.5.2
driving_weather: ^0.5.2 copied to clipboard
Real-time weather monitoring with snow, ice, and visibility hazard detection. Open-Meteo integration (free, no API key). Pure Dart.
Changelog #
0.5.2 #
Documentation only. No code change.
Comments and documentation that used this project's internal shorthand now say the same thing in plain words. Where earlier entries in this changelog used that shorthand, they were reworded; no fact in them changed.
analysis_options.yaml: the comment above the analyzer's strict modes now says what the modes do, instead of pointing at an internal review note.SAFETY_BOUNDARY.md: the safety-boundary record is reworded the same way. No boundary moved: the changed lines lost internal names and references, and nothing changed about what the package does, what it does not do, or what it leaves to you.CHANGELOG.md: one sentence in the 0.5.0 entry, and the 0.3.0 entry.
Apart from pubspec.yaml (the version), analysis_options.yaml (one comment),
SAFETY_BOUNDARY.md and this changelog, the published files are identical to
0.5.1.
0.5.1 #
dart pub get inside the published package now works. No code change, and no
change to which versions of its dependencies your app can resolve. If your app
uses DigitrafficWeatherProvider, also read "What has changed underneath
DigitrafficWeatherProvider" below: it is not caused by this release, and it
reaches your app on 0.5.0 as well.
The published 0.5.0 pubspec.yaml still carried development-only
dependency_overrides pointing at ../condition_aggregator and
../condition_aggregator_digitraffic -- folders that exist only in this
package's source repository. dart pub get inside the downloaded package (to
run its tests, or when an editor opened it) failed with exit code 66 ("depends
on condition_aggregator_digitraffic from path which doesn't exist"). pub does not
remove dependency_overrides when a package is published. Apps that depend on
driving_weather were not affected: checked, an app depending on
driving_weather: 0.5.0 resolves normally. The overrides now live in
pubspec_overrides.yaml, which pub does not publish.
The constraints on condition_aggregator and condition_aggregator_digitraffic
are now written out as >=0.0.5 <0.1.0. For pub that is the same set of
versions as 0.5.0's ^0.0.5: a caret on a 0.x version stops below the next
minor release. So this release does not widen or narrow what your app can
resolve, and a 0.1.x of either package still cannot reach your app through this
one.
What has changed underneath DigitrafficWeatherProvider #
condition_aggregator_digitraffic published two fixes after driving_weather
0.5.0: 0.0.7 on 2026-08-21 and 0.0.8 on 2026-08-27. Your app receives them
whenever it resolves its dependencies fresh or runs pub upgrade -- on 0.5.0
just as on 0.5.1. They change what the provider emits:
- An announcement Digitraffic does not classify now has unknown severity, not
minor (
condition_aggregator_digitraffic0.0.7). This package maps that toHazardAssertion.unknownand ranks it above minor and moderate when it picks the worst advisory near the point. AWeatherConditionthat carriedHazardAssertion.minororHazardAssertion.moderatecan now carryHazardAssertion.unknown. Itshazardverdict isSafetyVerdict.unknowneither way. - Announcements east and west of the point are no longer dropped
(
condition_aggregator_digitraffic0.0.8). The search box was 34-50% of its documented width of about 55 km across Finland, the only country Digitraffic covers. Announcements inside the documented box now arrive, so the worst advisory near a point can be more severe than before, and a point where the provider found no advisory can now return one. When that advisory is severe or extreme,hazardbecomesSafetyVerdict.hazardous.
Both fixes make the provider more cautious, never less. Tests or screens that
expect the old results for a given feed may now see these instead. No type or
method signature you use changes, and this package's own tests pass with both
packages at 0.0.5 and at their current releases, condition_aggregator 0.0.10
and condition_aggregator_digitraffic 0.0.8.
Apart from pubspec.yaml and this changelog, the published files are identical
to 0.5.0.
0.5.0 #
Safety defect in 0.4.4 and earlier — please read #
Versions up to and including 0.4.4 could report weather this package had never measured.
WeatherCondition.clear()hardcodedtemperatureCelsius = 5.0,visibilityMeters = 10000,windSpeedKmh = 0.0andiceRisk = false.DigitrafficWeatherProviderreturned exactly that value whenever the advisory feed came back empty. An empty feed means "no advisory was published". It does not mean the road is clear and +5 °C. If you read temperature oriceRiskfrom a Digitraffic-backed provider, you may have been shown +5 °C and "no ice" for a road that was in fact freezing.- The Digitraffic severity mapping also invented temperature, visibility and
wind figures (
-4.0 °C,150 m,40 km/hfor a severe advisory) that Digitraffic does not publish at all. It announces road situations, and measures no weather. OpenMeteoWeatherProviderfell back tovisibility = 10000(i.e. "clear") andsnowfall = 0when the hourly block of the response was empty — values the API never sent.- On a failed fetch, providers silently re-emitted the last condition with no staleness marker, so old data was indistinguishable from fresh data. With no previous data they emitted nothing at all, which a UI cannot tell apart from "still loading".
pub.dev versions are immutable: we cannot withdraw the affected releases. This
note is the recall. If you shipped 0.4.4 or earlier to drivers, assume any
temperature, visibility, wind or ice-risk value that did not come from
OpenMeteoWeatherProvider's current block may have been manufactured.
Breaking: absence of data can no longer be mistaken for good conditions #
Measured fields are now nullable — null means NOT MEASURED, never zero and
never benign. Safety getters are now tri-state (SafetyVerdict), so
if (condition.isHazardous) no longer compiles: you will get a compile error
at every site where absent data used to fall through to the "clear road" branch,
and you must decide what to do when the answer is unknown.
That compile error is deliberate. It is the whole fix. A deprecation warning does not stop the build; it annotates the code while the code keeps producing the wrong answer.
The verdicts carry a deliberate asymmetry: positive evidence of a hazard
fires even when other fields are absent, but the negative verdict ("all clear")
requires complete knowledge. Being offline therefore does not mean "hazard" — it
means unknown, which is a state you can tell the driver about, rather than a
green light. (Making absence raise a hazard instead would alert on every coverage
gap, teach the driver the alert means nothing, and get it ignored on the night it
is real.)
Migration
| 0.4.4 | 0.5.0 | What to do on unknown |
|---|---|---|
WeatherCondition.clear() |
removed | Use WeatherCondition.unknown() for absent data. Use WeatherCondition.simulatedClear() only in a simulator. |
bool get isHazardous |
SafetyVerdict get hazard |
Tell the driver the road could not be assessed. Do not render "conditions normal". |
bool get isFreezing |
SafetyVerdict get freezing |
Unknown temperature is not "above freezing". |
bool get hasReducedVisibility |
SafetyVerdict get reducedVisibility |
Unknown visibility is not "you can see fine". |
bool get isSnowing |
SafetyVerdict get snowing |
Unknown precipitation is not "not snowing". |
double temperatureCelsius |
double? temperatureCelsius |
Do not substitute a value. Show "unknown". |
double visibilityMeters |
double? visibilityMeters |
As above. |
double windSpeedKmh |
double? windSpeedKmh |
As above. |
bool iceRisk |
bool? iceRisk |
null is not "no ice". |
Stream<WeatherCondition> conditions |
Stream<WeatherReading> conditions |
Switch on WeatherObserved / WeatherStale / WeatherUnavailable. |
Do not write ?? false or ?? 0.0 at these sites. That restores the exact
defect this release exists to remove, in one keystroke, and greps as nothing.
Also fixed in this release (found while hardening the contract) #
- A malformed 200-response is a FAILURE, not an all-null observation.
parseWeatherResponsereadjson['current']as a nullable map, so a garbage or empty body parsed cleanly into a condition with every field null — and was then emitted asWeatherObserved(a reading that observed nothing) AND written over the last real observation, so the next genuine fetch failure would emit aWeatherStalecarrying an empty husk instead of the driver's last real weather. It now throwsWeatherParseExceptionand routes toWeatherStale/WeatherUnavailablelike any other failure. Belt-and-braces: a fully-unknown condition never overwrites the last real one. - The current hour is no longer substituted by a different hour.
_hourlyValueclamped the current-hour index into the list, so a TRUNCATEDhourlyarray (a partial response, a stale cache) silently returned a DIFFERENT hour's snowfall or visibility and presented it as "now". A value we do not have for this hour is absent — not the last hour we happen to hold. - An unstated advisory severity is no longer sorted onto the benign end. The
worst-advisory reduce in
DigitrafficWeatherProvidercomparedAdvisorySeverity.index, andunknownis declared FIRST incondition_aggregator— i.e. index 0, the LOWEST. So an advisory whose severity the authority never stated silently LOST to aminorone and was discarded. It now ranks aboveminor/moderate(something was declared; how bad it is was not) and below the statedsevere/extreme. - A declared advisory is not overruled by benign measurements.
WeatherCondition.hazardreturnsunknown(notnotHazardous) when ahazardAssertionofminor/moderate/unknownis present, even if every measured field is complete and benign. An authority may know something our sensors cannot see.
Also #
WeatherConditiongainsObservationSource source(measured / derived / simulated) andHazardAssertion? hazardAssertion. A hazard declared by a road authority is now carried as an assertion instead of being laundered into fake sensor readings — the alert still reaches the driver (a severe or extreme assertion returnsSafetyVerdict.hazardouseven with every measured field absent), but nothing is invented to carry it.- An advisory whose severity the feed does not state maps to
HazardAssertion.unknown, not tominor— downgrading an unstated severity to the benign end of the scale is the same defect in miniature. - Fetch failure now emits
WeatherStale(carrying the real age of the last observation, and the cause) orWeatherUnavailable, instead of a silently re-dated re-emit or silence. SimulatedWeatherProvideris unchanged in behaviour: a simulator asserting a scenario is honest, because it is not a claim about the world. Its conditions now say so viaObservationSource.simulated.SAFETY_BOUNDARY.mdcorrected. The 0.4.4 record claimed the package "surfaces the data as received" and "never asserts more than it observes". Both were false. The record has been corrected downward in the same commit as the code — a document claiming a property the code lacks is worse than no document.
0.4.4 #
- Add optional
WeatherCondition.humidityRH(relative humidity in PERCENT, nullable). This is the input the in-drive road-surface classifier needs to detect radiative-frost black ice — clear-sky cooling that freezes the road while the air is still a few degrees above 0 °C.nullmeans "not measured", never "dry", so absence never fabricates or suppresses a hazard. OpenMeteoWeatherProvidernow requestsrelative_humidity_2mand populateshumidityRH; responses that omit it resolve tonull. Other providers that constructWeatherConditionare unaffected (the field defaults tonull).
0.4.3 #
- docs: correct stale README install pin to current version (no API change).
0.4.2 — 2026-06-14 — Dependency hygiene #
- Track latest
condition_aggregator(^0.0.4→^0.0.5) +condition_aggregator_digitraffic(^0.0.3→^0.0.5). - No source or behaviour change.
0.4.1 #
- Republish from the embedded-target Dart 3.10.1 SDK (Flutter 3.38.3) to correct a stale
^3.11.0SDK floor in the previously-published artifact. No source or behavior change; the source already declaredsdk: ^3.10.0. Restorespub getfor embedded/automotive Dart consumers on Dart 3.10.x.
0.4.0 — 2026-05-10 — Pana score recovery + dart format alignment #
- Trim pubspec
descriptionto ≤180 characters so search-engine snippets surface the package's purpose cleanly. - Apply
dart formatacrosslib/andtest/(6 files reformatted) to clear pana static-analysis formatter findings. - No SDK source changes; metadata + formatter pass only.
0.3.0 #
- Harmonize package version to 0.3.0, in step with the other packages in this repository.
- Align internal ecosystem dependency constraints to ^0.3.0 where applicable.
- No breaking API changes in this package for this release.