Cupertino-style date picker CupertinoDatePicker

CupertinoDatePicker ( 
  MODE: CupertinoDatePickerMode.date, // date and time mode, this mode date 
  onDateTimeChanged: (dateTime) { // called when a method of changing the date 
    IF (dateTime == null ) {
       return ; 
    } 
    Print ( 'currently selected : $ {dateTime.year} in $ {dateTime.month} $ {dateTime.day} May day ' ); 
  }, 
  initialDateTime: DateTime.Now (), // date and time when initializing show 
  minimumYear: 2018, // minimum year, when the date is valid only mode 
  maximumYear: 2019, // maximum year, only mode is effective date 
), 
 
CupertinoDatePicker ( 
  mode: CupertinoDatePickerMode.dateAndTime, //Datetime mode, this date and time pattern 
  onDateTimeChanged: (dateTime) {
     IF (dateTime == null ) {
       return ; 
    } 
    Print ( 'currently selected: $ {dateTime.year} in $ {dateTime.month} $ months date $ {dateTime.day} when {dateTime.hour} $ {dateTime.minute} $ {dateTime.second} second points' ); 
  }, 
  initialDateTime: DateTime.Now (), 
  minimumDate: DateTime.Parse ( "20,181,109") , // minimum date and time, only the mode is dateAndTime effective 
  maximumDate: DateTime.Parse ( "20,190,109"), // maximum date and time, only the mode is effective when dateAndTime 
  use24hFormat: false , // whether to use the 24-hour format, where is not used, can be selected AM and PM value is selected 
), 
 
CupertinoDatePicker (
  MODE: CupertinoDatePickerMode.time, // date and time mode, the time mode here 
  onDateTimeChanged: (dateTime) {
     IF (dateTime == null ) {
       return ; 
    } 
    Print ( 'currently selected: When {$ dateTime.hour} $ { dateTime.minute} $ {dateTime.second} second sub ' ); 
  }, 
  initialDateTime: DateTime.Now (), 
  use24hFormat: to true , // whether the 24-hour format, used here 
),

 

Guess you like

Origin www.cnblogs.com/timba1322/p/12486984.html