flutter_draggable_gridview
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.
usage
example
draggablegridviewbuilder(
griddelegate: slivergriddelegatewithfixedcrossaxiscount(
crossaxiscount: 2,
childaspectratio: mediaquery.of(context).size.width /
(mediaquery.of(context).size.height / 3),
),
listofwidgets: listofwidgets,
dragcompletion: this,
dragfeedback: this,
dragplaceholder: this,
isonlylongpress: false,
);
required parameters
griddelegate:
a delegate that controls the layout of the children within the gridview.
listofwidgets:
this property contains list of widgets and it is use to show the widget inside the gridview.builder to provide the drag & drop functionality.
dragcompletion:
this property contains dragcompletion implementation. you have to override and store updated list (if needed).
optional parameters
isonlylongpress:
this property contains bool
value. if this property is false
then it works with simple press draggable or else it works with long press. default value is ‘true’.
dragfeedback:
this property contains dragfeedback implementation. if this property overrides then you have to return a widget and we will use this widget in feedback. learn more about feedback from draggable class.
dragplaceholder:
this property contains dragplaceholder implementation. if this property overrides then you have to return a placeholderwidget and we will use this widget in place holder.
dragchildwhendragging:
this property contains dragchildwhendragging implementation. if this property overrides then you have to return a widget and we will display this widget instead of child when drags are under way. learn more about childwhendragging from draggable class.
last but not least ��
gridview.builder
properties with draggablegridviewbuilder
class.
you can use all the 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 is mit-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 to [email protected] and do let us know if you have any questions or suggestion regarding our work.
Comments are closed.