Loading...
Searching...
No Matches
AsyncRouteListener Class Referenceabstract

Class provides a callback to be invoked when RouteSession handle changed/advanced events. More...

Public Member Functions

void onRouteChanged (RouteStatus status, RoutePath currentPath)
 Called when new route was built or old route was rebuilt after missing previouse one.
 
void onRouteAdvanced (double distance, LocationPoint point)
 Called when user has progressed along the route that was built in the method onRouteChanged
 

Detailed Description

Class provides a callback to be invoked when RouteSession handle changed/advanced events.

Referenced from AsyncRouteManager RouteSession.

Note
The callback is invoked in the UI thread.

Definition at line 25 of file async_route_listener.dart.

Member Function Documentation

◆ onRouteAdvanced()

void AsyncRouteListener.onRouteAdvanced ( double distance,
LocationPoint point )

Called when user has progressed along the route that was built in the method onRouteChanged

Parameters
distancedistance from the beginning or the route (unit meters)
pointcurrent location point on the route

Dart code snippet:

onRouteAdvanced: (double distance, LocationPoint point) {
print("Route advanced: $distance meters");
_demonstrateLocationPointUsage(point);
},

◆ onRouteChanged()

void AsyncRouteListener.onRouteChanged ( RouteStatus status,
RoutePath currentPath )

Called when new route was built or old route was rebuilt after missing previouse one.

Parameters
statusRouteStatus indicating the current router state
currentPathRoutePath from current postion to destination point (null if status is not new_route)

Dart code snippet:

onRouteChanged: (RouteStatus status, RoutePath currentPath) {
print("Route changed with status: $status");
if (status == RouteStatus.newRoute && currentPath != null) {
_demonstrateRoutePathUsage(currentPath);
} else {
print("Route not ready, status: $status");
}
},

The documentation for this class was generated from the following file: