date_picker_pro 0.0.3
date_picker_pro: ^0.0.3 copied to clipboard
date_picker_pro,Provide date range select,More will be provided in the future
date_picker_pro
date_picker_pro,Provide date range select,More will be provided in the future
Usage • Issues and Feedback • License
Feedback welcome and Pull Requests are most welcome!
English | 中文
Usage #
Import the package #
To use this package, follow the pub.dev-date_picker_pro.
How to use #
Add the following import to your Dart code:
import 'package:date_picker_pro/date_picker.dart';
DateRangePicker(
controller: dateRangePickerController,
initialDateRange: DateTimeRange(
start: DateTime(2024,8,1),
end: DateTime(2024,8,30),
),
firstDate: DateTime(2023),
lastDate: DateTime(2025),
intervalColor: Colors.blueGrey.shade50,
selectedColor: Colors.blue,
selectedTextColor: Colors.white,
enableTextColor: Colors.black,
disableTextColor: Colors.grey,
selectedShape: BoxShape.rectangle,
monthHeaderItemHeight: 40,
monthHeaderColor: Colors.grey.shade300,
backgroundColor: Colors.white,
monthTextStyle: const TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.normal,
),
onDateTimeRangeChanged: (DateTimeRange? dateTimeRange) {
debugPrint('$dateTimeRange');
},
)
| API | description |
|---|---|
| controller | Controller |
| initialDateRange controller.setInitialDateRange() |
Initialize the selected range |
| firstDate | The first date that can be selected |
| lastDate | The last date that can be selected |
| intervalColor controller.setIntervalColor() |
The color of the selected range's interval |
| selectedColor controller.setSelectedColor() |
Selected date color |
| selectedTextColor controller.setSelectedTextColor() |
The text color of the selected date |
| enableTextColor controller.setEnableTextColor() |
The text color of selectable dates |
| disableTextColor controller.setDisableTextColor() |
The text color of dates that cannot be selected |
| selectedShape controller.setSelectedShape() |
Select the shape of the date |
| onDateTimeRangeChanged | Date range selection callback |
| monthTextStyle controller.setMonthTextStyle() |
Set month text style |
| monthHeaderColor controller.setMonthHeaderColor() |
Set the background color for the head of the month |
| monthHeaderItemHeight controller.setMonthHeaderItemHeight() |
Set the head height of the month |
| backgroundColor controller.setBackgroundColor() |
Set background color |
| controller.reset() | Reset the selected date range |
| controller.getDateTimeRange() | get the selected date range, return null if not selected |
Sample(Source Code)
https://github.com/user-attachments/assets/3abd3861-6ea9-4875-aac5-1a44d9b529b2
Issues and Feedback #
Please file issues to send feedback or report a bug. Thank you !
License #
MIT