Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This package supports drag & drop widgets inside the GridView.builder for multiplatform. It provides all the properties which are available in Gridview. builder and easy to implement with the few lines of code.

License

NotificationsYou must be signed in to change notification settings

Mindinventory/flutter_draggable_gridview

Repository files navigation

flutter_draggable_gridview versionflutter_draggable_gridview Git StarsMIT License

This package supports drag & drop widgets inside the GridView.builder for multiplatform. It provides all the properties which are available in Gridview.builder and easy to implement with the few lines of code.

Draggable GridView.

Draggable GridView

Usage

Example

DraggableGridViewBuilder(        gridDelegate:SliverGridDelegateWithFixedCrossAxisCount(          crossAxisCount:2,          childAspectRatio:MediaQuery.of(context).size.width/ (MediaQuery.of(context).size.height/3),        ),        children: _listOfDraggableGridItem,        isOnlyLongPress:false,        dragCompletion: (List<DraggableGridItem> list,int beforeIndex,int afterIndex) {print('onDragAccept: $beforeIndex -> $afterIndex');        },        dragFeedback: (List<DraggableGridItem> list,int index) {returnContainer(            child: list[index].child,            width:200,            height:150,          );        },        dragPlaceHolder: (List<DraggableGridItem> list,int index) {returnPlaceHolderWidget(            child:Container(              color:Colors.white,            ),          );        },      );

Required parameters

gridDelegate:

A delegate that controls the layout of the children within the GridView.

children:

This property contains list of [DraggableGridItem] and it is use to show the widget inside the GridView.builder to provide the drag & drop functionality. Also, it contains isDraggable parameter which manages enable/disable the drag & drop functionality.

dragCompletion:

This callback provides updated list and old and new indexes.

Optional parameters

isOnlyLongPress:

This property containsbool value. If this property isfalse then it works with simple press draggable or else it works with long press. default value is 'true'.

dragFeedback:

With this callback, you have to return a Widget and we will use this widget in feedback. Learn more about feedback fromDraggable class.

dragPlaceHolder:

TWith this callback, you have to return a PlaceHolderWidget and we will use this widget in place holder.

dragChildWhenDragging:

With this callback, you have to return a Widget and we will display this widget instead of child when drags are under way. Learn more about childWhenDragging fromDraggable class.

Last But Not Least 😍

You can use all theGridView.builder properties withDraggableGridViewBuilder class.

Note:

The result returns in List. so it can be lost later, you are responsible for storing it somewhere permanent (if needed).

Guideline for contributors

Contribution towards our repository is always welcome, we request contributors to create a pull request to the develop branch only.

Guideline to report an issue/feature request

It would be great for us if the reporter can share the below things to understand the root cause of the issue.

  • Library version
  • Code snippet
  • Logs if applicable
  • Device specification like (Manufacturer, OS version, etc)
  • Screenshot/video with steps to reproduce the issue

LICENSE!

Flutter Draggable GridView isMIT-licensed.

Let us know!

We’d be really happy if you send us links to your projects where you use our component. Just send an email tosales@mindinventory.com And do let us know if you have any questions or suggestion regarding our work.

About

This package supports drag & drop widgets inside the GridView.builder for multiplatform. It provides all the properties which are available in Gridview. builder and easy to implement with the few lines of code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors15


[8]ページ先頭

©2009-2026 Movatter.jp