map_polyline_draw 1.0.2
map_polyline_draw: ^1.0.2

Flutter Android iOS

Map Polyline Draw Package to show Map Polyline between Two Points

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:map_polyline_draw/map_polyline_draw.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(
        title: "Map Polyline Draw",
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: MapPolyLineDraw(
        //These three are compulsory to add otherwise it will generate error
        apiKey: "YOUR_API_KEY",
        firstPoint: MapPoint(24.8960309, 67.0792159),
        secondPoint: MapPoint(24.9425822, 67.0691675),
        // mapTypes: MapTypes.satellite,
        // mapOnTap: (point) {
        //   print(point.toString());
        // },
        // myLocationEnabled: true,
        // markerOneOnTap: () {
        //   print("Marker One Tap");
        // },
        // markerTwoOnTap: () {
        //   print("Marker Two Tap");
        // },
        // trafficEnable: true,
        // markerOneInfoText: "First Point",
        // markerTwoInfoText: "Second Point",
        // showMarkerOne: true,
        // showMarkerTwo: true,
        // firstPointMarkerIcon: 'assets/images/map.png',
        // secondPointMarkerIcon: 'assets/images/map.png',
        // lineColor: Colors.green,
        // lineWidth: 10,
        // mapZoom: 10,
        // firstMarkerIconWidth: 120,
        // secondMarkerIconWidth: 120,
      ),
    );
  }
}
2
likes
100
pub points
69%
popularity

Map Polyline Draw Package to show Map Polyline between Two Points

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

safwanidrees957@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, google_maps_flutter, http

More

Packages that depend on map_polyline_draw