title: flutter_map - Why the location is changing, and the map is not moving?
body: <p>I use flutter_map and geolocator packages for my app. I have built MainMap widget to manage the Stream from Geolocator(), and pass it to another widget. It's all fine, my marker is moving, when my location changes, but my map still stays in the same place. I don't know why the center property is not changing at all. _currentPosition values are good because they change properly in Text widget.</p>
  <pre><code>options: MapOptions(
              center: _currentPosition,
              zoom: 10,
              plugins: [
                MarkerClusterPlugin(),
              ],
            ),
  </code></pre>
  <pre><code>Text('${_currentPosition.latitude}, ${_currentPosition.longitude}',),
  </code></pre>
  <p>Here's the whole code.</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter_map/flutter_map.dart';
  import 'package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart';
  import 'package:latlong/latlong.dart';
  import 'package:geolocator/geolocator.dart';
  
  class MainMap extends StatelessWidget {
    final locationOptions =
        LocationOptions(accuracy: LocationAccuracy.best, distanceFilter: 0);
  
    @override
    Widget build(BuildContext context) {
      return StreamBuilder(
        stream: Geolocator().getPositionStream(locationOptions),
        builder: (context, snapshot) {
          if (!snapshot.hasData) {
            return Center(
              child: CircularProgressIndicator(),
            );
          }
          return MainMapContent(position: snapshot.data);
        },
      );
    }
  }
  
  class MainMapContent extends StatefulWidget {
    final Position position;
  
    MainMapContent({this.position, Key key}) : super(key: key);
  
    @override
    _MainMapContentState createState() =&gt; _MainMapContentState();
  }
  
  class _MainMapContentState extends State&lt;MainMapContent&gt; {
    @override
    Widget build(BuildContext context) {
      final _currentPosition =
          LatLng(widget.position.latitude, widget.position.longitude);
      return Stack(
        children: &lt;Widget&gt;[
          FlutterMap(
            options: MapOptions(
              center: _currentPosition,
              zoom: 10,
              plugins: [
                MarkerClusterPlugin(),
              ],
            ),
            layers: [
              TileLayerOptions(
                urlTemplate: &quot;https://api.tiles.mapbox.com/v4/&quot;
                    &quot;{id}/{z}/{x}/{y}@2x.png?access_token={accessToken}&quot;,
                additionalOptions: {
                  'accessToken':
                      '&lt;redacted for security&gt;',
                  'id': 'mapbox.streets',
                },
              ),
              MarkerClusterLayerOptions(
                maxClusterRadius: 50,
                size: Size(40, 40),
                anchor: AnchorPos.align(AnchorAlign.center),
                fitBoundsOptions: FitBoundsOptions(
                  padding: EdgeInsets.all(50),
                ),
                markers: [
                  Marker(
                    anchorPos: AnchorPos.align(AnchorAlign.center),
                    height: 30,
                    width: 30,
                    point: _currentPosition,
                    builder: (ctx) =&gt; Container(
                      height: 40,
                      width: 40,
                      decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(50),
                      ),
                      child: Icon(
                        Icons.account_circle,
                        color: Colors.black,
                        size: 30,
                      ),
                    ),
                  ),
                ],
                polygonOptions: PolygonOptions(
                  borderColor: Colors.blueAccent,
                  color: Colors.black12,
                  borderStrokeWidth: 3,
                ),
                builder: (context, markers) {
                  return FloatingActionButton(
                    child: Text(markers.length.toString()),
                    onPressed: null,
                  );
                },
              ),
            ],
          ),
          Container(
            width: double.infinity,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: &lt;Widget&gt;[
                SizedBox(height: 10),
                Text(
                  '${_currentPosition.latitude}, ${_currentPosition.longitude}',
                ),
              ],
            ),
          ),
        ],
      );
    }
  }
  </code></pre>