Skip to main content

prism_alerts 0.1.0 copy "prism_alerts: ^0.1.0" to clipboard
prism_alerts: ^0.1.0 copied to clipboard

Reliable local reminders for Flutter. Persists what the user meant (local wall-clock + recurrence) and rebuilds the OS schedule after timezone changes, DST shifts and reboots, reporting missed notifications.

prism_alerts #

pub package

Reliable local reminders for Flutter. The OS scheduler only remembers a UTC instant โ€” so when your user flies to another timezone, when DST shifts, or after a reboot, "08:00 every day" silently fires at the wrong time (or never). prism_alerts remembers what the user meant and rebuilds the schedule whenever the world moves.

The problem #

flutter_local_notifications.zonedSchedule() converts your TZDateTime to a UTC moment and hands it to the OS. The OS keeps only that moment. The local time you meant is gone:

  • โœˆ๏ธ User travels: notification fires at the old local time
  • ๐Ÿ• DST shifts (2ร—/year in most of Europe and the US): every daily reminder drifts by an hour
  • ๐Ÿ” Reboot (Android <12 receiver quirks): scheduled notifications can vanish

The fix #

final alerts = PrismAlerts.instance;
await alerts.initialize();

await alerts.upsert(ReminderIntent(
  id: 'meds-morning',
  title: 'Morning meds',
  localHour: 8,
  localMinute: 0,
  recurrence: RecurrenceSpec.daily(),
));

// On every app resume:
final report = await alerts.reconcile();
if (report.timezoneChanged || report.offsetChanged) {
  // All schedules were rebuilt for the new local time.
}
if (report.missed > 0) {
  // Some slots passed while the app was dead โ€” show them in-app.
}

Features #

  • Intent persistence โ€” local wall-clock + recurrence survives restarts
  • reconcile() โ€” one call on resume detects tz/offset drift, cancels and rebuilds every schedule
  • Missed-notification report โ€” surface "you missed X" instead of silence
  • DST-correct math โ€” wall-clock stepping (verified against Europe/Berlin spring-forward), not naive 24-hour adds
  • Recurrences โ€” once, daily, weekly (weekday set), every-N-days

Part of the Prism ecosystem #

prism_kit ยท prism_glass (Liquid Glass) ยท prism_doctor (design audit) ยท prism_sketch ยท prism_guardrails ยท prism_alerts (this package) ยท urdu_toolkit

0
likes
140
points
71
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Reliable local reminders for Flutter. Persists what the user meant (local wall-clock + recurrence) and rebuilds the OS schedule after timezone changes, DST shifts and reboots, reporting missed notifications.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, flutter_local_notifications, flutter_timezone, shared_preferences, timezone

More

Packages that depend on prism_alerts