GridView.builder에 드래그 앤 드롭 기능을 제공하는 플러터 패키지로, 사용자가 그리드 레이아웃 내 항목을 재정렬할 수 있도록 합니다. 기존 그리드 구조와 큰 코드 변경 없이 원활하게 통합될 수 있습니다. 다양한 플랫폼에서 부드럽고 반응성 있는 상호작용을 위해 설계되어, 사용자 정의 또는 상호작용 가능한 그리드 배열이 필요한 앱의 사용자 경험을 향상시킵니다. 가볍고 쉽게 구현할 수 있어 작업 관리자, 대시보드 또는 이미지 갤러리에서 리스트 재정렬에 이상적입니다.
사용 사례
작업 목록의 항목 재정렬
사용자 정의 가능한 대시보드 레이아웃
이미지 갤러리 항목 재정렬
인터랙티브 제품 그리드
사용자 선호도 기반 정렬
드래그 가능한 콘텐츠 관리
주요 기능
GridView.builder와의 원활한 통합
크로스 플랫폼 지원 (Android, iOS, Web, macOS, Windows, Linux)
부드러운 드래그 앤 드롭 애니메이션
필요한 설정 최소화
사용자 정의 드래그 핸들을 지원합니다
재정렬 중에 그리드 구조를 유지합니다
적합한 대상
인터랙티브 그리드 인터페이스를 구축하는 개발자
사용자 중심의 항목 재정렬이 필요한 앱
동적 콘텐츠 레이아웃을 가진 프로젝트
사용자 경험 중심 애플리케이션
크로스 플랫폼 일관성을 우선시하는 팀
고려 사항
추가 상태 관리가 필요할 수 있습니다
대규모 데이터 세트의 성능 영향
복잡한 드래그 동작에 대한 사용자 정의 제한
그리드가 아닌 스크롤 가능한 위젯에는 적합하지 않습니다
항목 키를 주의 깊게 다뤄야 합니다
작은 크기에서 중간 규모의 데이터 세트와 함께 사용하는 것이 가장 좋습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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.
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 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:
With this callback, you have to return a Widget and we will use this widget in feedback. Learn more about feedback from Draggable 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 from Draggable class.
Last But Not Least :heart_eyes:
You can use all the GridView.builder properties with DraggableGridViewBuilder 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
We’d be really happy if you send us links to your projects where you use our component. Just send an email to sales@mindinventory.com And do let us know if you have any questions or suggestion regarding our work.