パッケージ、リポジトリ、アプリカテゴリを検索

wheel_slider のカバー
パッケージ詳細v1.2.2

wheel_slider

Wheel Slider は、多くのカスタマイズオプションを提供し、ホイールのような外観でスクロールできるようにします。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
6990
いいね数
133
Pub ポイント
150

パッケージをインストール

flutter pub add wheel_slider

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Wheel Slider は、数値やオプションを視覚的に魅力的な方法で選択するための、ホイールのようなインターフェースを提供するカスタマイズ可能な Flutter ウィジェットです。スムーズな回転と豊富なスタイルオプションをサポートしており、フォーム、設定、インタラクティブUIに適しています。すべての主要プラットフォームで利用可能で、最小限のセットアップでFlutterアプリにシームレスに統合できます。パッケージは、応答性のあるジェスチャーとアニメーション遷移を通じてユーザー体験を重視しています。

用途

  • 数値選択付きのフォーム入力
  • カスタム数値ピッカー
  • インタラクティブなアプリ設定
  • ゲーム化された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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。