add method
void
add(
- String name,
- List<
Landmark> waypoints, { - RoutePreferences? preferences,
- bool overwrite = false,
Adds a new route or updates an existing one in this bookmarks collection.
Stores a route identified by name together with its waypoints and optional preferences.
When a route with the same name already exists the operation will fail unless overwrite
is set to true, in which case the existing route is replaced.
Only route-relevant preference fields are persisted.
Parameters
name: Unique name identifying the route.waypoints: Ordered list of Landmark objects defining the route.preferences: Optional RoutePreferences to store with the route. Ifnull, a default set of preferences will be used.overwrite: Whentrue, overwrite an existing route with the same name. Defaults tofalse.
Implementation
void add(
final String name,
final List<Landmark> waypoints, {
final RoutePreferences? preferences,
final bool overwrite = false,
}) {
final LandmarkList landmarkList = LandmarkList.fromList(waypoints);
objectMethod(
pointerId,
'RouteBookmarks',
'add',
args: <String, dynamic>{
'name': name,
'waypoints': landmarkList.pointerId,
if (preferences != null) 'preferences': preferences,
'overwrite': overwrite,
},
);
}