Skip to content

Cupertino DateTimePicker initialDateTime issue? #28730

@exgonline

Description

@exgonline

When I set the minute Interval to 15 and set the initial date time as below, the minutes show as 45 when the picker displays. If I set the initial date time to end in 45 mins, the picker shows the minutes as 15 when it displays. 30mins and 00min are correct. If I change the interval to 1, everything is ok!

[flutter] flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.2.1, on Mac OS X 10.13.6 17G5019, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.31.1)
[✓] Connected device (1 available)

• No issues found!
exit code 0
initialTime = DateTime.parse( "2019-03-01 20:15:00")
showModalBottomSheet(
        context: context,
        builder: (BuildContext context) {
          return Container(
            height: 250.0,
            child: CupertinoDatePicker(
              mode: CupertinoDatePickerMode.time,
              minuteInterval: 15,
              use24hFormat: true,
              initialDateTime: initialTime,
              onDateTimeChanged: (DateTime value) {                           
              },
            ),
          );
        });

Metadata

Metadata

Labels

f: cupertinoflutter/packages/flutter/cupertino repositoryframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions