다중 선택, 리스트 내 드래그 앤 드롭 재정렬 및 여러 리스트 간 드래그 앤 드롭을 내장된 지원 기능으로 제공하는 플러터 패키지입니다. 제스처를 통해 직관적인 데이터 조작을 가능하게 하여 사용자 인터랙션을 향상시킵니다. 작업 관리자, 플레이리스트 빌더 또는 구성 패널과 같이 동적 리스트 관리가 필요한 애플리케이션에 적합합니다. 이 패키지는 크로스플랫폼이며, Android, iOS, macOS, Windows, Linux를 모두 지원합니다.
사용 사례
작업 우선순위
재생 목록 관리
구성 패널 정렬
양식 내 데이터 재정렬
다중 목록 항목 이동
주요 기능
다중 선택 지원
리스트 내 드래그 앤 드롭 재정렬
크로스리스트 드래그 앤 드롭
내장된 선택 상태 관리
반응형 제스처 처리
적합한 대상
인터랙티브 리스트 인터페이스를 구축하는 개발자
유연한 데이터 재정렬이 필요한 앱
드래그 앤 드롭 워크플로우를 선호하는 사용자
크로스 플랫폼 리스트 관리 도구
UI 중심의 생산성 애플리케이션
고려 사항
선택 상태를 신중하게 다뤄야 합니다
복잡한 레이아웃의 경우 맞춤 스타일링이 필요할 수 있습니다
매우 큰 목록과 함께하는 성능 영향
리스트 기반 데이터 구조에 한정
드래그 타겟을 위한 올바른 위젯 트리 구조에 의존
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
selectable_draggable_listbox
Listbox with multiselect, drag & drop between lists, and reorder built in.
Features
Bind your data to a listview of custom widget
Simple text item widget -or-
Templated list item widget for more cusomizability
Multi-select items
Shift-click to select items in sequence
Ctrl/Cmd-click to select individual items
Single-select only option available
Reorderable
Click & drag the "three lines" icon to reorder item
Drag & Drop
Drag items from/to different lists
Each list may independently be a draggable, drop target, or both
Getting started
Add the latest version of this package:
Run flutter pub add selectable_draggable_listbox -or-
// Create your list and transform it to track selected items (list can be complex objects instead):final myList = ['Apples','Cheese','Bread','Milk'].forListbox().toList();
// Create the listbox widgetreturnListbox(
items: myList,
itemTemplate: (context, eventManager, index, item, onSelect) {
// Define the template used for each listitemreturnSimpleListboxItem(
key: Key('$index'), // Key is required for reordering
item: item,
label: item.data,
eventManager: eventManager,
onSelect: onSelect,
);
},
onSelect: (itemsSelected) {
// React to items selected// Note: (value of isSelected is not set automatically by Listbox,// due to not knowing how your state is handled)setState(() {
for (var item in myList) {
item.isSelected = itemsSelected.contains(item);
}
});
},
onReorder: (oldIndex, newIndex) {
// React to item reorderedsetState(() {
// Note: this is an extension provided by the package
myList.move(oldIndex, newIndex);
});
},
);
Advanced Usage
For more info on additional features like Drag & Drop and Customizable Templates, see examples and API: