पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

wheel_picker कवर
पैकेज विवरणv0.4.0

wheel_picker

इनपुट व्हील का उपयोग करके मान/समय चयन करने वाला विजेट। कस्टमाइज़ेबल और हल्का भारी।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
12.3 हज़ार
लाइक
83
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add wheel_picker

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक हल्का और कस्टमाइज़ किया जा सकने वाला फ्लटर विजेट जो मूल्य या समय के चयन के लिए व्हील-आधारित पिकर को लागू करता है। मूल स्पिनर्स से प्रेरित, यह प्लेटफॉर्म के आसपास चिकनी स्क्रॉलिंग और सहज इंटरैक्शन प्रदान करता है। तारीख, समय या अलग-अलग मूल्य चयन की आवश्यकता वाले फॉर्म्स के लिए आदर्श। पैकेज को दक्षता और आसान एकीकरण के लिए डिज़ाइन किया गया है, जो Android, iOS, Web, macOS, Windows और Linux को समर्थित करता है। यह बिना किसी महत्वपूर्ण ओवरहेड के छवि और व्यवहार को कस्टमाइज़ करने के लिए साफ एपीआई प्रदान करता है।

उपयोग

  • अलग-अलग विकल्पों वाले फॉर्म इनपुट
  • समय चयन इंटरफेस
  • कस्टम संख्यात्मक या ड्रॉपडाउन पिकर्स
  • दृश्य प्रतिक्रिया के साथ डेटा एंट्री
  • बहु-चक्की मूल्य चयन

मुख्य विशेषताएँ

  • स्मूथ स्क्रॉल एनिमेशन
  • क्रॉस-प्लेटफॉर्म संगतता
  • कस्टमाइज़ेबल दिखावट
  • हल्का प्रदर्शन
  • फॉर्म फ़ील्ड्स के साथ आसान एकीकरण
  • कॉन्फ़िगरेबल आइटम स्पेसिंग और आकार

इनके लिए उपयुक्त

  • फॉर्म-भारी एप्लिकेशन बनाने वाले डेवलपर्स
  • मूल जैसे पिकर की आवश्यकता वाले UI डिज़ाइनर
  • समय या मूल्य चयन की आवश्यकता वाले ऐप
  • न्यूनतम बंडल आकार को प्राथमिकता देने वाले परियोजनाएँ
  • बहुप्लेटफॉर्म लक्षित करने वाली टीमें

विचार योग्य बातें

  • सीमित आंतरिक सत्यापन
  • स्वचालित कीबोर्ड एकीकरण नहीं
  • चयन घटनाओं को हस्तक्षेप से संभालने की आवश्यकता है
  • बहुत बड़े डेटासेट के लिए अनअनुकूलित
  • डार्क मोड के लिए अतिरिक्त स्टाइलिंग की आवश्यकता हो सकती है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Wheel Picker

A superset version of original ListWheelScrollView for easily creating wheel scroll input.

Flutter Pub

Left Gif Right Gif

Key Features

  • Item Selection: Retrieve the selected item index effortlessly.
  • Highlight Selection: Highlight selected items with a color shader.
  • Tap Navigation: Enable tap scrolls.
  • Horizontal Scroll Direction: Horizontal wheel scroll view.
  • Styling Flexibility: Customize wheel appearance with WheelPickerStyle.
  • Precise Control: Manage and synchronize WheelPicker widgets with a WheelPickerController.
  • Mounting Controllers: Easily integrate and shift multiple controllers.

Installing

Add it to your pubspec.yaml file:

dependencies:
  wheel_picker: ^0.3.0

Install packages from the command line:

flutter packages get

Usage

To use package, just import package import 'package:wheel_picker/wheel_picker.dart';

Example

Here's a quick example to get you started:

const daysOfWeek = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
return WheelPicker(
  itemCount: 7,
  builder: (context, index) => Text(daysOfWeek[index]),
  selectedIndexColor: Colors.orange,
  looping: false,
);
Basic (Left Gif)

For more control, you can attach a controller and adjust it to your liking:

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:wheel_picker/wheel_picker.dart';

class WheelPickerExample extends StatelessWidget {
  const WheelPickerExample({super.key});

  @override
  Widget build(BuildContext context) {
    final secondsWheel = WheelPickerController(itemCount: 10);
    const textStyle = TextStyle(fontSize: 32.0, height: 1.5);

    Timer.periodic(const Duration(seconds: 1), (_) => secondsWheel.shiftDown());

    return WheelPicker(
      builder: (context, index) => Text("$index", style: textStyle),
      controller: secondsWheel,
      selectedIndexColor: Colors.blue,
      onIndexChanged: (index, interactionType) => print("On index $index"),
      style: WheelPickerStyle(
        itemExtent: textStyle.fontSize! * textStyle.height!, // Text height
        squeeze: 1.25,
        diameterRatio: .8,
        surroundingOpacity: .25,
        magnification: 1.2,
      ),
    );
  }
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Example',
      home: Scaffold(
        body: Center(
          child: WheelPickerExample(),
        ),
      ),
    );
  }
}

void main() => runApp(const MyApp());

Note: This works for this short example but don't forget to manually dispose controllers you initialize youself.

Advanced (Right Gif)

For more advanced usage, you can also mount controllers, making them shift each other. See example.

Example: Listening for the scroll end event
const daysOfWeek = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];

return NotificationListener(
  onNotification: (notification) {
    if (notification is ScrollEndNotification) {
      print('User has ended scrolling');
    }
    return false;
  },
  child: WheelPicker(
    itemCount: 7,
    builder: (context, index) => Text(daysOfWeek[index]),
    selectedIndexColor: Colors.orange,
    looping: false,
  ),
);


Feel free to share your feedback, suggestions, or contribute to this package :handshake:.

If you like this package, consider supporting it by giving it a star on GitHub and a like on pub.dev :heart:.

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।