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

month_year_picker のカバー
パッケージ詳細v0.5.0+1

month_year_picker

Flutterの日付ピッカーのデザインを参考にした月年選択器。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
23
いいね数
92
Pub ポイント
160

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

flutter pub add month_year_picker

パッケージ概要

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

Flutter のネイティブの日付ピッカーのデザインを参考にした、月と年を選択できるウィジェットを提供する Flutter パッケージです。ユーザーは洗練された直感的なインターフェースで特定の月と年を選択でき、日単位の精度が不要なフォームに最適です。このピッカーは完全にカスタマイズ可能で、Android、iOS、Web、macOS、Windows、Linux を含むすべての主要プラットフォームをサポートしています。Flutter の Material および Cupertino テーマを意識して作成されており、デバイス間で一貫した UI を実現します。

用途

  • 誕生月と年を指定する
  • 月と年でデータをフィルタリングする
  • 記念日を設定する
  • サブスクリプションの開始日を設定する
  • 卒業年度に入ること

主な機能

  • Material および Cupertino テーマのサポート
  • クロスプラットフォーム互換性
  • カスタマイズ可能な外観
  • シンプルな API インテグレーション
  • スムーズなアニメーション
  • 外部ライブラリへの依存性なし

適している対象

  • 月/年を選択する必要があるフォーム入力
  • カレンダーに基づくアプリケーション
  • ユーザープロファイル設定フロー
  • データフィルタリングインターフェース
  • 日付関連機能を備えたモバイルおよびウェブアプリ

注意事項

  • 日付選択は含まれません
  • 月と年のみに制限
  • 日付フォーマットの手動処理が必要
  • 正確な日付範囲には適していません
  • ビジネスロジックの追加検証が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Material Month/Year Picker

Pub GitHub Workflow Status

The month year picker inspired by the Flutter's date picker design.

Quick Start

  1. Open your pubspec.yaml file and add this entry:

    month_year_picker: ^0.5.0+1
    

    OR just run flutter pub add month_year_picker using your preferred terminal app.

  2. Then run flutter pub get.

  3. Import this library into your code:

    import 'package:month_year_picker/month_year_picker.dart';
    

    Additionally, ensure your MaterialApp refers to the following localizationsDelegates:

        GlobalMaterialLocalizations.delegate,
        MonthYearPickerLocalizations.delegate,
    
  4. Usage in code:

    final selected = await showMonthYearPicker(
      context: context,
      initialDate: DateTime.now(),
      firstDate: DateTime(2019),
      lastDate: DateTime(2023),
    );
    

Parameters

Parameter Description
context Must not be null. Will be passed to the internal showDialog function call.
initialDate Must not be null and must fall between the firstDate and lastDate. The initialDate will be truncated to its year and month components. When the month/year picker is first displayed, it will show the month/year of the initialDate, with initialDate selected.
firstDate Must not be null. The firstDate will be truncated to its year and month components. This is the earliest allowable month/year.
lastDate Must not be null. The lastDate will be truncated to its year and month components. This is the latest allowable month/year.
selectableMonthYearPredicate Can be null. The function to provide full control over which month/year can be selected. If provided, only the month/year that the selectableMonthYearPredicate returns true for will be selectable.
locale Can be null. If provided, will be used to set the locale for the month/year picker. Otherwise, it defaults to the ambient locale provided by Localizations.
useRootNavigator Can be null. Will be passed to the internal showDialog function call.
routeSettings Can be null. Will be passed to the internal showDialog function call.
textDirection Can be null. If provided, will be used to set the text direction for the month/year picker. Otherwise, it defaults to the ambient locale provided by Directionality.
builder Can be null. This parameter can be used to wrap the dialog widget with a parent widget.
initialMonthYearPickerMode Must not be null. Can be used to have the year picker initially appear in the MonthYearPickerMode.year mode. It defaults to the MonthYearPickerMode.month mode.

Screenshots

Mode Screenshot
Month picker in portrait mode with default locale.
Year picker in portrait mode with default locale.
Month picker in portrait mode with Malay locale.
Year picker in portrait mode with Malay locale.
Month picker in portrait mode with Arabic locale.
Year picker in portrait mode with Arabic locale.
Month picker in landscape mode with default locale.
Year picker in landscape mode with default locale.
Month picker in landscape mode with Malay locale.
Year picker in landscape mode with Malay locale.
Month picker in landscape mode with Arabic locale.
Year picker in landscape mode with Arabic locale.

Building From Source

Dependencies
  1. Dart SDK version 3.8.0 or newer.
  2. Flutter SDK version 3.32 or newer.
Steps
  1. Clone this git repo into your machine.
  2. Run .\gen-l10n.ps1 to re-generate the localised strings.

Features and Bugs

Please file feature requests and bugs at the issue tracker.

License

This project is licensed under the MIT License - see the LICENSE file for details.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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