从谷歌地图颤动中删除右下角按钮

jos*_*Lor 6 google-maps dart flutter

谷歌地图 API 谷歌地图小部件的右下方有一个按钮。我自己从来没有添加过这个按钮。如何删除它?

右下按钮

编辑:这是我的代码

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("TravelBuddy"),
      ),
      body: Stack(
        children: <Widget>[
          GoogleMap(
            onMapCreated: _onMapCreated,
            initialCameraPosition: 
              CameraPosition(
              target: _center,
              zoom: 11.0,
              ),
            mapType: _currentMapType,
            markers: _markers,
            onCameraMove: _onCameraMove,
          ),
          Padding(
            padding: EdgeInsets.all(16.0),
            child:  Align(
              alignment: Alignment.topRight,
              child: Column(
                children: <Widget>[
                  button(_onMapTypeButtonPressed, Icons.map),
                  SizedBox(height: 16.0),
                  button(_onAddMarkerButtonPressed, Icons.add_location),
                  SizedBox(height: 16.0),
                  button(_goToPosition1, Icons.location_searching),
     ],),),),],),);}
Run Code Online (Sandbox Code Playgroud)

Fad*_*liS 10

感谢您的代码。

尝试在 GoogleMap() 小部件中放置一个选项“my LocationButtonEnabled”

     GoogleMap(
            onMapCreated: _onMapCreated,
            initialCameraPosition: 
              CameraPosition(
              target: _center,
              zoom: 11.0,
              ),
            mapType: _currentMapType,
            markers: _markers,
            onCameraMove: _onCameraMove,
            myLocationButtonEnabled: false,
            options: GoogleMapOptions(
              myLocationEnabled:true
              //there is a lot more options you can add here
            )
          ),
Run Code Online (Sandbox Code Playgroud)


小智 7

我有类似的问题。在 GoogleMap() 小部件中添加“zoomControlsEnabled: false”对我有用。