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

패키지 상세v1.6.0

flutter_picker_plus

NumberPicker, DateTimePicker, ArrayPicker 및 기본 연결 Picker를 사용하여 다양한 요구 사항을 충족시키기 위한 유연한 매개변수를 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.2만
좋아요
63
Pub 점수
160

패키지 설치

flutter pub add flutter_picker_plus

패키지 개요

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

Flutter Picker Plus는 사용자 정의 가능한 NumberPicker, DateTimePicker, ArrayPicker 및 연결형 피커 기능을 제공하는 유연한 피커 라이브러리입니다. 다양한 구성 옵션을 지원하여 다양한 플랫폼에서 다양한 UI 요구 사항을 충족할 수 있도록 설계되었습니다. Android, iOS, Web, macOS, Windows, Linux에서 원활하게 통합되어 개발자가 최소한의 노력으로 동적이고 상호작용적인 선택 인터페이스를 만들 수 있게 해줍니다. 이 패키지는 다양한 데이터 유형과 사용 사례에 맞게 최적화된 부드럽고 반응성이 뛰어난 피커를 제공함으로써 사용자 경험을 향상시킵니다.

사용 사례

  • 숫자 값이 포함된 폼 입력
  • 앱에서 날짜 및 시간 선택
  • 배열 옵션을 가진 사용자 정의 드롭다운
  • 다중 레벨 링크 선택
  • 동적 폼 빌더
  • 사용자 선호 설정

주요 기능

  • 여러 가지 피커 유형을 지원합니다
  • 중첩 선택을 위한 구성 가능한 연결
  • 크로스 플랫폼 호환성
  • 확장 가능한 사용자 정의 옵션
  • 부드러운 애니메이션
  • 반응형 디자인

적합한 대상

  • 복잡한 입력 요구 사항을 가진 폼을 개발하는 개발자
  • 날짜/시간 선택기 필요 앱
  • 사용자 정의 선택 컴포넌트를 갖춘 UI 중심 애플리케이션
  • 크로스 플랫폼 Flutter 프로젝트
  • 재사용 가능한 피커 솔루션을 찾는 팀

고려 사항

  • Flutter 상태 관리에 대한 이해가 필요합니다
  • 일관된 외관을 위해 추가적인 스타일링이 필요할 수 있습니다
  • 기본 예제 외에 문서가 제한적
  • 대규모 데이터 세트와 함께 가능한 성능 영향
  • 간단한 단일 값 선택에 적합하지 않음

원본 README

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

flutter_picker_plus

pub package License

A powerful and customizable picker widget for Flutter applications. Continuation of the popular flutter_picker package with enhanced features and modern Flutter support.

Picker Demo

✨ Features

  • 🎯 Multiple Picker Types: Number, DateTime, Array, and custom data pickers
  • 🌐 Internationalization: Support for 20+ languages including RTL languages
  • 🎨 Highly Customizable: Flexible styling, colors, and layouts
  • 🔗 Linkage Support: Create dependent picker columns
  • 📱 Multiple Display Modes: Modal, dialog, and embedded pickers
  • 🎭 Custom Adapters: Extend functionality with your own data adapters
  • 🛡️ Null Safety: Full null safety support
  • ⚡ Performance Optimized: Handles large datasets efficiently

🚀 Installation

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_picker_plus: ^1.5.6

📋 Requirements

  • Flutter: 3.32.0 or higher
  • Dart: 3.0.0 or higher

For Flutter version history and migration guides, see the Flutter Release Notes.

🌍 Supported Languages

Arabic • Bengali • Chinese • English • French • German • Greek • Hindi • Indonesian • Italian • Japanese • Korean • Portuguese • Romanian • Russian • Spanish • Turkish • Urdu • Javanese • Vietnamese • Slovenian

Supporting 20+ languages including the most widely spoken languages worldwide.

📖 Quick Start

Basic String Picker
import 'package:flutter_picker_plus/flutter_picker_plus.dart';

void showBasicPicker(BuildContext context) {
  Picker(
    adapter: PickerDataAdapter<String>(
      pickerData: ['Option 1', 'Option 2', 'Option 3']
    ),
    title: const Text('Select an Option'),
    onConfirm: (Picker picker, List<int> value) {
      print('Selected: ${picker.getSelectedValues()}');
    },
  ).showModal(context);
}
Number Picker
void showNumberPicker(BuildContext context) {
  Picker(
    adapter: NumberPickerAdapter(data: [
      const NumberPickerColumn(begin: 0, end: 100, jump: 5),
      const NumberPickerColumn(begin: 0, end: 60),
    ]),
    delimiter: [
      PickerDelimiter(
        child: Container(
          width: 30.0,
          alignment: Alignment.center,
          child: const Text(':'),
        ),
        column: 1,
      ),
    ],
    title: const Text('Select Time'),
    onConfirm: (Picker picker, List<int> value) {
      print('Selected: ${picker.getSelectedValues()}');
    },
  ).showModal(context);
}
Date Time Picker
void showDateTimePicker(BuildContext context) {
  Picker(
    adapter: DateTimePickerAdapter(
      type: PickerDateTimeType.kYMDHM,
      value: DateTime.now(),
      minValue: DateTime(1950),
      maxValue: DateTime(2050),
    ),
    title: const Text('Select Date & Time'),
    onConfirm: (Picker picker, List<int> value) {
      final dateTime = (picker.adapter as DateTimePickerAdapter).value;
      print('Selected: $dateTime');
    },
  ).showModal(context);
}

🎛️ Advanced Usage

Multi-Column Array Picker
void showArrayPicker(BuildContext context) {
  Picker(
    adapter: PickerDataAdapter<String>(
      pickerData: [
        ['Morning', 'Afternoon', 'Evening'],
        ['Coffee', 'Tea', 'Juice'],
        ['Small', 'Medium', 'Large'],
      ],
      isArray: true,
    ),
    title: const Text('Customize Your Order'),
    onConfirm: (Picker picker, List<int> value) {
      print('Selected: ${picker.getSelectedValues()}');
    },
  ).showModal(context);
}
Hierarchical (Linkage) Picker
void showLinkagePicker(BuildContext context) {
  final data = {
    'Fruits': {
      'Citrus': ['Orange', 'Lemon', 'Lime'],
      'Berries': ['Strawberry', 'Blueberry', 'Raspberry'],
    },
    'Vegetables': {
      'Root': ['Carrot', 'Potato', 'Onion'],
      'Leafy': ['Lettuce', 'Spinach', 'Kale'],
    },
  };

  Picker(
    adapter: PickerDataAdapter<String>(pickerData: [data]),
    title: const Text('Select Food Category'),
    onConfirm: (Picker picker, List<int> value) {
      print('Selected: ${picker.getSelectedValues()}');
    },
  ).showModal(context);
}
Custom Styling
void showStyledPicker(BuildContext context) {
  Picker(
    adapter: PickerDataAdapter<String>(
      pickerData: ['Red', 'Green', 'Blue', 'Yellow'],
    ),
    backgroundColor: Colors.grey.shade100,
    headerColor: Colors.blue,
    containerColor: Colors.white,
    textStyle: const TextStyle(color: Colors.black87, fontSize: 18),
    cancelTextStyle: const TextStyle(color: Colors.red),
    confirmTextStyle: const TextStyle(color: Colors.blue),
    itemExtent: 50.0,
    diameterRatio: 2.0,
    title: const Text('Pick a Color'),
    onConfirm: (Picker picker, List<int> value) {
      print('Selected: ${picker.getSelectedValues()}');
    },
  ).showModal(context);
}

🔧 API Reference

Picker Class
Property Type Description
adapter PickerAdapter Data adapter for the picker
title Widget? Title widget displayed at the top
cancelText String? Cancel button text (default: localized)
confirmText String? Confirm button text (default: localized)
backgroundColor Color? Background color of the picker
headerColor Color? Header background color
textStyle TextStyle? Style for picker items
hideHeader bool Hide the header buttons (default: false)
delimiter List<PickerDelimiter>? Delimiters between columns
Available Adapters
  • PickerDataAdapter: For string/custom data
  • NumberPickerAdapter: For numeric ranges
  • DateTimePickerAdapter: For date and time selection
Display Methods
  • showModal(context): Show as modal bottom sheet
  • showDialog(context): Show as dialog
  • show(state): Show with custom state (deprecated)
  • makePicker(): Return picker widget for embedding

🎨 Customization Options

Localization

The picker automatically adapts to your app's locale. You can also register custom languages:

PickerLocalizations.registerCustomLanguage(
  'custom',
  cancelText: 'Cancel',
  confirmText: 'OK',
  ampm: ['AM', 'PM'],
  months: ['Jan', 'Feb', 'Mar', /* ... */],
);
Custom Item Builder
Picker(
  adapter: adapter,
  itemBuilder: (context, text, child, selected, column, index) {
    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 16.0),
      decoration: BoxDecoration(
        color: selected ? Colors.blue.shade100 : null,
        borderRadius: BorderRadius.circular(8.0),
      ),
      child: child,
    );
  },
  // ... other properties
)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📄 License

This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.

🙏 Acknowledgments

This package is a continuation of the original flutter_picker package with additional features and improvements.


For more examples and detailed documentation, check out the example app.

카테고리

의존성

의존성 목록 2 개

소스 저장소

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