您可以将前台的动作小部件跳过到另一个小部件吗?
Can you skip an action widget in the foreground to another widget?
我在 GoogleMap 上方使用 Lottie,但我有问题我无法在图片的框架中移动 GoogleMap
例如,当我用手指在地图内部移动时
它工作正常但在 Lottie 的边缘不起作用
我可以跳过 Lottie 移动地图吗就好像它不存在一样
我的代码
Stack(
children: [
GoogleMap(
padding: EdgeInsets.only(bottom: bottomPosition),
myLocationButtonEnabled: false,
initialCameraPosition: _cameraPosition,
myLocationEnabled: true,
onCameraMoveStarted: () {
setState(() {
_controllerAnimation.forward(from: 0.0);
});
},
onCameraIdle: () {
setState(() {
_controllerAnimation.forward(from: 0.65);
});
},
onMapCreated: (GoogleMapController controller) async {
_controller.complete(controller);
_googleMapController = controller;
},
),
Positioned(
top: (mapHeight - iconSize - 180) / 2,
right: (mapWidth - iconSize - 60) / 2,
child: Lottie.asset("assets/json_assets/expanding_marker.json",
width: 128,
height: 160,
repeat: false,
controller: _controllerAnimation, onLoaded: (composition) {
_controllerAnimation.duration = composition.duration;
_controllerAnimation.forward(from: 0.50);
_controllerAnimation.stop(canceled: true);
})
),
])
如果没有办法解决,请问有没有别的办法。
试试这个:
Positioned(
top: (mapHeight - iconSize - 180) / 2,
right: (mapWidth - iconSize - 60) / 2,
child:
IgnorePointer(ignoring: true, child:
Lottie.asset("assets/json_assets/expanding_marker.json",
width: 128,
height: 160,
repeat: false,
controller: _controllerAnimation, onLoaded: (composition) {
_controllerAnimation.duration = composition.duration;
_controllerAnimation.forward(from: 0.50);
_controllerAnimation.stop(canceled: true);
})
),),
])
我在 GoogleMap 上方使用 Lottie,但我有问题我无法在图片的框架中移动 GoogleMap 例如,当我用手指在地图内部移动时 它工作正常但在 Lottie 的边缘不起作用 我可以跳过 Lottie 移动地图吗就好像它不存在一样
我的代码
Stack(
children: [
GoogleMap(
padding: EdgeInsets.only(bottom: bottomPosition),
myLocationButtonEnabled: false,
initialCameraPosition: _cameraPosition,
myLocationEnabled: true,
onCameraMoveStarted: () {
setState(() {
_controllerAnimation.forward(from: 0.0);
});
},
onCameraIdle: () {
setState(() {
_controllerAnimation.forward(from: 0.65);
});
},
onMapCreated: (GoogleMapController controller) async {
_controller.complete(controller);
_googleMapController = controller;
},
),
Positioned(
top: (mapHeight - iconSize - 180) / 2,
right: (mapWidth - iconSize - 60) / 2,
child: Lottie.asset("assets/json_assets/expanding_marker.json",
width: 128,
height: 160,
repeat: false,
controller: _controllerAnimation, onLoaded: (composition) {
_controllerAnimation.duration = composition.duration;
_controllerAnimation.forward(from: 0.50);
_controllerAnimation.stop(canceled: true);
})
),
])
如果没有办法解决,请问有没有别的办法。
试试这个:
Positioned(
top: (mapHeight - iconSize - 180) / 2,
right: (mapWidth - iconSize - 60) / 2,
child:
IgnorePointer(ignoring: true, child:
Lottie.asset("assets/json_assets/expanding_marker.json",
width: 128,
height: 160,
repeat: false,
controller: _controllerAnimation, onLoaded: (composition) {
_controllerAnimation.duration = composition.duration;
_controllerAnimation.forward(from: 0.50);
_controllerAnimation.stop(canceled: true);
})
),),
])