admin管理员组文章数量:1418592
I recently noticed an issue on iPhone 15. I have a word game built in Flutter web, in which the user has to drag and drop tiles to match words with synonyms. For this I have used a draggable widget with feedback as seen in the code below.
return Stack(
children: [
(wordList.colors[index] != wordList.green)
? DragTarget<Map>(
hitTestBehavior: HitTestBehavior.translucent,
builder: ((context, candidateData, rejectedData) {
return Draggable<Map>(
rootOverlay: true,
onDragStarted: () {
lIndex = index;
},
data: {'text': str, 'index': index},
feedback: ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: Card(
elevation: 5,
shadowColor: Colors.grey,
child: Container(
color: Colors.grey.shade200,
child: Text(
str,
style: const TextStyle(
fontSize: 18, color: Colors.black87),
),
),
),
),
childWhenDragging: Container(
width: 50,
height: 20,
color: Colors.grey,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: Card(
elevation: 10,
shadowColor: Colors.grey,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 12.0, vertical: 2.0),
// margin: const EdgeInsets.symmetric(vertical: 6.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.black38),
borderRadius: BorderRadius.circular(12.0),
color: wordList.colors[index],
),
child: FittedBox(
child: Text(
str,
style: const TextStyle(fontSize: 20),
maxLines: 1,
),
)),
),
));
}),
onWillAcceptWithDetails: (data) {
return true;
},
onAcceptWithDetails: (value) {
swapWords(value.data, index);
refresh();
},
)
This works perfectly on Android phones, desktops and even iPhones prior to 15 on Safari browser. I dont know what has changed in the new iPhones that the feedback widget is not seen at all. As a result when the user drags and drops a word tile, the words swap alright but there is no indication to the user that he has dragged something.
You can see the game behavior at / Play it on iPhone 15 and on any other device and see the difference.
Any help / pointers would be appreciated.
本文标签: dartFlutter draggable widget not showing feedback in iPhone 15Stack Overflow
版权声明:本文标题:dart - Flutter draggable widget not showing feedback in iPhone 15 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745297346a2652161.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论