사용자 입력을 위한 사용자 정의가 가능한 상호작용식 값 선택 휠을 생성할 수 있는 플러터 패키지입니다. 회전하는 휠을 통해 값을 선택하는 시각적으로 매력적인 방식을 제공하며, 설정, 타이머 또는 직관적인 숫자 또는 범주 선택이 필요한 모든 상황에 적합합니다. 휠은 부드러운 애니메이션, 사용자 지정 스타일 및 다중 플랫폼에서의 반응형 동작을 지원합니다. 전통적인 텍스트 필드나 드롭다운의 대안으로 사용자 경험을 향상시키고자 하는 개발자를 위해 설계되었습니다.
사용 사례
시각적 피드백이 있는 폼 입력
시간 또는 수량 선택기
게임화된 사용자 인터페이스
조정 가능한 매개변수를 가진 설정
상호작용형 교육 도구
주요 기능
사용자 지정 가능한 휠 표시
부드러운 회전 애니메이션
반응형 터치 및 드래그 지원
이산 및 연속 값에 대한 지원
크로스 플랫폼 호환성
적합한 대상
인터랙티브 UI를 구축하는 개발자
직관적인 값 선택이 필요한 앱
독특한 폼 요소를 원하는 디자이너
다중 플랫폼을 대상으로 하는 프로젝트
고려 사항
저사양 기기에서는 성능 최적화가 필요할 수 있습니다
제한된 내장 검증
매우 큰 값 범위에 최적화되지 않음
접근성에 대한 신중한 설계가 필요합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Selector Wheel
A Flutter package for creating customizable selector wheel widgets.
SizedBox(
width: 200,
height: 200,
child: SelectorWheel(
childCount: 10,
// convertIndexToValue is a function that converts the index of the// child to a value that is displayed on the selector wheel. In this// case, we are converting the index to a string. I.e we'll have// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 on the selector wheel.
convertIndexToValue: (int index) {
returnSelectorWheelValue(
label: index.toString(),
value: index,
index: index,
);
},
onValueChanged: (SelectorWheelValue<int> value) {
// print the value that was selectedprint(value);
},
),
)
Customizing the selector wheel
Keep in mind, that the convertIndexToValue function can be used to convert the index to any value.
In the example below, we are converting the index to a double value to represent quarter lbs.
SizedBox(
width: 200,
height: 200,
child: SelectorWheel(
childCount: 10,
convertIndexToValue: (int index) {
// This is just to illustrate, that the index can be converted// to any value. In this case, we are converting the index to// a quarter of a pound.final quarter = index / 4;
returnSelectorWheelValue(
// The label is what is displayed on the selector wheel
label: '${quarter.toString()} lb',
value: quarter,
index: index,
);
},
onValueChanged: (SelectorWheelValue<double> value) {
// print the value that was selectedprint(value);
},
),
)
The colors of the selector wheel can be customized by overriding the ThemeData in the following way:
Notice, that we're also customizing the "highlighted" item's border radius, height, and width. To see
all the customizable properties, check out the SelectorWheel class.
Contributing
Contributions are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository.
License
This package is licensed under the MIT License. For more details, please refer to the LICENSE file included in the repository.