搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫ccprogrammer/create-date-picker

建立日期選擇器

ccprogrammer/create-date-picker open-source repository details.

建立日期選擇器 專案封面
星標
1
分支
1
最近推送(UTC)
2025年4月5日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

CreateDatePicker Package

The CreateDatePicker package enables you to create a fully customizable date picker. You can create your own component without worrying about the functionality and place it anywhere to match your design

The example app running in Browser

Table of Contents

Integration Steps

To integrate the package into your Flutter application is very easy, you just need to add the Widget and customize every component and place it anywhere with the builder property:

    CreateDatePicker(
            width: 450,
            initialViewState: ViewState.date,
            initialDate: DateTime(2027, 6, 2),
            minDateTime: DateTime(2024, 5, 1),
            maxDateTime: DateTime(2029, 5, 1),
            restrictedDates: restrictedDates,
            weekLabels: weekLabels,
            monthLabels: monthLabels,
            leftArrowBuilder: _leftArrowBuilder,
            rightArrowBuilder: _rightArrowBuilder,
            dateViewButtonBuilder: _dateViewButtonBuilder,
            monthViewButtonBuilder: _monthViewButtonBuilder,
            yearViewButtonBuilder: _yearViewButtonBuilder,
            weekdayCellBuilder: _weekdayCellBuilder,
            dateCellBuilder: _dateCellBuilder,
            monthCellBuilder: _monthCellBuilder,
            yearCellBuilder: _yearCellBuilder,
            onViewStateChanged: _changeViewState,
            onSelectedDateChanged: _onSelectedDateChanged,
            builder: _createDatePickerBuilder,
        ),

NOTE: To place all the component together and anywhere, use builder property.

Available Parameters in CreateDatePicker
  • initialViewState: The initial view state of the picker (date, month, or year).

  • initialDate: The initially selected date.

  • minDateTime: The minimum selectable date.

  • maxDateTime: The maximum selectable date.

  • restrictedDates: A list of dates that cannot be selected.

  • weekLabels: Labels for the days of the week (e.g., Sunday, Monday). Must contain exactly 7 items.

  • monthLabels: Labels for the months of the year (e.g., January, February). Must contain exactly 12 items.

  • width: The width of the picker.

  • elevation: Sets the default elevation of the date picker.

  • popupMenuOffset: Offset for the popup menu.

  • popupMenuPosition: Position of the popup menu (above or below the trigger).

  • builder: Custom builder for the entire picker. Allows placing and customizing components using individual builders.

  • leftArrowBuilder: Custom builder for the left navigation arrow.

  • rightArrowBuilder: Custom builder for the right navigation arrow.

  • popupSelectedDateBuilder: Custom builder for the popup displaying the selected date.

  • dateViewButtonBuilder: Custom builder for the button to switch to the date view.

  • monthViewButtonBuilder: Custom builder for the button to switch to the month view.

  • yearViewButtonBuilder: Custom builder for the button to switch to the year view.

  • weekdayCellBuilder: Custom builder for the weekday cells.

  • dateCellBuilder: Custom builder for the date cells.

  • monthCellBuilder: Custom builder for the month cells.

  • yearCellBuilder: Custom builder for the year cells.

  • onViewStateChanged: Callback triggered when the view state changes.

  • onSelectedDateChanged: Callback triggered when the selected date changes.

Upcoming Updates

Currently, the package is only for a single datetime picker. Support for multiple pickers will be coming soon.

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.

License

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

Support Me

If you find this package helpful and want to support its development, consider making a donation. Thank you for your support!

Support via PayPal

Lubianca Samora GitHub avatar
GitHub 作者

Lubianca Samora ↗

Addicted to code something

語言DartC++CMakeSwiftCHTMLKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項

  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^5.0.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗