AndroidForegroundService class

Static helper class that provides methods to start and stop a foreground service.

On any platform other than Android, all methods in this class are no-ops and do nothing, so it is safe to call them without a platform check.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

startAndroidForegroundService({required NotificationContent content, List<NotificationActionButton>? actionButtons, ForegroundStartMode foregroundStartMode = ForegroundStartMode.stick, ForegroundServiceType foregroundServiceType = ForegroundServiceType.none}) Future<void>
startForeground({required NotificationContent content, List<NotificationActionButton>? actionButtons, int startType = AndroidForegroundServiceConstants.startSticky, int? foregroundServiceType}) Future<void>
Starts the foreground service with the given notification, whichs content must not be null.
stopForeground(int id) Future<void>
Stops a foreground service.