flexi_kline 2.3.2
flexi_kline: ^2.3.2 copied to clipboard
A flexible Kline framework package project.
2.3.2 #
- Add
crossOffsetListenableso external consumers can subscribe to Cross focus changes. - Constrain multiline
drawTextanddrawImageTextlayouts to theirdrawableRect, while retaining existing single-line width behavior. - Change
FlexiKlineController.moveToDateTime(DateTime)to an awaitable API returningFuture<int?>: it completes after the movement animation and returns the resolved candle index, ornullwhen the request cannot complete (Breaking Changes).
2.3.1 #
- Add optional
TipsConfig.lineWidthto override the width of the indicator line a tips represents (color still derived fromstyle); when null it falls back to the indicator-levellineWidth. - Add
defaultAuxiliaryLineWidthconstant (0.5) and apply it to auxiliary lines (crosshair, grid, high/low and latest-price mark lines), replacing scattered0.5literals and distinguishing them from data lines (defaultIndicatorLineWidth). - Simplify magnifier
CircleBorderresolution: only the border color falls back to the theme grid-line color when transparent; the configuredwidthandstyleare now respected (previouslywidth <= 0was forced to1andBorderStyle.noneto solid).MagnifierConfig.shapeSidedefault is nowBorderSide(color: transparent, width: 0.5). - Fix
TooltipConfigJSON deserialization to defaulthitTestMarginto2, matching the constructor default.
2.3.0 #
- Improve
FlexiLayoutMode.fixedcanvas size resolution: resolve width and height independently (parent constraints first,fixedSizefallback) to cover more constraint combinations. - Relax
initialFixedSizeassert in fixed layout mode: onlyheightmust be finite when provided; width can be resolved from parent constraints. - Add
isMountedguard inpaintChartto prevent accessing uninitialized PaintObjects during early render frames. - Align paint naming by drawing position: rename indicator top-bar hook
paintTooltiptopaintTips; Cross-layer floating box APIs (TooltipInfo,TooltipConfig,CrossBinding.paintTooltip) remain unchanged (Breaking Changes). - Rename
allowPaintExtraOutsideMainRecttoallowOverlayOutsideMainRectinSettingConfigand JSON serialization (Breaking Changes). - Add default no-op
paintTipsimplementation on basePaintObject. - Remove redundant
computeVisibleMinMaxandpaintTipsoverrides fromTimePaintObject. - Add
Indicator.autoActivateto control auto-show on mount or false→true update; Direct/Computed defaultfalse, External defaulttrue, Candle/Time/Main fixedtrue; turning tofalsedoes not auto-hide (Breaking Changes). - Defer PaintObject creation to activation time: External indicators are no longer eagerly created on declaration;
keepAliveonly controls dispose-on-hide (Breaking Changes). mountIndicatorsnow activates the deduplicated union of persisted keys andautoActivatedeclarations;updateIndicatorsreturns pending activation keys forshowMainIndicator/showSubIndicator.- Fix computed slot capacity as a high-water mark so deleting middle indicators does not shrink
slotsarray below surviving high-index data. - Add
FlexiKlineController.moveToDateTime(DateTime)with animated viewport positioning; addKlineData.indexAtOrBeforefor nearest loaded candle lookup. - Unify Cross tooltip rendering via
Canvas.drawTooltipInfosfor aligned two-column layout; addTooltipInfo.onTapwith configurableTooltipConfig.hitTestMarginandTooltipConfig.spacing(Breaking Changes). - Remove
TooltipInfo.riseOrFallin favor ofvalueStyleat the data layer (Breaking Changes). - Stabilize tooltip width during crossing via session-level
minContentWidthtracking.
2.2.0 #
- Redesign widget-level indicator declaration:
FlexiKlineWidgetnow acceptscandle,time,mainIndicators,subIndicatorsdirectly; addFlexiKlineWidget.indicatornamed constructor forIIndicatorConfig(Breaking Changes). - Simplify
IConfigurationinterface: removeconfigKey,candleIndicatorBuilder,timeIndicatorBuilder,mainIndicatorBuilders,subIndicatorBuilders; retain onlytheme,generateFlexiKlineConfig,drawObjectBuilders(Breaking Changes). - Introduce
IIndicatorConfiginterface to decouple indicator provision from framework configuration; user-owned storage replaces built-in persistence (Breaking Changes). - Rename indicator taxonomy: Normal→Direct, Data→Computed, Business→External;
NormalIndicatorKey→DirectIndicatorKey,DataIndicatorKey→ComputedIndicatorKey,BusinessIndicatorKey→ExternalIndicatorKey(Breaking Changes). - Rename PaintObject base classes:
DataPaintObject→ComputedPaintObject,BusinessPaintObject→ExternalPaintObject,NormalPaintObject→DirectPaintObject(Breaking Changes). - Introduce
IPaintLifecycleinterface with unified lifecycle hooks:initState,didChangeDependencies,didAttach,didDetach(Breaking Changes). - Replace
syncAllIndicators()/init()withmountIndicators(); renamesyncIndicators()toupdateIndicators()(Breaking Changes). - Replace
LayoutModeclass hierarchy withFlexiLayoutModeenum (adapt/fixed); addFlexiKlineController.initialLayoutModeparameter (Breaking Changes). - Replace
autoAdaptLayoutbool onFlexiKlineWidgetwithFlexiLayoutTypeenum (adapt/fixed/normal) (Breaking Changes). - Split
IPaintContextinto scoped interfaces:PaintEnvironment,PaintDataScope,PaintGeometryScope,PaintRuntimeScope(Breaking Changes). - Split
IDrawContextinto scoped interfaces:DrawEnvironment,DrawDataScope,DrawGeometryScope,DrawRuntimeScope(Breaking Changes). - Rename
curKlineDatatoklineData; renamecancelCrosstorequestCancelCross(Breaking Changes). - Rename
FlexiKlineThemeConfigurationMixintoFlexiKlineConfigurationMixin(Breaking Changes). - Add
FlexiKlineLifecycleenum (initial/mounted/disposed) withlifecycleListenablefor controller state observation. - Add
PaintObject.mount()lifecycle method (mirrors FlutterElement.mount); inject indicator/context/logger at mount time. - Add
isMountedguards to controller APIs (setCanvasSize,setMainSize,onThemeChanged, etc.) to prevent late-field access beforemountIndicatorscompletes. - Add
FlexiStateNotifier.setSilentlyfor build-phase value initialization without triggering subscribersetState. - Move grid/chart/cross/draw repaint triggers onto
KlineBindingBase; internalize layer repaint APIs.
2.1.1 #
- Optimize
mergeCandleListperformance: add in-place fast paths for head/tail aligned updates to reduce unnecessary list copies on hot path. - Fix
getLoadMoreSpec()from/to direction for loading more historical data. - Fix combine sub-indicator (e.g. MA) min/max not refreshed after add/remove, which caused lines to be drawn at chart bottom.
- Fix candle interval chart-type lookup to use
ITimeIntervalequality instead of milliseconds comparison. - Expose
chartZoomSlideBarRectonIPaintContextand indicator paint context for custom hit-testing or overlay layout. - Remove built-in interval constants (
interval1m,interval1D, etc.) fromconstant.dart; useFlexiTimeIntervalor customITimeIntervalimplementations instead (Breaking Changes). KlineSpec.intervalis now required; defaultlimitchanged from 100 to 200.- Default
CandleIndicatorno longer pre-configures line chart for 1s/1m intervals.
2.1.0 #
- Simplify configuration system: config color fields are now nullable, theme colors are injected at paint time via .ensure() pattern (Breaking Changes).
- Decouple theme colors from config objects: replace hardcoded color defaults with lazy injection mechanism (Breaking Changes).
- Redesign IFlexiKlineTheme: remove scale/pixel/setDp/setSp methods and BaseFlexiKlineTheme class; rename color properties for clarity (long→longColor, short→shortColor, gridLine→gridLineColor, etc.) (Breaking Changes).
- Rename timeBar parameter to interval for consistency across the codebase (Breaking Changes).
- Simplify time interval interface: introduce ITimeInterval/FlexiTimeInterval to replace TimeBar enum (Breaking Changes).
- Restructure logging system: introduce layered IFlexiLogger/FlexiLog architecture with cleaner separation of concerns (Breaking Changes).
- Update kline data structures: add KlineSpec class and KlineLoadingState enum to replace CandleReq (Breaking Changes).
- Add Color? extension methods (isValid, ensure, or) in style_ext.dart for nullable color handling.
- Add themeColor params to drawing primitives (drawLineByConfig, drawCirclePoint, drawTextArea).
- Rename TextAreaConfig.background to backgroundColor for consistency.
- Make default configs const where possible for better performance.
- Clean up configuration framework and improve serialization handling.
2.0.0 #
- Replace BagNum with FlexiNum for numeric representation (Breaking Changes).
- Introduce ICandleModel interface and FlexiCandleModel; unify candle model to support custom models (Breaking Changes).
- Refactor Indicator to generic class with typed key system: IIndicatorKey sealed class with DataIndicatorKey, BusinessIndicatorKey and NormalIndicatorKey subtypes (Breaking Changes).
- Split PaintObjectIndicator into DataIndicator and BusinessIndicator with corresponding DataPaintObject and BusinessPaintObject (Breaking Changes).
- Refactor paint object interfaces: rename IPaintBoundingBox to IPaintBounding, introduce IBasePainter/IComputablePainter/IBusinessPainter, add PaintObjectComputableMixin (Breaking Changes).
- Change PaintObject initialization to lazy pattern; remove context and indicator from constructors (Breaking Changes).
- Deprecate TimeBar enum and unify with ITimeBar (Breaking Changes).
- Rename supportLongPress to enableLongPress in GestureConfig (Breaking Changes).
- Refactor project structure: extract
TimeBar,LayoutMode,FlexiChartType, indicator keys and paint interfaces into independent modules; renamecommon.dartfiles totypes.dart/interfaces.dart. - Add
FlexiUpdater<T>typedef andupdateXxxConfigconvenience methods to SettingBinding. - Improve type safety: replace manual casts with
whereType<IComputablePainter>(). - Add enableScale property to GestureConfig to allow disabling scale/zoom gestures.
- Resolve two-finger zoom gesture conflicts and optimize zoom experience.
- Add Y-axis smooth interpolation during pan to reduce coordinate jumps.
- Add panSmoothFactor and convergenceRatio to ToleranceConfig for configurable smoothing.
- Update inertial pan duration formula from log to sqrt for better velocity-to-duration mapping.
- Enhance lint rules and apply fixes across codebase.
1.2.1 #
- Refactor ChartType to FlexiChartType with improved structure and key property (Breaking Changes).
- Add negative number constants to BagNum (minusHundred, minusFifty, minusTen, minusThree, minusTwo, minusOne).
- Add time bar comparison methods (isSameAs, compareTimeBar) for ITimeBar.
- Improve chart framework serialization and object handling.
- Update flexi_formatter dependency to ^1.7.3.
1.2.0 #
- Fix multiple naming typos in public APIs (Breaking Changes).
- Add latest candle point marker for line chart.
- Refactor ChartType to sealed class; replace timeChartType/minCandleWidthChartType with timeBarChartTypes/minWidthLineType for flexible chart type configuration (Breaking Changes).
- Move hideIndicatorsInTimeChart from SettingConfig to CandleIndicator as hideIndicatorsWhenLineChart (Breaking Changes).
- Replace LinearGradient with GradientConfig for better serialization and flexibility; rename chart painting methods (Breaking Changes).
1.1.1 #
- Add listening for the painting range changes.
- Optimize the minmax of chart when no market fluctuation.
- Optimize the details of the zoom operation; Add listening to the zoom slide bar area.
- bugfix.
1.1.0 #
- Optimize the TimeBar and support flexible customization.
- Support image drawing.
- Support image and text drawing.
- Add more painting methods.
- bugfix.
1.0.0 #
- Optimize the calculation performance of indicators
- Optimize gesture detector performance.
- Optimize configuration management: load, store, update.
- Optimize KlineData structure.
- Added multiple chart types and styles for candlestick charts.
- Provide FlexiKlinePage mixin to assist development.
- Optimize indicator chart painting performance and configuration.
- Optimize scrolling animation.
- bugfix.
0.9.1 #
- Rearrange layout mode And bugfix.
- Optimize web gestures.
0.9.0 #
- Configuration management refactoring
- Optimization indicator framework
- Add keyboard event handling on non-touch devices
- Add layout mode: normal, adapt, fixed
- Add zoom chart feature
- bugfix
0.8.0 #
- New Architecture Design
- Indicator Framework Refactoring
- Adjust the height of the indicator chart by dragging the Grid line
- bugfix
0.7.1 #
- Support Draw Feature
- Optimize gesture
0.7.0 #
- Drawing overlay framework implementation
- Optimize coordinate conversion of indicator chart data
- Optimize drawing gesture processing
- Added drawing magnifying glass
0.6.0 #
- Support Desktop
- Support Web
- Refactor gesture recognition framework to adapt to Web/Desktop
- Demo for custom indicators and replacing built-in indicators.
0.5.0 #
- Support landscape mode.
- Optimize zooming functionality.
- Optimize configuration management.
- Dispose indicators when unbinding.
- Add secondary chart indicators.
0.4.0 #
- Theme switching implementation.
- Configuration framework optimization.
- Data loading interface encapsulation.
- Candle data merging algorithm optimization.
- Indicator calculation performance optimization.
- Gesture operation optimization.
- Flutter minimum supported version
0.3.0 #
- Configuration framework implementation
- Optimization of metric data calculation
- Core + framework framework optimization
- Kline implements dynamic adjustment of width and height
0.2.0 #
- New drawing architecture design.
- Indicator configuration management (serialization, local storage)
- Indicator calculation design and implementation Volume, MA, EMA, BOLL, MACD, KDJ, MAVOL
0.1.0 #
- 项目FlexiKline
- 整体框架
- 基础蜡烛图绘制
- example示例