title: Flutter : Check GPS Location Mode
body: <p>I have project related using maps and tracking location user , for this i used <a href="https://pub.dev/packages/geolocator" rel="nofollow noreferrer">Geolocator Package</a>. I need to check current location of user , in my flow project first i check last position of user , if last position null then i check current position of user.</p>
  
  <h3>Code</h3>
  
  <pre><code>  Position _currentPosition;
    Position get currentPosition =&gt; _currentPosition;
  
    Future&lt;void&gt; getCurrentPosition() async {
      try {
        Position lastPosition = await Geolocator().getLastKnownPosition();
        if (lastPosition != null) {
          print("Success Get Last Position...");
          _currentPosition = lastPosition;
        } else {
          final currentPosition = await Geolocator().getCurrentPosition();
          if (currentPosition != null) {
            print("Success Get Your Current Position...");
            _currentPosition = currentPosition;
          } else {
            throw "Can't Get Your Position";
          }
        }
      } catch (e) {
        throw e;
      }
      notifyListeners();
    }
  </code></pre>
  
  <p>Then i calling <strong>getCurrentPosition</strong> Function on my button OnPressed to get location user like this : </p>
  
  <h3>Button GetLocation</h3>
  
  <pre><code>void goToMaps() async {
      final mapsProvider = context.read&lt;MapsProvider&gt;();
      try {
  
        print('Get Location User');
        await mapsProvider.getCurrentPosition();
        print('Success Get location User');
  
      } catch (e) {
        globalF.showToast(message: e.toString(), isError: true, isLongDuration: true);
      }
    }
  </code></pre>
  
  <p>First Problem is , When GPS Location Mode is <code>Device Only</code> I can't get <strong>LastPosition</strong> or <strong>Current Position</strong> it never print <strong>Success Get Location User</strong> and still print <strong>Get Location User</strong>.</p>
  
  <p>Second Problem is , When Gps Location Mode is <code>Battery Saving</code> user location i got is very inaccurate, compared i used mode <code>High Accuracy</code>.</p>
  
  <p>My question is , How can i check if gps location mode != <strong>High Accuracy</strong> , then i can show warning user to set the gps to High Accuracy.</p>
  
  <p>Similiar Like this <a href="https://stackoverflow.com/questions/25743743/how-to-know-if-device-in-high-accuracy-mode">question</a></p>
  
  <p>Thank's. </p>
  
  <p><img src="https://i.stack.imgur.com/7H5Gz.jpg" height="500"></p>