Skip to content

flutter中一个可拖拽的gridview雏形,拖拽过程中的动画以及滚动仍在想办法。

Notifications You must be signed in to change notification settings

lij963/draggable_gridview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

draggable_gridview

实现一个简单的可拖拽Item的GridView。

Getting Started

用起来大概是这样,有其他需求可以自行修改SortableGridView类

SortableGridView(
        channelItems,
        childAspectRatio: 3.0, //宽高3比1
        crossAxisCount: 3, //3列
        scrollDirection: Axis.vertical, //竖向滑动
        canAccept: (oldIndex, newIndex) {
          return true;
        },
        itemBuilder: (context, data) {
          return Card(
              child: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 5.0),
            child: Center(
              child: Text(data),
            ),
          ));
        },
      )

For help getting started with Flutter, view our online documentation.

About

flutter中一个可拖拽的gridview雏形,拖拽过程中的动画以及滚动仍在想办法。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages