Open kossfun opened 4 years ago
遇到了同样的问题,假设设置最小时间是10:50,但是picker上显示的分钟数是0-10,应该是51-59吧。
我也遇到了同样的问题
碰到了同样的问题,求解决方法
碰到了同样的问题,求解决方法
碰到了同样的问题,求解决方法
datetime_picker_widget.dart文件下 _renderDatePickerColumnComponent 方法中注释掉以下代码 if (format.contains('m')) { value = minuteDivider * index; }
还应当修改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(); }
dependencies:
flutter_cupertino_date_picker:
git:
url: https://github.com/SargerasWang/flutter-cupertino-date-picker
ref: master
dependencies: flutter_cupertino_date_picker: git: url: https://github.com/SargerasWang/flutter-cupertino-date-picker ref: master
牛啊老哥~
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(); } }
插件版本 1.0.24
flutter version 1.17
问题描述
如下图所示,我设置的最小时间是当前时间,但是选择器显示的当时一小时可选择的分钟数没有全部显示。
截图