패키지, 저장소 및 앱 카테고리 검색

wheel_slider 표지
패키지 상세v1.2.2

wheel_slider

Wheel Slider는 많은 사용자 정의 기능을 제공하며, 휠처럼 생긴 외관으로 스크롤할 수 있게 해줍니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
7천
좋아요
133
Pub 점수
150

패키지 설치

flutter pub add wheel_slider

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

휠 슬라이더는 숫자나 옵션을 시각적으로 매력적인 방식으로 선택할 수 있도록 휠과 같은 인터페이스를 제공하는 사용자 정의 가능한 플러터 위젯입니다. 부드러운 회전과 광범위한 스타일링 옵션을 지원하여 양식, 설정 또는 상호작용 UI에 적합합니다. 주요 모든 플랫폼에서 사용 가능하며, 최소한의 설정으로 플러터 앱에 원활하게 통합됩니다. 패키지는 반응형 제스처와 애니메이션 전환을 통해 사용자 경험을 중시합니다.

사용 사례

  • 숫자 선택이 있는 폼 입력
  • 사용자 정의 숫자 선택기
  • 인터랙티브 앱 설정
  • 게임화된 사용자 인터페이스 요소
  • 시간 또는 날짜 선택기
  • 시각적 데이터 입력

주요 기능

  • 높은 사용자 정의 가능한 외관
  • 부드러운 휠 회전 애니메이션
  • 크로스 플랫폼 지원
  • 제스처 기반 스크롤
  • 풍부한 스타일 옵션
  • 반응형 터치 상호작용

적합한 대상

  • 독특한 입력 위젯을 찾는 개발자
  • 시각적 데이터 입력이 필요한 앱
  • 디자인 중심의 Flutter 프로젝트
  • 상호작용형 교육 도구
  • 값 선택이 있는 게임

고려 사항

  • 저사양 기기에서는 성능 최적화가 필요할 수 있습니다
  • 기본 사용법 외에 문서가 제한적
  • 사용자 정의는 코드 복잡성을 증가시킬 수 있습니다
  • 대규모 데이터 세트에 적합하지 않음
  • 스크롤 민감도를 신중하게 다뤄야 합니다
  • 작은에서 중간 규모의 값 범위에 적합

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Wheel Slider

A versatile and highly customizable slider widget for Flutter, with a wheel-like scrolling appearance.

pub package License: MIT

gif of wheel slider gif of wheel slider

Built on top of wheel_chooser for an enhanced experience.

✨ Features

  • 🔢 Number Display: Show numbers instead of simple lines.
  • ↔↕ Scroll Orientation: Horizontal and vertical scrolling options.
  • 📳 Haptic Feedback: Vibrates during scroll for a tactile experience.
  • 🔧 Custom Widgets: Fully customizable items and pointers.
  • 🖼️ Background Support: Add a widget as the slider's background.
  • 🎨 Styling Options: Easily customize line and pointer colors.

🚀 Getting Started

Installation

Add the following to your pubspec.yaml under dependencies:

  dependencies:
    wheel_slider:
Import
import 'package:wheel_slider/wheel_slider.dart';
Android Permissions

Add the vibration permission to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.VIBRATE"/>
IOS Compatibility

Supports vibration with duration and pattern on CoreHaptics devices. On older devices, the pattern is emulated with 500ms long vibrations.

📖 Usage

To use Line Slider:

WheelSlider(
    totalCount: _totalCount,
    initValue: _initValue,
    onValueChanged: (val) {
        setState(() {
          _currentValue = val;
        });
    },
    hapticFeedbackType: HapticFeedbackType.vibrate,
),

To use Line Slider with displaying double value:

WheelSlider(
    interval: 0.5,  // this field is used to show decimal/double values
    totalCount: _totalCount,
    initValue: _initValue,
    onValueChanged: (val) {
        setState(() {
          _currentValue = val;
        });
    },
    hapticFeedbackType: HapticFeedbackType.vibrate,
),

To use Number Slider:

WheelSlider.number(
    perspective: 0.01,
    totalCount: _nTotalCount,
    initValue: _nInitValue,
    unSelectedNumberStyle: const TextStyle(
        fontSize: 12.0,
        color: Colors.black54,
    ),
    currentIndex: _nCurrentValue,
    onValueChanged: (val) {
        setState(() {
          _nCurrentValue = val;
        });
    },
    hapticFeedbackType: HapticFeedbackType.heavyImpact,
),

To use Number Slider with displaying double value:

WheelSlider.number(
    interval: 0.5, // this field is used to show decimal/double values
    perspective: 0.01,
    totalCount: _nTotalCount,
    initValue: _nInitValue,
    unSelectedNumberStyle: const TextStyle(
        fontSize: 12.0,
        color: Colors.black54,
    ),
    currentIndex: _nCurrentValue,
    onValueChanged: (val) {
        setState(() {
          _nCurrentValue = val;
        });
    },
    hapticFeedbackType: HapticFeedbackType.heavyImpact,
),

To use Custom Widget Slider:

WheelSlider.customWidget(
    totalCount: 12,
    initValue: 5,
    isInfinite: false,
    scrollPhysics: const BouncingScrollPhysics(),
    children: List.generate(12, (index) => const Center(
        child: FlutterLogo(
            size: 100,
        ),
    )),
    onValueChanged: (val) {
        setState(() {
          _cCurrentValue = val;
        });
    },
    hapticFeedbackType: HapticFeedbackType.vibrate,
    showPointer: false,
    itemSize: 80,
),
🛠️ Properties
  • controller - A FixedExtentScrollController that allows you to manage and control the scroll position of the slider.
  • interval - To display decimal values. By default it is set to 1, when changed totalCount also to be updated accordingly.
  • currentIndex - Gets the current value as you scroll the Number Slider.
  • perspective - Change the way you want the slider to look from a flat to a wheel like shape and the value must be <= 0.01.
  • squeeze - Adjust the spacing between each item in the slider.
  • isVibrate - To turn on/off vibration while scrolling.
  • hapticFeedbackType - Allows you to change the vibration type.
  • itemSize - Size of each item in the slider.
  • background - Use any widget to add as a background to the slider.
  • allowPointerTappable:
    • When this is set to false scroll functionality won't work for the occupied region.
    • When using customPointer with GestureDetector/InkWell, set it to false to enable gestures.
    • When using default pointer set it to default state i.e true.

카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.