CustomLocationDataSource class final
A LocationDataSource that can be driven by a user-defined provider of location data (LocationProvider). This can be useful if you have location data coming from a custom source that you would like to use in the form of a LocationDataSource so it can interface with other parts of the API.
Each time the datasource is started, it will ask for a LocationProvider by calling the function provided in the constructor. The function must return a LocationProvider instance that is fully initialized and generating locations and headings.
When stopped, the datasource cancels its subscriptions to the LocationProvider.locations and LocationProvider.headings streams and releases its reference to the provider.
- Inheritance
-
- Object
- LocationDataSource
- CustomLocationDataSource
Constructors
-
CustomLocationDataSource(FutureOr<
LocationProvider> generateLocationProvider()) -
Constructs a CustomLocationDataSource.
The
generateLocationProvider
parameter is a function that is called when the datasource is started and returns a LocationProvider.factory
Properties
- currentProvider → LocationProvider?
-
The LocationProvider currently being used by the datasource. Will be
null if the datasource is not started.
no setter
- error → ArcGISException?
-
An error that describes a problem encountered while starting or running
the LocationDataSource.
no setterinherited
- exception → Exception?
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
onErrorChanged
→ Stream<
ArcGISException?> -
Indicates that the LocationDataSource.error property has changed.
no setterinherited
-
onExceptionChanged
→ Stream<
Exception?> -
no setterinherited
-
onHeadingChanged
→ Stream<
double> -
Set the heading changed callback function for the location data source.
no setterinherited
-
onLocationChanged
→ Stream<
ArcGISLocation> -
Set the location changed callback function for the location data source.
no setterinherited
-
onStatusChanged
→ Stream<
LocationDataSourceStatus> -
Set the status changed callback function for the location data source.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → LocationDataSourceStatus
-
The current status of the location data source.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → Future< void> -
Starts the location data source asynchronously and prepares to begin
receiving location updates.
inherited
-
stop(
) → Future< void> -
Stops the location data source asynchronously.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateHeading(
double heading) → void -
Updates the current heading angle, in degrees clockwise, relative to
north.
inherited
-
updateLocation(
ArcGISLocation location) → void -
Updates the position of the current location.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited