How to get our live location in flutter?

Viewed 64

I want to draw the navigation from my live location to destination. So I have used flutter_mapbox_navigation package and its working fine for navigation between two stored points.

  RaisedButton(
                      child: Text("Start"),
                      onPressed: () async {
                        var wayPoints = List<WayPoint>();
                        wayPoints.add(_origin);
                        wayPoints.add(_stop1);

                        await _directions.startNavigation(
                            wayPoints: wayPoints,
                            options: MapBoxOptions(
                                mode:
                                    MapBoxNavigationMode.drivingWithTraffic,
                                simulateRoute: true,
                                language: "en",
                                units: VoiceUnits.metric));
                      },
                    ),
                  

But I want to navigate between my live location and destination. How location package can be used so as to do the following?

1 Answers

A Flutter geolocation plugin that provides easy access to platform-specific location services (FusedLocationProviderClient or if not available the LocationManager on Android and CLLocationManager on iOS).

Related