Удалить нижнюю правую кнопку из флаттера Google Maps - PullRequest
0 голосов
/ 04 июля 2019

В правом нижнем углу виджета Google Maps API есть кнопка Google Maps. Я никогда не добавлял эту кнопку сам. Как мне это удалить?

Bottom Right button

редактирование: вот мой код

  @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),
     ],),),),],),);}

1 Ответ

1 голос
/ 04 июля 2019

Спасибо за код.

Попробуйте добавить параметр "my LocationButtonEnabled" в виджет GoogleMap ()

     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
            )
          ),
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...