GeoPolylineWidget class

A polyline widget for displaying paths and routes on maps.

This widget represents a connected series of line segments with customizable appearance including color, width, cap style, and dash patterns.

Example:

final route = GeoPolylineWidget(
  points: [
    GeoPoint(latitude: 37.7749, longitude: -122.4194),
    GeoPoint(latitude: 37.7849, longitude: -122.4094),
    GeoPoint(latitude: 37.7949, longitude: -122.3994),
  ],
);

// Using route preset
final path = GeoPolylineWidget.route(points: myPoints);
Inheritance

Constructors

GeoPolylineWidget({required String id, required List<GeoPoint> points, double width = 4.0, PolylineCap capStyle = PolylineCap.round, bool isGeodesic = true, List<int>? dashPattern, bool isInteractive = true, Map<String, dynamic> metadata = const {}, MarkerConfig? centerMarker, MarkerConfig? startMarker, MarkerConfig? endMarker, Color strokeColor = const Color(0xFF2196F3)})
Creates a new GeoPolylineWidget with the given properties.
const
GeoPolylineWidget.boundary({required List<GeoPoint> points, String? id, double width = 2.0, MarkerConfig? centerMarker, MarkerConfig? startMarker, MarkerConfig? endMarker})
Creates a preset "boundary" polyline with dashed styling.
factory
GeoPolylineWidget.corridor({required List<GeoPoint> points, String? id, double width = 4.0, MarkerConfig? centerMarker, MarkerConfig? startMarker, MarkerConfig? endMarker})
Creates a preset "corridor" polyline with orange styling.
factory
GeoPolylineWidget.flightPath({required List<GeoPoint> points, String? id, double width = 3.0, MarkerConfig? centerMarker, MarkerConfig? startMarker, MarkerConfig? endMarker})
Creates a preset "flight path" polyline with dashed styling.
factory
GeoPolylineWidget.navigationPath({required List<GeoPoint> points, String? id, double width = 6.0, MarkerConfig? centerMarker, MarkerConfig? startMarker, MarkerConfig? endMarker})
Creates a preset "navigation path" polyline with green styling.
factory
GeoPolylineWidget.route({required List<GeoPoint> points, String? id, double width = 5.0, MarkerConfig? centerMarker, MarkerConfig? startMarker, MarkerConfig? endMarker})
Creates a preset "route" polyline with blue styling.
factory

Properties

approximateLength double
Calculates the total length of this polyline in meters.
no setter
capStyle PolylineCap
Style for the line endings.
final
centerMarker MarkerConfig?
Optional marker configuration for the center of the geofence.
finalinherited
color Color
Fill color for the geofence area.
finalinherited
dashPattern List<int>?
Dash pattern for the line (null for solid line). Values represent lengths of dashes and gaps in pixels.
final
endMarker MarkerConfig?
Optional marker to display at the end of the polyline.
final
hashCode int
The hash code for this object.
no setteroverride
id String
Unique identifier for this geofence.
finalinherited
isGeodesic bool
Whether the line follows the Earth's curvature (geodesic).
final
isInteractive bool
Whether this geofence can be interacted with (tapped).
finalinherited
markerPosition GeoPoint
The position where the center marker should be placed.
no setteroverride
metadata Map<String, dynamic>
Additional metadata associated with this geofence.
finalinherited
pointCount int
Returns the number of points in this polyline.
no setter
points List<GeoPoint>
The list of points defining the polyline.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startMarker MarkerConfig?
Optional marker to display at the start of the polyline.
final
strokeColor Color
Border/stroke color of the polyline.
final
width double
Width of the line in pixels.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts this geofence to a map representation.
override
toString() String
A string representation of this object.
override
validate() → void
Validates this geofence's configuration.
override

Operators

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