TimeRangePicker constructor

TimeRangePicker({
  1. Key? key,
  2. TimeOfDay? start,
  3. TimeOfDay? end,
  4. TimeRange? disabledTime,
  5. void onStartChange(
    1. TimeOfDay
    )?,
  6. void onEndChange(
    1. TimeOfDay
    )?,
  7. String fromText = "From",
  8. String toText = "To",
  9. Duration interval = const Duration(minutes: 5),
  10. double padding = 36,
  11. double strokeWidth = 12,
  12. double handlerRadius = 12,
  13. Color? strokeColor,
  14. Color? handlerColor,
  15. Color? selectedColor,
  16. Color? backgroundColor,
  17. Color? disabledColor,
  18. PaintingStyle paintingStyle = PaintingStyle.stroke,
  19. Widget? backgroundWidget,
  20. int ticks = 0,
  21. dynamic ticksLength,
  22. double ticksWidth = 1,
  23. double ticksOffset = 0,
  24. Color ticksColor = Colors.white,
  25. bool snap = false,
  26. List<ClockLabel>? labels,
  27. double labelOffset = 20,
  28. bool rotateLabels = true,
  29. bool autoAdjustLabels = true,
  30. TextStyle? labelStyle,
  31. TextStyle? timeTextStyle,
  32. TextStyle? activeTimeTextStyle,
  33. double clockRotation = 0,
  34. Duration? maxDuration,
  35. Duration minDuration = const Duration(minutes: 30),
  36. bool use24HourFormat = true,
  37. bool hideTimes = false,
  38. bool hideButtons = false,
})

Implementation

TimeRangePicker({
  Key? key,
  this.start,
  this.end,
  this.disabledTime,
  this.onStartChange,
  this.onEndChange,
  this.fromText = "From",
  this.toText = "To",
  this.interval = const Duration(minutes: 5),
  this.padding = 36,
  this.strokeWidth = 12,
  this.handlerRadius = 12,
  this.strokeColor,
  this.handlerColor,
  this.selectedColor,
  this.backgroundColor,
  this.disabledColor,
  this.paintingStyle = PaintingStyle.stroke,
  this.backgroundWidget,
  this.ticks = 0,
  ticksLength,
  this.ticksWidth = 1,
  this.ticksOffset = 0,
  this.ticksColor = Colors.white,
  this.snap = false,
  this.labels,
  this.labelOffset = 20,
  this.rotateLabels = true,
  this.autoAdjustLabels = true,
  this.labelStyle,
  this.timeTextStyle,
  this.activeTimeTextStyle,
  this.clockRotation = 0,
  this.maxDuration,
  this.minDuration = const Duration(minutes: 30),
  this.use24HourFormat = true,
  this.hideTimes = false,
  this.hideButtons = false,
})  : ticksLength = ticksLength == null ? strokeWidth : 12,
      assert(interval.inSeconds <= minDuration.inSeconds,
          "interval must be smaller or same as min duration - adjust either one"),
      assert(
          interval.inSeconds < 24 * 60 * 60, "interval must be smaller 24h"),
      assert(minDuration.inSeconds < 24 * 60 * 60,
          " min duration must be smaller 24h"),
      super(key: key);