LocalNotificationService class
Default NotificationService backed by flutter_local_notifications.
Deliberately logic-light: it maps JuiceNotification to the plugin and
forwards taps. All behavior lives in NotificationsBloc, tested with a fake
service — this adapter is verified by inspection and a one-time on-device run.
Scheduling uses zonedSchedule, so the app must call
tz.initializeTimeZones() (from the timezone package) once at startup.
- Implemented types
Constructors
- LocalNotificationService({FlutterLocalNotificationsPlugin? plugin, String channelId = 'juice_notifications', String channelName = 'Notifications'})
Properties
- channelId → String
-
Android channel id / name used for posted notifications.
final
- channelName → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
taps
→ Stream<
NotificationTap> -
Stream of taps on delivered notifications.
no setteroverride
Methods
-
cancel(
int id) → Future< void> -
Cancel a pending/shown notification by id.
override
-
cancelAll(
) → Future< void> -
Cancel everything.
override
-
dispose(
) → Future< void> -
Release resources.
override
-
initialize(
) → Future< void> -
Platform initialization (channels, tap handler wiring).
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
schedule(
JuiceNotification n, DateTime when) → Future< void> -
Post a notification at
when.override -
show(
JuiceNotification n) → Future< void> -
Post a notification now.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited