drawLine static method

Future<void> drawLine({
  1. String? apiKey,
  2. required LatLng firstPoint,
  3. required LatLng secondPoint,
  4. required Color lineColor,
  5. Uint8List? firstmarkerIcon,
  6. Uint8List? secondmarkerIcon,
  7. required int lineWidth,
  8. required bool showFirstMarker,
  9. required bool showSecondMarker,
  10. String? info1,
  11. String? info2,
  12. Function? markerOneOnTap,
  13. 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);
}