drawLine static method
Future<void>
drawLine({
- String? apiKey,
- required LatLng firstPoint,
- required LatLng secondPoint,
- required Color lineColor,
- Uint8List? firstmarkerIcon,
- Uint8List? secondmarkerIcon,
- required int lineWidth,
- required bool showFirstMarker,
- required bool showSecondMarker,
- String? info1,
- String? info2,
- Function? markerOneOnTap,
- Function? markerTwoOnTap,
Draw PolineLine Function
Implementation
static Future<void> drawLine({
String? apiKey,
/// Map Api Key
required LatLng firstPoint,
/// Marker One Longitude and Latitude
required LatLng secondPoint,
/// Marker Two Longitude and Latitude
required Color lineColor,
///Polyline Color
Uint8List? firstmarkerIcon,
///First Marker icon
Uint8List? secondmarkerIcon,
///Second Marker Icon
required int lineWidth,
/// Polyline width
required bool showFirstMarker,
/// First Marker icon Hide/Show
required bool showSecondMarker,
/// Second Marker icon Hide/Show
String? info1,
///Marker One Info Window Text
String? info2,
///Marker Two Info Window Text
Function? markerOneOnTap,
///Marker One onTap
Function? markerTwoOnTap,
///Marker Two onTap
}) async {
_addMarker(
firstPoint: firstPoint,
secondPoint: secondPoint,
firstmarkerIcon: firstmarkerIcon,
secondmarkerIcon: secondmarkerIcon,
showSecondMarker: showSecondMarker,
showFirstmarker: showFirstMarker,
info1: info1,
info2: info2,
markerTwoOnTap: markerTwoOnTap,
markerOneOnTap: markerOneOnTap);
///Getting information from Google Map Api
String? data = await locationHelper.getRouteCoordinates(
firstPoint, secondPoint, apiKey);
print(data);
createPolyline(data, lineColor, lineWidth);
}