flutter date time picker
a flutter date time picker inspired by flutter-cupertino-date-picker.
you can choose date / time / date&time in english, dutch, chinese and russian
and you can also custom your own picker content.
date picker | time picker | date time picker |
---|---|---|
international:
date time picker (chinese) | date time picker (america) | date time picker (dutch) | date time picker (russian) |
---|---|---|---|
usage
flatbutton(
onpressed: () {
datepicker.showdatepicker(context,
showtitleactions: true,
mintime: datetime(2018, 3, 5),
maxtime: datetime(2019, 6, 7), onchanged: (date) {
print('change $date');
}, onconfirm: (date) {
print('confirm $date');
}, currenttime: datetime.now(), locale: localetype.zh);
},
child: text(
'show date time picker (chinese)',
style: textstyle(color: colors.blue),
));
custom
if you want to customize your own style of date time picker, there is a class called commonpickermodel, every type of date time picker is extended from this class, you can refer to other picker model (eg. datepickermodel), and write your custom one, then pass this model to showpicker method, so that your own date time picker will appear, it’s easy, and will perfectly meet your demand
Comments are closed.