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

day_month_picker 封面
套件詳情v1.0.3

day_month_picker

使用此套件輕鬆選擇您想要的月份和日期!從選取器中挑選簡單的日期選擇流程——不需要選擇年份。享受吧!

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
103
喜歡數
29
Pub 分數
150

安裝套件

flutter pub add day_month_picker

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,讓使用者能輕鬆選擇日期中的日與月,無需選擇年份。它提供簡單直覺的日期選擇介面,非常適合生日、紀念日或僅需關注月份與日期的活動排程情境。此選擇器輕量級,支援 Android、iOS、Web、macOS、Windows 與 Linux 等多個平台。設計簡潔,易於整合,僅需少量設定即可大幅提升使用者體驗。

適用情境

  • 生日選擇
  • 週年紀念規劃
  • 事件日期輸入
  • 每月提醒
  • 簡單日期輸入

主要特色

  • 無需選擇年份
  • 跨平台支援
  • 最小設定
  • 直覺的使用者介面
  • 輕量級設計

適合對象

  • 簡單日期格式
  • 使用者引導流程
  • 生日選擇器
  • 非年度特定日期
  • 行動與網頁應用程式

使用建議

  • 不包含年份選擇
  • 僅限日和月
  • 不適合用於完整日期驗證
  • 需要手動處理日期邏輯
  • 未提及本地化支援

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Day Month Picker or You can say Date Month picker

The DayMonthPicker widget is a customizable Flutter component that allows users to select a specific day and month from a dialog interface. It is particularly useful in forms or applications where date input is needed without year.

Features

Easy selection of months and days Customizable appearance Built-in support for existing day and month values Callback function to handle changes

Constructor

const DayMonthPicker({
  Key? key,
  this.surfaceTintColor,
  this.titleTextStyle,
  this.selectedMonthBgColor = Colors.blue,
  this.unSelectedMonthBgColor = Colors.white,
  this.selectedDayBgColor = Colors.blue,
  this.unSelectedDayBgColor = Colors.white,
  this.title = "Date Month Picker",
  this.selectedMonthTextStyle = const TextStyle(color: Colors.white, fontSize: 14),
  this.unSelectedMonthTextStyle = const TextStyle(color: Colors.black, fontSize: 14),
  this.selectedDayTextStyle = const TextStyle(color: Colors.white, fontSize: 12),
  this.unSelectedDayTextStyle = const TextStyle(color: Colors.black, fontSize: 12),
  this.child = const Padding(
    padding: EdgeInsets.all(8.0),
    child: Text("Month Picker"),
  ),
  this.cancelTextStyle = const TextStyle(color: Colors.grey, fontSize: 16),
  this.okTextStyle = const TextStyle(color: Colors.blue, fontSize: 16),
  this.existingDay,
  this.existingMonth,
  required this.onChange,
});

Parameters

  • key: An optional key to identify the widget.
  • surfaceTintColor: A color to tint the dialog surface (default is transparent).
  • titleTextStyle: Text style for the dialog title.
  • selectedMonthBgColor: Background color for the selected month (default is blue).
  • unSelectedMonthBgColor: Background color for unselected months (default is white).
  • selectedDayBgColor: Background color for the selected day (default is blue).
  • unSelectedDayBgColor: Background color for unselected days (default is white).
  • title: The title of the dialog (default is "Date Month Picker").
  • selectedMonthTextStyle: Text style for the selected month label.
  • unSelectedMonthTextStyle: Text style for unselected month labels.
  • selectedDayTextStyle: Text style for the selected day label.
  • unSelectedDayTextStyle: Text style for unselected day labels.
  • child: The widget displayed as the button to open the picker (default is a padded "Month Picker" text).
  • cancelTextStyle: Text style for the cancel button.
  • okTextStyle: Text style for the ok button.
  • existingDay: An optional string representing the already selected day.
  • existingMonth: An optional string representing the already selected month.
  • onChange: A required callback function that is triggered when the user selects a day and month.

Usage

Short and useful examples for package users.

DayMonthPicker(onChange: (DayMonth? dayMonth){
        if(dayMonth != null) {
          print("Day: ${dayMonth.day}");
          print("Month: ${dayMonth.month}");
        }
      }),

Example

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: Text('Day Month Picker Example')),
    body: Center(
      child: DayMonthPicker(
        onChange: (dayMonth) {
          // Do something with the selected day and month
          print('Selected Day: ${dayMonth.day}, Month: ${dayMonth.month}');
        },
      ),
    ),
  );
}

Some UI examples

Day Month Picker Example

Day Month Picker Example image (7)

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。