koukibadr / Bottom-Picker

https://pub.dev/packages/bottom_picker
MIT License
32 stars 21 forks source link

InitialDateTime for minute Time Picker #66

Closed quocviet1996 closed 10 months ago

quocviet1996 commented 1 year ago

So i can init the default time with InitialDateTime like this, but only hour is change, minute always init 0 no matter what number i choose image image

AhmedAElllatif commented 10 months ago

same

koukibadr commented 10 months ago

The version 2.3.1 just published check it out for time constructor now you need to set the initalTime with the Time class example

BottomPicker.time(
      title: 'Set your next meeting time',
      titleStyle: TextStyle(
        fontWeight: FontWeight.bold,
        fontSize: 15,
        color: Colors.orange,
      ),
      onSubmit: (index) {
        print(index);
      },
      onClose: () {
        print('Picker closed');
      },
      bottomPickerTheme: BottomPickerTheme.orange,
      use24hFormat: true,
      initialTime: Time(
        minutes: 23,
      ),
      maxTime: Time(
        hours: 17,
      ),
    ).show(context);