TimeRangePicker constructor
TimeRangePicker({
- Key? key,
- TimeOfDay? start,
- TimeOfDay? end,
- TimeRange? disabledTime,
- void onStartChange()?,
- void onEndChange()?,
- String fromText = "From",
- String toText = "To",
- Duration interval = const Duration(minutes: 5),
- double padding = 36,
- double strokeWidth = 12,
- double handlerRadius = 12,
- Color? strokeColor,
- Color? handlerColor,
- Color? selectedColor,
- Color? backgroundColor,
- Color? disabledColor,
- PaintingStyle paintingStyle = PaintingStyle.stroke,
- Widget? backgroundWidget,
- int ticks = 0,
- dynamic ticksLength,
- double ticksWidth = 1,
- double ticksOffset = 0,
- Color ticksColor = Colors.white,
- bool snap = false,
- List<
ClockLabel> ? labels, - double labelOffset = 20,
- bool rotateLabels = true,
- bool autoAdjustLabels = true,
- TextStyle? labelStyle,
- TextStyle? timeTextStyle,
- TextStyle? activeTimeTextStyle,
- double clockRotation = 0,
- Duration? maxDuration,
- Duration minDuration = const Duration(minutes: 30),
- bool use24HourFormat = true,
- bool hideTimes = false,
- 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);