Flutter 更改myLocationButton的颜色--谷歌地图
有没有办法改变谷歌iOS/Android API中myLocationButton的默认颜色?我似乎不知道该怎么做Flutter 更改myLocationButton的颜色--谷歌地图,flutter,google-maps,dart,google-api,Flutter,Google Maps,Dart,Google Api,有没有办法改变谷歌iOS/Android API中myLocationButton的默认颜色?我似乎不知道该怎么做 @override Widget build(BuildContext context) { return new Scaffold( body: _initialPosition == null ? Center( child: CircularProgressIndicator( valueC
@override
Widget build(BuildContext context) {
return new Scaffold(
body: _initialPosition == null
? Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.blue),
),
)
: Stack(children: [
GoogleMap(
mapType: MapType.normal,
initialCameraPosition: _currentPosition,
onMapCreated: (GoogleMapController controller) {
_setStyle(controller);
_controller.complete(controller);
},
zoomGesturesEnabled: true,
markers: _markers,
polylines: _polylines,
myLocationButtonEnabled: true,
myLocationEnabled: true,
mapToolbarEnabled: true,
),
]));
}
@覆盖
小部件构建(构建上下文){
归还新脚手架(
正文:_initialPosition==null
?中心(
子对象:循环压缩机指示器(
valueColor:AlwaysStoppedAnimation(颜色.蓝色),
),
)
:堆栈(子项:[
谷歌地图(
mapType:mapType.normal,
initialCameraPosition:_currentPosition,
onMapCreated:(谷歌地图控制器){
_设置方式(控制器);
_控制器。完成(控制器);
},
zoomGesturesEnabled:对,
标记:_标记,
多段线:_多段线,
myLocationButtonEnabled:正确,
myLocationEnabled:对,
mapToolbarEnabled:true,
),
]));
}
您是否尝试过自定义浮动操作按钮?是否要更改为locationButton本身或实际位置的蓝点?