timeframe_selector 0.2.2 timeframe_selector: ^0.2.2 copied to clipboard
A widget for simple timeframe selection similar to calenders
This package implements a timeframe selector, similar as what you would use in a calender. It is meant to be used like a DateTimeRange picker, but for timeframes instead of days.
After not finding what I was searching for I made my own and now you found it
Check out the Demo: https://firebon.de:8081/TimeframeDemo/
Features #
- Move and scale timeframe
- Block specific time ranges from selection
- Define minimum amount of segments
Usage #
Since its a fairly simple widget that does not handle its own state you should put it in a StatefulWidget
TimeframeSelector(
baseTimeframe: DateTimeRange(
start: DateTime(0, 1, 1, 10),
end: DateTime(0, 1, 1, 24),
),
timeSegmentLength: const Duration(minutes: 30),
minTimeframeSegments: 4,
selectedTimeframe: selectedTimeframe,
overlayDatas: [
OverlayData(
timeframes: [
DateTimeRange(
start: DateTime(0, 1, 1, 15),
end: DateTime(0, 1, 1, 17),
),
],
),
],
onTimeframeChange: (newTimeframe) => setState(
() {
selectedTimeframe = newTimeframe;
},
),
),
Additional information #
Feel free to create a ticket on the Github repo, I will try to answer as fast as possible, but I also work fulltime. If you want to support me please check out my game on steam :D https://store.steampowered.com/app/2226140/Crypt_Architect/