Flutter Sortable拖放ListView [英] Flutter Sortable Drag And Drop ListView

查看:118
本文介绍了Flutter Sortable拖放ListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我开始学习Flutter,并希望像在材料指南网站上看到的那样使用材料设计拖放列表.

So I'm starting to learn Flutter and would like to use a material design drag and drop list just like the one seen on the material guidelines website.

https: //storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1dtprsH4jZ2nOnjBCJeJXd7n4U-jmWyas%2F03-list-reorder.mp4

到目前为止,我尝试过的所有库看上去都像垃圾.是否有一个我所缺少的良好库或一个Flutter本机窗口小部件?

All of the libraries I have tried out so far look like garbage compared to that. Is there a good library for this that I am missing or a native Flutter widget?

推荐答案

检查 knopp/flutter_reorderable_list .它就是这样做的. 确实很流畅,并且没有性能问题,能够处理数千个项目.

Check knopp/flutter_reorderable_list. It accomplishes just that. It's really smooth and it's got no performance issues, being able to handle thousands of items.

但是,它的实现并不像通常的flutter小部件那样容易.

However, it's implementation is not easy as usual flutter widgets.

如果您为此感到困扰,建议您使用我创建的小部件将flutter/ReorderableListView s移植到knopp/ReorderableList.

If you struggle with that, I'd recommend you to use a widget I created to port flutter/ReorderableListViews to the knopp/ReorderableList.

此小部件确实非常易于使用,但是却没有提供相同的灵活性,并且与children List一起使用时,其可伸缩性不如原始版本.

This widget makes it really easy to use, however it doesn't provide the same flexibility, and as it works with a children List, it's not as scalable as the original.

这是 ReorderableListSimple的代码,这是 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆