noaa_nws_adapter 0.0.8 copy "noaa_nws_adapter: ^0.0.8" to clipboard
noaa_nws_adapter: ^0.0.8 copied to clipboard

NOAA / NWS direct-consume wrapper — smallest-slice GeoJSON client for api.weather.gov active winter alerts by point. Pure Dart.

example/main.dart

// ignore_for_file: avoid_print
//
// Minimal runnable example for noaa_nws_adapter: fetch active U.S. winter
// alerts for a point and print them. NWS requires a User-Agent of the form
// "(yourapp.com, contact@email.com)"; the client raises ArgumentError
// up-front if omitted, so substitute your own contact.

import 'package:noaa_nws_adapter/noaa_nws_adapter.dart';

void main() async {
  final client = NoaaNwsClient(userAgent: '(myapp.example.com, you@example.com)');
  try {
    // Active winter alerts near these coordinates (Grand Forks, ND).
    final alerts = await client.fetchActiveWinterAlerts(
      latitude: 47.9253,
      longitude: -97.0329,
    );
    print('Active winter alerts: ${alerts.length}');
    for (final a in alerts) {
      print('• ${a.event} [${a.severity.name}] — ${a.headline}');
    }
  } on NoaaNwsHttpException catch (e) {
    print('NWS unreachable: $e'); // honest failure; never a fake "all clear"
  } finally {
    client.close();
  }
}
0
likes
160
points
469
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

NOAA / NWS direct-consume wrapper — smallest-slice GeoJSON client for api.weather.gov active winter alerts by point. Pure Dart.

Repository (GitHub)
View/report issues
Contributing

Topics

#weather #noaa #nws #winter-driving #alerts

License

BSD-3-Clause (license)

Dependencies

equatable, http

More

Packages that depend on noaa_nws_adapter