Alarms topic
Alarms
Use the alarms module to detect proximity events, geofence boundary crossings, and speed-related alerts so your app can notify users about nearby landmarks, area entries/exits, or when configured speed thresholds are exceeded. This system provides a concise set of models and services for registering monitored areas, receiving event callbacks, and querying ordered alarm lists.
AlarmService: Use this central coordinator to register what to monitor (areas, landmarks, overlays, speed limits) and to manage monitoring state. It holds configuration and produces ordered collections of active or passed alarms for your app to consume.AlarmListener: Implement this listener to receive real-time callbacks for boundary crossings, speed events, and updates about approaching or passed alarms. It provides event hooks so your UI or logic can react immediately to alarm conditions.AlarmMonitoredArea: Use this lightweight model to represent a geofence or monitored polygon/shape with an identifier and geometry. It carries the area metadata your app needs to match boundary events to domain objects.AlarmsList: Use this ordered collection to access nearby or passed alarms sorted by relevance or distance. It provides snapshots of active alarm items so UIs can display and prioritize closest alerts.
The alarms components work together to deliver timely and efficient proximity notifications: AlarmService manages what is monitored and emits ordered AlarmsList snapshots while AlarmListener receives immediate event callbacks linked to AlarmMonitoredArea identifiers. This arrangement keeps runtime checks lightweight and lets applications focus on presenting and acting on relevant alarm events.
Use AlarmService as the entry point for registration and state management, then implement AlarmListener to handle events and query AlarmsList for UI-friendly summaries. Typical workflow: register monitored areas with AlarmMonitoredArea, start monitoring via AlarmService, and subscribe with AlarmListener to receive real-time notifications and fetch ordered lists for display or processing. Prefer short-lived listeners for UI screens and central listeners for app-level background handling to balance responsiveness and resource usage.
Learn more about alarms: https://developer.magiclane.com/docs/flutter/guides/category/alarms
Classes
- AlarmListener Alarms
- Receives notifications for navigation-related alarm events and environmental changes.
- AlarmMonitoredArea Alarms
- Represents a monitored geographic area with its identifier.
- AlarmService Alarms
- Provides monitoring and notification for navigation-related alarm events.
-
AlarmsList<
T> Alarms - List of alarms referenced to geographic coordinates.
- LandmarkAlarmsList Alarms
- Alarms list referencing landmarks by geographic coordinates.
- OverlayItemAlarmsList Alarms
- Alarms list referencing overlay items by geographic coordinates.