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

month_picker_dialog のカバー
パッケージ詳細v6.7.3

month_picker_dialog

無限の年数リストから1つの月を選択するための国際化ダイアログ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
4.4万
いいね数
162
Pub ポイント
160

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

flutter pub add month_picker_dialog

パッケージ概要

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

無限の年数リストから1か月を選択するための国際化対応ダイアログを提供するFlutterパッケージです。複数プラットフォーム間でのスムーズな統合を目的としており、ローカリゼーションをサポートし、日付選択に向けた洗練された直感的なインターフェースを提供します。ダイアログは年間ナビゲーションを動的に処理し、Android、iOS、Web、macOS、Windows、Linuxでアクセシビリティと応答性を確保します。グローバル言語対応を備えた月単位の日付入力が必要なアプリケーションに最適です。

用途

  • フォームで月を選択する
  • 月別にデータをフィルタリングする
  • 月次設定の変更
  • 日付ベースのレポート
  • ユーザープロファイルのセットアップ
  • カレンダー関連の機能

主な機能

  • 国際化サポート
  • 無限の年間スクロール
  • クロスプラットフォーム互換性
  • ローカライズされたテキストとフォーマット
  • シンプルな API インテグレーション
  • レスポンシブデザイン

適している対象

  • 月の選択が必要なアプリ
  • 多言語ユーザーを対象としたグローバルアプリケーション
  • 日付を入力する必要のあるフォーム入力
  • 月別でのデータフィルタリング
  • 軽量な日付ピッカーを探している開発者

注意事項

  • 年だけの選択はサポートされていません
  • 1か月のみの選択に制限
  • 組み込みの検証なし
  • 選択された日付の手動処理が必要です
  • 月表示より大きなデータセットには最適化されていない

元の README

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

month_picker_dialog

Build Status pub package

Internationalized material style dialog for picking a single month from an infinite list of years. This package makes use of the intl package and flutter's i18n abilities to provide labels in all languages known to flutter.

Buy Me A Coffee

Setting up an internationalized app: the flutter localization package

LTR portrait

How to use it:

Just add:

showMonthPicker() to select a single month;

showMonthRangePicker() to select a range of months;

showYearPicker() to select only a year;

...inside your button function like a normal date picker dialog (context parameter is required):

Example:
FloatingActionButton(
    onPressed: () {
        showMonthPicker(
        context: context,
        initialDate: DateTime.now(),
        ).then((date) {
        if (date != null) {
            setState(() {
            selectedDate = date;
            });
        }
        });
    },
    child: Icon(Icons.calendar_today),
),

FloatingActionButton(
    onPressed: () {
        showMonthRangePicker(
        context: context,
        initialDate: DateTime.now(),
        rangeList: true,
        ).then((List<DateTime>? dates) {
        if (dates != null) {
            print(dates);
            print(dates.last.lastDayOfMonth());
        }
        });
    },
    child: Icon(Icons.calendar_today),
),

FloatingActionButton(
    onPressed: () {
        showYearPicker(
        context: context,
        initialDate: DateTime.now(),
        ).then((year) {
        if (year != null) {
            setState(() {
            selectedYear = year;
            });
        }
        });
    },
    child: Icon(Icons.calendar_today),
),

Migrating to 5.0:

Starting with version 5.0.0 of the package, everything related to the behavior/style of it that isn't a function, date parameter or custom widget is now under the new MonthPickerDialogSettings class.

It contains three subclasses:

PickerDialogSettings to customize the dialog part of the package;

PickerHeaderSettings to customize the header part of the package;

PickerButtonsSettings to customize the buttons part of the package;

And will be used like this:

FloatingActionButton(
    onPressed: () {
        showMonthPicker(
        context: context,
        initialDate: DateTime.now(),
        monthPickerDialogSettings: const MonthPickerDialogSettings(
            headerSettings: PickerHeaderSettings(
                headerCurrentPageTextStyle: TextStyle(fontSize: 14),
                headerSelectedIntervalTextStyle: TextStyle(fontSize: 16),
            ),
            dialogSettings: PickerDialogSettings(
                locale: const Locale('en'),
                dialogRoundedCornersRadius: 20,
                dialogBackgroundColor: Colors.blueGrey[50],
            ),
            buttonsSettings: PickerButtonsSettings(
                buttonBorder: const RoundedRectangleBorder(),
                selectedMonthBackgroundColor: Colors.amber[900],
                selectedMonthTextColor: Colors.white,
                unselectedMonthsTextColor: Colors.black,
                currentMonthTextColor: Colors.green,
                yearTextStyle: const TextStyle(
                    fontSize: 10,
                ),
                monthTextStyle: const TextStyle(
                    fontWeight: FontWeight.bold,
                    fontSize: 18,
                ),
            ),
        ),
        ).then((date) {
        if (date != null) {
            setState(() {
            selectedDate = date;
            });
        }
        });
    },
    child: Icon(Icons.calendar_today),
),

If you have any doubts on how to use this new settings class (that the sample app can't solve), please feel free to open an issue on the github project.

Contributors:

Gian Bettega

Dimitri Krivoj (the original creator of the package)

Fabio Henrique

Leon Colt

Wesley Gonzaga

Efrain Bastidas

Volodymyr Hyrka

Bern

just1982

Sagar Zala

Pong Loong Yeat

Masayuki Ono

Alecsplus

Lautaro Zanuttini

sinelser

sheldontuitt

nomoruyi

gabrielezereik

roth-arasys

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

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