android - 颤振谷歌地图滞后
问题描述
我正在与谷歌地图项目合作。通过将地图放入动画容器中完成的实现,如本视频所示
iphone上的动画非常流畅,但在android上却有延迟。我应该怎么做才能使它在动画中变得更好
AnimatedContainer(
duration: const Duration(microseconds: 1000),
width: _size.width,
height: _shouldShow ? _size.height * 0.8 : 200,
child: ClipRRect(
borderRadius: BorderRadius.circular(25.0),
child: Stack(
children: [
GoogleMap(
onMapCreated: _onMapCreated,
mapToolbarEnabled: true,
zoomControlsEnabled: false,
zoomGesturesEnabled: _shouldShow ? true : false,
scrollGesturesEnabled: _shouldShow ? true : false,
myLocationButtonEnabled: false,
initialCameraPosition: CameraPosition(
target: _center,
zoom: _shouldShow ? _zoom : 11.0,
),
),
Positioned(
right: 0,
top: 10,
child: GestureDetector(
onTap: () {
print(_shouldShow);
setState(() {
_shouldShow
? _animationController.forward()
: _animationController.reverse();
_animationController.reverse();
mapController.animateCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: _center, zoom: 11.0),
),
);
_shouldShow = !_shouldShow;
// _onMapCreated(mapController);
});
},
child: Container(
width: 46,
height: 46,
child: AnimatedIcon(
progress: _animationController,
icon: AnimatedIcons.close_menu,
),
),
)),
],
),
),
),
解决方案
推荐阅读
- javascript - 在点击链接更改但内容更改后,我无法使用 VueJS 更改内容
- r - 参数曲线的 alphaArc 长度重新参数化,表示为 R 中的表达式
- sql-server - SQL Server 标识 num 随机从一个数字而不是 1 开始
- c# - 页面加载 c# web 表单时 Ajax 加载 gif
- sql - 为 ProjectManager 列中为“是”的员工返回 PastYrGrossPay 列的总和
- php - 如何在WordPress中的作者旁边添加经过验证的徽章
- oauth - 雪花数据机器人 oauth 连接
- c# - Entity Framework 不会为表生成 dbset。是什么原因?
- ansible - Zookeeper集群安装使用ansible问题
- android - 工作约束不满足时 Android 工作管理器的工作