dylanwuzh / flutter-cupertino-date-picker

Flutter cupertino style date picker.
Apache License 2.0
362 stars 417 forks source link

设置 minDateTime 后选择时间, 可选择的分钟列表显示不全 #98

Open kossfun opened 4 years ago

kossfun commented 4 years ago

插件版本 1.0.24

flutter version 1.17

问题描述

如下图所示,我设置的最小时间是当前时间,但是选择器显示的当时一小时可选择的分钟数没有全部显示。

截图

image image

paris1113 commented 4 years ago

遇到了同样的问题,假设设置最小时间是10:50,但是picker上显示的分钟数是0-10,应该是51-59吧。

zolo1129 commented 4 years ago

我也遇到了同样的问题

taoyimin commented 4 years ago

碰到了同样的问题,求解决方法

GurglingY commented 4 years ago

碰到了同样的问题,求解决方法

MRX151 commented 4 years ago

碰到了同样的问题,求解决方法

liuxuliangcumt commented 4 years ago

datetime_picker_widget.dart文件下 _renderDatePickerColumnComponent 方法中注释掉以下代码 if (format.contains('m')) { value = minuteDivider * index; }

TshineZheng commented 4 years ago

我用了这个PR就正常了 https://github.com/dylanwuzh/flutter-cupertino-date-picker/pull/104

YuWenHaoqq commented 4 years ago

还应当修改datetime_picker_widget中的_changeMinuteSelection方法,否则返回的值是错误的. 一下是已经修改之后的代码 /// change the selection of minute picker void _changeMinuteSelection(int index) { // TODO: copied from time_picker_widget - this looks like it would break date ranges but not taking into account _minuteRange.first // int value = index * _minuteDivider; int value = _minuteRange.first + index; if (_currMinute != value) { _currMinute = value; _changeTimeRange(); _onSelectedChange(); }

SargerasWang commented 4 years ago
dependencies:
    flutter_cupertino_date_picker:
      git:
        url: https://github.com/SargerasWang/flutter-cupertino-date-picker
        ref: master
houziyu commented 3 years ago
dependencies:
    flutter_cupertino_date_picker:
      git:
        url: https://github.com/SargerasWang/flutter-cupertino-date-picker
        ref: master

牛啊老哥~

aipame commented 3 years ago

datetime_picker_widget.dart 277行 if (format.contains('m')) { //这一行 value = minuteDivider index; //换成 value = valueRange.first + minuteDivider index; } 375 行 void _changeMinuteSelection(int index) { // TODO: copied from time_picker_widget - this looks like it would break date ranges but not taking into account _minuteRange.first //这里 int value = index _minuteDivider; //换成 int value = index _minuteDivider + _minuteRange.first; // int value = _minuteRange.first + index; if (_currMinute != value) { _currMinute = value; _changeTimeRange(); _onSelectedChange(); } }