Phase 6: Operational Features 🗺️🔔
This phase covers the features that interact with the physical world and the ecosystem's reward economy.
🖼️ UI Reference
{: .mobile-frame }
{: .mobile-frame }
🗺️ Kiosk Map (map_screen.dart)
Integrates Google Maps to help users find physical hardware.
Key Logic:
- API Fetch: Pulls kiosk locations from the Firestore
kioskscollection. - Marker Color: Changes based on status (
available,maintenance,offline). - Geo-fencing: Calculates distance from the device current location using the
geolocatorpackage.
🔔 Notifications (notifications_screen.dart)
A chronological timeline of system and personal alerts.
- Types:
points_earned,system_announcement,offer_nearby. - FCM Integration: Leverages Firebase Cloud Messaging for real-time background delivery.
- Unread State: Managed locally in Firestore with an
isReadflag.
🧧 Rewards Catalog (offers_screen.dart)
The marketplace where points are converted into real-world value.
- Categories: Groceries, Beauty, Restaurants, etc.
- Redemption Logic:
- Check if user points >= required points.
- Subtract points from user profile.
- Generate a unique code and store it in
user_coupons.