Flutter Xlider는 Flutter용으로 사용자 정의 가능한 매터리얼 디자인 슬라이더 및 범위 슬라이더로, 수평 및 수직 방향을 모두 지원하며 완전한 RTL(오른쪽에서 왼쪽으로) 레이아웃 호환성을 갖추고 있습니다. 스타일, 동작, 상호작용에 대한 광범위한 구성 옵션을 제공하여 정밀한 입력 제어가 필요한 직관적인 사용자 인터페이스를 만들기에 이상적입니다. 이 패키지는 Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼에서 호환됩니다.
사용 사례
정확한 값 선택이 필요한 폼 입력
앱 내 상호작용 설정 슬라이더
범위 기반 필터 또는 선택
RTL 언어 지원을 갖춘 다국어 앱
풍부한 시각적 피드백을 갖춘 사용자 정의 가능한 UI 컴포넌트
주요 기능
수평 및 수직 슬라이더 모드
RTL 레이아웃 지원
범위 슬라이더 기능
풍부한 사용자 정의 옵션
부드러운 애니메이션과 반응형 디자인
크로스 플랫폼 호환성
적합한 대상
양식 중심 애플리케이션을 개발하는 개발자
유연한 슬라이더 컴포넌트가 필요한 디자이너
국제적 대상 사용자를 겨냥한 앱
높은 사용자 맞춤형이 필요한 프로젝트
마테리얼 디자인 원칙을 사용하는 팀
고려 사항
복잡한 UI를 위해 추가적인 스타일링이 필요할 수 있습니다
화면에 많은 슬라이더가 있을 때의 성능 영향
고급 사용자 정의를 위한 학습 곡선
제한된 내장 접근성 기능
일관성을 위해 Flutter의 렌더링 엔진에 의존
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
flutter_xlider
Now supports null safety.
(Flutter Slider) A material design slider and range slider, horizontal and vertical, with rtl support and lots of options and customizations for flutter
!! Since version 3.4.0-dev.3, step type is no longer double, its FlutterSliderStep !!
You can change the axis of your slider by setting axis to Axis.vertical. Default is horizontal
FlutterSlider(
...
axis: Axis.vertical,
...
)
Handlers
You can customize handlers using handler and rightHandler properties.
Both handler and rightHandler accept FlutterSliderHandler class which has following properties:
child: is a widget
disabled: to disable the handler
decoration, foregroundDecoration and transform are come from Container() widget
You can control the scale animation type of your handlers, it's duration and it's scale size using handlerAnimation handlerAnimation accepts a FlutterSliderHandlerAnimation class which has 4 properties as following
If you want to have a non-linear slider with different steps, simply use rangeStep feature.
FlutterSlider(
min: 0,
max: 1000000,
...
step: FlutterSliderStep(
step: 1, // default
isPercentRange: true, // ranges are percents, 0% to 20% and so on... . default is true
rangeList: [
FlutterSliderRangeStep(from: 0, to: 20, step: 10000),
FlutterSliderRangeStep(from: 20, to: 100, step: 200000),
]
),
...
)
Ignore Steps
If your configurations requires that some steps are not available, you can use ignoreSteps property.
this property accepts a simple class to define from and to ranges.
FlutterSlider(
...
ignoreSteps: [
FlutterSliderIgnoreSteps(from: 8000, to: 12000),
FlutterSliderIgnoreSteps(from: 18000, to: 22000),
],
...
)
Fixed Values
If you want to have an array of fixed items and slide through it, you can use fixedValues property. use FlutterSliderFixedValue to add your fixed values. FlutterSliderFixedValue has following properties:
percent: (int) ( between 0..100 inclusive). the position of fixed item
value: (dynamic) the value of fixed item
when using fixedValues, values of values property, must be within 0..100
using above example, you get (string) 10K as upperValue or lowerValue (depends on handler), when you reach to 10 percent of the slider,
you get (int) 50000 when you reach 50 percent of the slider and so on...
when using fixedValues, min and max are ignored
Minimum Distance
When using range slider, the minimum distance between two handlers can be defined using minimumDistance option
FlutterSlider(
...
minimumDistance: 300,
...
)
Maximum Distance
This is the opposite of minimum distance, when using range slider, the maximum distance between two handlers can be defined using maximumDistance option
FlutterSlider(
...
maximumDistance: 300,
...
)
Locked Handlers
If you want to lock your handlers by a certain value, you can use lockHandlers and lockDistance properties
You can display a Hatch Mark underneath or beside of your slider based on axis. In order to display hatch mark you must
use FlutterSliderHatchMark class which has following properties:
linesDistanceFromTrackBar: The distance of lines from slider. can be negative
bigLine: The widget of big lines in hatch mark
smallLine: The widget of small lines in hatch mark
linesAlignment: the direct of lines, right or left which works as top or bottom on horizontal slider
density: The amount of lines per percent. 1 is default. any number less or more than 1 will decrease and increase lines respectively
displayLines: to display lines. by default is false for the sake of optimization
labels: If you want to display some label or text at certain percent in your hatch mark, you can use labels
labelBox: The widget of label box, however, you can define a widget for each label and have it's own style
labelsDistanceFromTrackBar: The distance of labels from slider. can be negative
disabled: to disabled the whole hatchmark ( hide )
It's exciting to see what you've build using this package.
Open wiki tab, create a page and share your code and image of your slider with us. Thank you
Here are some examples of what you can make using this package: