flutter_sleep_chart 0.2.0
flutter_sleep_chart: ^0.2.0 copied to clipboard
A lightweight, dependency-free Apple Health-style sleep stage chart widget for Flutter.
0.2.0 #
- Added
onSegmentTap— called with the segment under the pointer on every pointer-down. - Added
showTimeAxis/timeAxisHeightfor hour-aligned clock labels below the chart. - Added
showRowGridLines/showTimeGridLines/gridLineColorfor optional row-divider and hourly grid lines. - Added
HypnogramLegend, a standalone color-dot + label legend widget for astageStylesmap. - Added
interactionMode(HypnogramInteractionMode.scrub(default) or.tap) —.tapignores pointer-move so the chart doesn't fight a scrollable/draggable parent. - Added
enableAnimation/animationDuration/animationCurve— bars now animate in on first render and wheneversegmentschanges (on by default). - Added
emptyBuilderfor a custom placeholder whensegmentsis empty.
0.1.0 #
- Breaking: replaced the
colors/stageOrder/labelsmaps with a singlestageStyles: Map<SleepStageType, StageStyle>— color, label, and an optional per-stagerowHeightoverride, in one place. Row order now follows the map's iteration order. - Added
HypnogramTooltipConfig(tooltip:param) to customize the scrub tooltip: per-field text overrides (labelText/timeRangeText/durationText), bubble styling (background, text styles, padding, border radius, shadow, color-dot toggle), or a fullbuilderoverride. - Added
labelColumnWidthparam (previously a hardcoded constant). - Fixed the tooltip floating above the chart's own bounds — it now clamps to the chart area and flips below the anchor row when there's no room above.
0.0.1 #
- Initial release:
HypnogramChartwidget — per-stage rows with glassy halo bars, gradient stage-transition connectors, minimum-width clamping for short segments, and a scrub tooltip (hover/tap/drag) with a guide line and stage-colored dot.