vph_web_date_picker 0.0.5
vph_web_date_picker: ^0.0.5 copied to clipboard
Flutter date picker package for web application. The date picker is displayed as dropdown
Flutter date picker package for web application #
Showcase #
Usage #
final textFieldKey = GlobalKey();
...
TextField(
key: textFieldKey,
controller: _controller,
onTap: () async {
final pickedDate = await showWebDatePicker(
context: textFieldKey.currentContext!,
initialDate: _selectedDate,
firstDate: DateTime.now().subtract(const Duration(days: 7)),
lastDate: DateTime.now().add(const Duration(days: 14000)),
//width: 300,
//withoutActionButtons: true,
//weekendDaysColor: Colors.red,
);
if (pickedDate != null) {
_selectedDate = pickedDate;
_controller.text = pickedDate.toString();
}
},
),
...
showWebDatePicker shows a dialog containing a date picker.
The returned Future resolves to the date selected by the user when the
user confirms the dialog. If the user cancels the dialog, null is returned.
When the date picker is first displayed, it will show the month of
initialDate, with initialDate selected.
The firstDate is the earliest allowable date. The lastDate is the latest
allowable date. initialDate must either fall between these dates,
or be equal to one of them
The width define the width of date picker dialog
The month view action buttons include:
- Reset button: jump to
initialDateand select it - Today button: jump to today and select it
The withoutActionButtons is true, the action buttons are removed from the month view. Default is false
The weekendDaysColor define the color of weekend days Saturday and Sunday. Default is null