title: The method 'placemarkFromCoordinates' isn't defined for the type 'Geolocator'. Try correcting the name to the name of an existing method
body: <p>I am getting the following errors:</p>
  <p>Static method 'getPositionStream' can't be accessed through an instance.
  Try using the class 'Geolocator' to access the method.dart(instance_access_to_static_member</p>
  <p>And</p>
  <p>The method 'placemarkFromCoordinates' isn't defined for the type 'Geolocator'.
  Try correcting the name to the name of an existing method, or defining a method named 'placemarkFromCoordinates'.dart(undefined_method)</p>
  <pre><code>  Set&lt;Marker&gt; _markers = {};
    //  this polys will be displayed on the map
    Set&lt;Polyline&gt; _poly = {};
    // this polys temporarely store the polys to destination
    Set&lt;Polyline&gt; _routeToDestinationPolys = {};
    // this polys temporarely store the polys to driver
    Set&lt;Polyline&gt; _routeToDriverpoly = {};
  
    GoogleMapsServices _googleMapsServices = GoogleMapsServices();
    GoogleMapController _mapController;
    Geoflutterfire geo = Geoflutterfire();
    static LatLng _center;
    LatLng _lastPosition = _center;
    TextEditingController pickupLocationControlelr = TextEditingController();
    TextEditingController destinationController = TextEditingController();
    Position position;
    DriverService _driverService = DriverService();
    //  draggable to show
    Show show = Show.DESTINATION_SELECTION;
  
    //   taxi pin
    BitmapDescriptor carPin;
  
    //   location pin
    BitmapDescriptor locationPin;
  
    LatLng get center =&gt; _center;
  
    LatLng get lastPosition =&gt; _lastPosition;
  
    Set&lt;Marker&gt; get markers =&gt; _markers;
  
    Set&lt;Polyline&gt; get poly =&gt; _poly;
  
    GoogleMapController get mapController =&gt; _mapController;
    RouteModel routeModel;
  
    //  Driver request related variables
    bool lookingForDriver = false;
    bool alertsOnUi = false;
    bool driverFound = false;
    bool driverArrived = false;
    RideRequestServices _requestServices = RideRequestServices();
    int timeCounter = 0;
    double percentage = 0;
    Timer periodicTimer;
    String requestedDestination;
  
    String requestStatus = &quot;&quot;;
    double requestedDestinationLat;
  
    double requestedDestinationLng;
    RideRequestModel rideRequestModel;
    BuildContext mainContext;
  
  //  this variable will listen to the status of the ride request
    StreamSubscription&lt;QuerySnapshot&gt; requestStream;
    // this variable will keep track of the drivers position before and during the ride
    StreamSubscription&lt;QuerySnapshot&gt; driverStream;
  //  this stream is for all the driver on the app
    StreamSubscription&lt;List&lt;DriverModel&gt;&gt; allDriversStream;
  
    DriverModel driverModel;
    LatLng pickupCoordinates;
    LatLng destinationCoordinates;
    double ridePrice = 0;
    String notificationType = &quot;&quot;;
  
    AppStateProvider() {
      _saveDeviceToken();
      fcm.configure(
  //      this callback is used when the app runs on the foreground
          onMessage: handleOnMessage,
  //        used when the app is closed completely and is launched using the notification
          onLaunch: handleOnLaunch,
  //        when its on the background and opened using the notification drawer
          onResume: handleOnResume);
  
      _setCustomMapPin();
      _getUserLocation();
      _listemToDrivers();
      Geolocator().getPositionStream().listen(_updatePosition);
  
    }
  
  // ANCHOR: MAPS &amp; LOCATION METHODS
    _updatePosition(Position newPosition){
      position = newPosition;
      notifyListeners();
    }
    Future&lt;Position&gt; _getUserLocation() async {
      SharedPreferences prefs = await SharedPreferences.getInstance();
      position = await Geolocator().getCurrentPosition();
      List&lt;Placemark&gt; placemark = await Geolocator()
          .placemarkFromCoordinates(position.latitude, position.longitude);
  
      if (prefs.getString(COUNTRY) == null) {
        String country = placemark[0].isoCountryCode.toLowerCase();
        await prefs.setString(COUNTRY, country);
      }
  
      _center = LatLng(position.latitude, position.longitude);
      notifyListeners();
      return position;
    }
  
    onCreate(GoogleMapController controller) {
      _mapController = controller;
      notifyListeners();
    }
  
    setLastPosition(LatLng position) {
      _lastPosition = position;
      notifyListeners();
    }
  
    onCameraMove(CameraPosition position) {
      //  MOVE the pickup marker only when selecting the pickup location
      if (show == Show.PICKUP_SELECTION) {
        _lastPosition = position.target;
        changePickupLocationAddress(address: &quot;loading...&quot;);
        if (_markers.isNotEmpty) {
          _markers.forEach((element) async {
            if (element.markerId.value == PICKUP_MARKER_ID) {
              _markers.remove(element);
              pickupCoordinates = position.target;
              addPickupMarker(position.target);
              List&lt;Placemark&gt; placemark = await Geolocator()
                  .placemarkFromCoordinates(
                      position.target.latitude, position.target.longitude);
              pickupLocationControlelr.text = placemark[0].name;
              notifyListeners();
            }
          });
        }
        notifyListeners();
      }
    }
  
  
  </code></pre>
  <p>PUBSPEC.YAML</p>
  <pre><code>dependencies:
    flutter:
      sdk: flutter
    cloud_firestore: any
    cupertino_icons: any
    firebase_auth: any
    firebase_core: any
    firebase_messaging: ^5.0.2
    flutter_google_places: any
    flutter_spinkit: ^4.1.2
    geocoder: any
    geoflutterfire: ^2.0.3+6
    geolocator: any
    get_it: ^1.0.3+2
    google_maps_flutter: any
    google_maps_webservice: any
    http: any
    location: any
    modal_bottom_sheet: ^0.2.2
    percent_indicator: ^2.1.7+2
    provider: ^5.0.0
    rxdart: any
    shared_preferences: any
    url_launcher: any
    uuid: any
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Yg9Jo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yg9Jo.png" alt="enter image description here" /></a></p>