VTimeFilter constructor

VTimeFilter(
  1. Function checkCallBack, {
  2. List daySelect = _dayTypeList,
  3. int selectDayIndex = 3,
  4. String? customBgColor = "#f3f4f5",
  5. String? filterBgColor = "#f3f4f5",
  6. List<Widget>? children,
  7. String? format,
  8. Function? timeFilterSelect,
  9. String searchHint = "请输入",
  10. int searchLength = 10,
  11. 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======");
}