chip_list 패키지는 Flutter에서 사용자 정의 가능한 ChoiceChip 위젯 목록을 만드는 것을 간소화합니다. 최소한의 보일러플레이트 코드로 인터랙티브하고 선택 가능한 칩 그룹을 구축할 수 있는 직관적인 API를 제공합니다. 개발자는 칩의 스타일과 동작을 쉽게 설정하고 관리할 수 있어 필터링, 태깅 또는 선택 인터페이스에 이상적입니다. 이 패키지는 Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼을 지원하여 크로스플랫폼 경험을 일관되게 유지합니다. 유연성과 사용 편의성에 중점을 두어 커스터마이징 옵션을 희생하지 않고 UI 개발을 강화합니다.
사용 사례
폼 내 필터링 옵션
태그 시스템
사용자 선호도 선택
인터랙티브 카테고리 탐색
동적 선택 입력
다중 선택 인터페이스
주요 기능
ChoiceChip와의 간편한 통합
높은 사용자 정의 가능한 외관
크로스 플랫폼 지원
최소한의 설정 필요
내장된 선택 관리
반응형 디자인 호환성
적합한 대상
폼 인터페이스를 구축하는 플러터 개발자
동적 칩 기반 선택을 필요로 하는 앱
재사용 가능한 칩 컴포넌트를 찾는 디자이너
다중 선택 기능이 필요한 프로젝트
빠른 UI 개발을 우선시하는 팀
고려 사항
ChoiceChip 위젯에 대한 이해가 필요합니다
복잡한 레이아웃을 위해 추가 스타일링이 필요할 수 있습니다
칩 기반 상호작용에 제한됨
비상호작용 콘텐츠에 적합하지 않습니다
긴 목록에 대해 스크롤 가능한 컨테이너 내에서 사용하는 것이 가장 좋습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Features
Creates a list of ChoiceChips. Also allows for selecting multiple chips at once and allows use in sync with other widgets. This package is intended to solve all your woes with regards to Chips.
Well, maybe not all, but if you would like to request a feature, fire away !
See /example/main.dart for an example on how to use the state of the list for updating the state of other widgets, and other fancy properties.
If you want to wrap the ChipList, then set shouldWrap to true.
You can then use all the properties of a typical Wrap widget to further customize appearance.
Setting individual colors for active/inactive background and border color and text color
If you want to have full control of the parameters specified above over each and every single chip, you can do so by setting the color within the activeBgColorList, inactiveBgColorList,
activeTextColorList and inactiveTextColorList respectively, wherever appropriate.
Use a single color if you want it to be used for all chips. Otherwise, the length of the list must be equal to the length of listOfChipNames.
Note that if you don't, then the package has defaults as specified in the documentation. (You can hover over the property in your IDE to see more 🙂).
Spacing in between each Chip
Whether you choose to let the axis to Axis.vertical or Axis.horizontal, you can set the spacing by tweaking widgetSpacing.
New attributes added to improve customisation if you set useMaterial3 = true
showCheckmark lets you enable or disable checkmarks in chips
checkmarkColor lets you set the color of the checkmark if it's enabled
⚠ Warning !!!!!!!!!
The flutter_lints package might suggest that you make listOfChipIndicesCurrentlySeclected a constant.
PLEASE DO NOT DO SO.
The widget will not respond to user interaction, seemingly without any reason.
The whole point of the API being designed like this is so that you have direct access to the currently selected indices, without the need for any state management and such.
That list will be updated as the user interacts with the widget. It is intended to be used in case you would like to incorporate the contents for any logic.
For an example, look at the section title "using extraOnToggle" in the provided example. The index is used to display the currently selected indice's label elsewhere in the UI.