BackgroundTask class
BackgroundTask
is a class that manages background tasks.
Constructors
- BackgroundTask(MethodChannel _methodChannel, EventChannel _bgEventChannel, EventChannel _statusEventChannel)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isRunning
→ Future<
bool> -
isRunning
returns whether the background task is running or not.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
status
→ Stream<
StatusEvent> -
status
provides a stream of status events.no setter -
stream
→ Stream<
Location> -
stream
provides a stream of location information.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAndroidNotification(
{String? title, String? message, String? icon}) → Future< void> -
setAndroidNotification
sets the Android notification. -
setBackgroundHandler(
BackgroundHandler handler) → Future< void> -
setBackgroundHandler
provides a function of location information. -
start(
{double? distanceFilter, bool isEnabledEvenIfKilled = true, DesiredAccuracy iOSDesiredAccuracy = DesiredAccuracy.bestForNavigation}) → Future< void> -
start
starts the background task.distanceFilter
- the minimum distance (in meters) a device must move horizontally before an update event is generated.isEnabledEvenIfKilled
- if set to true, the location service will not stop even after the app is killed.iOSDesiredAccuracy
- the desired accuracy of the location data. -
stop(
) → Future< void> -
stop
stops the background task. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → BackgroundTask
-
Get instance
no setter