VTimeFilter constructor
VTimeFilter(
- Function checkCallBack, {
- List daySelect = _dayTypeList,
- int selectDayIndex = 3,
- String? customBgColor = "#f3f4f5",
- String? filterBgColor = "#f3f4f5",
- List<
Widget> ? children, - String? format,
- Function? timeFilterSelect,
- String searchHint = "请输入",
- int searchLength = 10,
- String selectColor = "#6c69ff",
Implementation
VTimeFilter(this.checkCallBack,
{this.daySelect = _dayTypeList,
this.selectDayIndex = 3, //小程序这里传几对应的是选项的value 因为有赞组件有处理,所以flutter需要处理,在这,这个值专业指的是数组的index 默认是7天内
this.customBgColor = "#f3f4f5",
this.filterBgColor = "#f3f4f5",
this.children,
String? format,
this.timeFilterSelect,
// this.cursorColor = "#039aaf2",
this.searchHint = "请输入",
this.searchLength = 10,
this.selectColor = "#6c69ff"}) {
this.format = format ?? TimeFormat.formats["format1"];
if (this.format == TimeFormat.formats["format1"]) {
_pickerType = PickerDateType.YMD_HMs;
} else if (this.format == TimeFormat.formats["format2"]) {
_pickerType = PickerDateType.YMD_HM;
} else {
_pickerType = PickerDateType.YMD;
}
_pickerTitle = daySelect[selectDayIndex]["text"];
// _endTime = DayDart().format(this.format);
// int gap=daySelect[selectDayIndex]["value"];
// int gapDP = gap - 1;
// _beginTime = DayDart().subtract(gapDP, DayUnits.D).format(this.format);
// if (timeFilterSelect != null) {
// _res["beginTime"] = _beginTime;
// _res["endTime"] = _endTime;
// _res["filterKeywords"] = _filterKeywords;
// _res["endTimeMill"] = DayDart(_endTime).toDate().millisecondsSinceEpoch;
// _res["beginTimeMill"] =
// DayDart(_beginTime).toDate().millisecondsSinceEpoch;
// timeFilterSelect!(_res);
// }
// debugPrint("=====$_beginTime========$_endTime======");
}