[英]how can I make game card animation in flutter
您可以為每張卡片使用密鑰並獲取每張卡片在屏幕上的位置
RenderBox box = key.currentContext.findRenderObject() as RenderBox;
print(box.localToGlobal(offset.zero));//this will give you the offset of the widget where you want to move the card..
獲得偏移量后,使用動畫小部件將當前卡片的位置移動到該偏移量。 您可能必須按順序使用索引堆棧小部件設置卡片並將卡片相互移動
如果您想使用包來制作它,請查看火焰
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.