hyoeun-dev/simple_date_picker
3 種類のカーピュータースタイルの日付ピッカー
- Stars
- 2
- Forks
- 0
- 最終プッシュ(UTC)
- 2025/02/28
- プロジェクト状態
- 公開中
言語C++CCMakeDartSwiftHTMLKotlinObjective-C
使用している依存関係
依存関係一覧 3 件
- flutter
{"sdk":"flutter"} - flutter_test開発用
{"sdk":"flutter"} - flutter_lints開発用
^4.0.0
元の README
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
README を開く / 閉じる
Simple Date Picker
SHOWCASE
https://raw.githubusercontent.com/hashtag-mood/simple_date_picker/refs/heads/main/SHOWCASE.gifGETTING STARTED
Run the following command in your terminal to get started
$ flutter pub add simple_date_picker
USAGE
COMPLETE EXAMPLE is here
SET UP
Create an instance of SimpleDatePicker and define DateTimes for each picker
SimpleDatePicker simpleDatePicker = SimpleDatePicker();
DateTime yearMonthDayDateTime = DateTime.now();
DateTime yearMonthDateTime = DateTime.now();
DateTime yearDateTime = DateTime.now();
int firstYear = 1950;
int lastYear = 2050;
EXAMPLE
Align(
alignment: Alignment.center,
child: TextButton(
onPressed: () async {
await showCupertinoModalPopup(
context: context,
builder: (context) {
return simpleDatePicker.yearMonthDayPicker(
yearMonthDayDateTime: yearMonthDayDateTime,
monthCallback: (int index) {
setState(() {
yearMonthDayDateTime = DateTime(
yearMonthDayDateTime.year,
index + 1,
yearMonthDayDateTime.day);
});
},
dayCallback: (int index) {
setState(() {
yearMonthDayDateTime = DateTime(
yearMonthDayDateTime.year,
yearMonthDayDateTime.month,
index + 1);
});
},
yearCallback: (int index) {
setState(() {
yearMonthDayDateTime = DateTime(
firstYear + index,
yearMonthDayDateTime.month,
yearMonthDayDateTime.day);
});
},
firstYear: firstYear,
lastYear: lastYear,
);
},
);
},
child: Text(
'${yearMonthDayDateTime.year}년 ${yearMonthDayDateTime.month}월 ${yearMonthDayDateTime.day}일',
style: const TextStyle(
fontSize: 20,
color: Colors.black,
fontWeight: FontWeight.normal,
),
)),
);