在颤振中实现平滑罗盘旋转的最佳方法是使用平滑罗盘颤振包这可能对某人有帮助 https://pub.dev/packages/smooth_compass_new
朝拜方向
SmoothCompass(
height: 200,
width: 200,
isQiblahCompass: true,
compassBuilder: (context,snapshot,child){
return AnimatedRotation(
duration: const Duration(milliseconds:800),
turns: snapshot?.data?.turns??0,
child: Stack(
children: [
Positioned(
top: 0,
left: 0,
right: 0,
bottom: 0,
child:Image.asset("assets/images/compass.png",fit: BoxFit.fill,),
),
Positioned(
top: 0,
left: 0,
right: 0,
bottom: 0,
child:AnimatedRotation(
duration: const Duration(milliseconds: 500),
turns: (snapshot?.data?.qiblahOffset??0)/360,
//Place your qiblah needle here
child: Container(
decoration: const BoxDecoration(
shape: BoxShape.circle,),
child: const VerticalDivider(
color: Colors.grey,
thickness: 5,),
)
),
),
],
),
);
},
)