Repository navigation
Several minor issues were discovered. #1
Description
Activity
Thanks for the kind words, and for the detailed report — all three are addressed in 2.3.2.
1.
onLoadMorenot workingYou were right that it never fired. The callback was declared and documented, but nothing in the library ever invoked it — so there was no way for it to work, regardless of how you wired it up.
It's now called at both scroll edges, from the pan handler and the fling animation, with the flag
trueat the newest candle andfalseat the oldest. It fires once per arrival at an edge rather than once per frame, so a drag held against the edge won't spam your paging code, and it asks again if you scroll away and come back.2.
showInfoDialogtrue → false → true throwingReproduced, and the
LateInitializationErroryou saw was a symptom rather than the cause. The info dialog subscribed to a single-subscription stream, and it's only in the widget tree whileshowInfoDialogis set. Turning the flag off unmounted it and cancelled the subscription; turning it back on tried to listen to that same stream a second time, which threw:Bad state: Stream has already been listened to.That throw happened while the enclosing
Stackwas mounting its children, which left the framework's_childrenfield unassigned — and the next frame's access to it surfaced as theLateInitializationError: Field '_children'in your log.The controller is now a broadcast one, so the dialog can be mounted and unmounted as often as you like. There's a regression test that toggles the flag and asserts nothing throws.
3. Fixed price axis when scrolling
Added as
ChartStyle.priceAxisWidth:KChartWidget( data, ChartColors(), chartStyle: const ChartStyle(priceAxisWidth: 56), )
Given a width, a gutter is held back for the price labels: the candles, the grid and the date axis all stop short of it, so nothing scrolls underneath the axis any more. Which side it's held back on follows
verticalTextAlignment. It defaults to0, which is the previous behaviour — labels drawn over the plot — so this changes nothing for existing charts unless you opt in.Thanks again for taking the time to write these up.
Thank you for your reply.
By the way, it is support intraday chart?ChartType.area,no scrolling,no scaling,fixed position, no load more.Have a good day.Looking forward to your reply.
Yes — an intraday area chart works today, and one flag is missing for the rest.
ChartType.areais supported, andonLoadMoreis simply optional: leave it
off and nothing pages in.For a fixed position, the trick is to let every candle fit the width. When the
whole series fits, there is nothing to scroll —ChartStyle.pointWidth(8 by
default) is what controls the spacing, so set it to roughly the chart's width
divided by the number of candles:KChartWidget( sessionCandles, ChartColors(), isTrendLine: false, watermarkAssetPath: 'assets/logo.svg', timeFrame: const Duration(minutes: 5), chartType: ChartType.area, xFrontPadding: 0, volHidden: true, hideGrid: true, showNowPrice: false, showInfoDialog: false, crosshairOnHover: false, showContextMenu: false, showScrollToNowButton: false, priceScaleDrag: false, enableKeyboardShortcuts: false, // 78 candles in a ~400px box: 400 / 78 ≈ 5 chartStyle: const ChartStyle(pointWidth: 5), );With that the chart cannot be dragged at all — the scroll clamps to zero
because the series already fits.The one gap is pinch: zooming out is still possible, and once the scale
changes the chart becomes scrollable again. There is currently no flag to turn
that off, so I will add one for a fully static chart.Thanks for raising it.
check /example/lib/intraday_demo.dart
It's simply amazing! Looking forward to your next update.
- linked a pull request that will close this issueFix onLoadMore and the info-dialog crash; add a lockable price axis and a gesture-free chart #2
on Sep 10, 2026 - added a commit that references this issue
on Sep 10, 2026
What happened
First of all, this is a powerful library, but during the usage process, several minor issues were discovered.
"onLoadMore" function is not working properly.
"showInfoDialog" set "true" -> "false" -> "true" throw Exception
════════ Exception caught by widgets library ═══════════════════════════════════
LateInitializationError: Field '_children@25042623' has not been initialized.
By the way,
How to reproduce it
-ohlcv_chart version
2.3.1
Flutter version
3.47.1
Platform
iOS
Anything else
No response