fl_pretty_charts 2.3.0
fl_pretty_charts: ^2.3.0 copied to clipboard
A beautiful, animated Flutter charts package. Includes Bar, Line, Pie/Donut, and Radar charts. Zero dependencies — pure Flutter custom painter.
Changelog #
All notable changes to fl_pretty_charts will be documented here.
This project follows Semantic Versioning.
2.3.0 #
Added #
- 📐
FlResponsiveChart— wrapper that adapts any chart to screen sizesmall/medium/largebreakpoint configsbuildercallback receives resolvedResponsiveChartConfigdebugLabelmode prints resolved breakpoint during development
- 📱
ChartBreakpoints— configurable width thresholds- Default: small < 360px, medium < 600px, large ≥ 600px
- Fully customizable via
smallMaxWidthandmediumMaxWidth
- ⚙️
ResponsiveChartConfig— per-breakpoint chart configurationheight— chart height at this breakpointpadding— chart padding at this breakpointyAxisDivisions— fewer grid divisions on small screensshowGrid— hide grid on very small screenslabelFontSize— smaller labels on compact screensshowDots— hide dots on small screens for clarity
- 🔌
ResponsiveChartConfigXextension — resolve helpers with fallbacksresolveHeight(),resolvePadding(),resolveYAxisDivisions()resolveShowGrid(),resolveLabelFontSize(),resolveShowDots()
- 🏗️
FlResponsiveBarChart— pre-configured responsive bar chart wrapper - Works with all chart types via the
builderpattern - Zero new dependencies
Use Cases Solved #
- Charts that look great on phones AND tablets AND desktop
- Automatic label density reduction on small screens
- No more manual
MediaQueryboilerplate per chart
2.2.0 #
Added #
- 📸
ChartExporter— export any chart to PNG imageChartExporter.toBytes(key)— capture chart asUint8ListChartExporter.toImage(key)— capture chart asui.ImageChartExporter.showPreview(context, key)— show preview dialog- Configurable
pixelRatiofor high-DPI output (default3.0) - Configurable
backgroundColorfor export background
- 🖼️
ExportableChart— wrapper widget with built-in export button- Wraps any chart with
RepaintBoundaryautomatically - Built-in export button overlay (top-right, configurable alignment)
- Loading state during export with
CircularProgressIndicator onExportedcallback for custom save/share logicshowExportButtontoggle- Preview dialog shows image size in KB
- Works on Android, iOS, Web, Desktop
- Zero new dependencies — uses Flutter's built-in rendering pipeline
- Wraps any chart with
Use Cases Solved #
- Save chart as PNG to device gallery
- Share chart image via native share sheet
- Upload chart to server as image
- Embed chart in PDF report
- Screenshot chart for presentations
2.1.0 #
Added #
- 🎯
ChartAnnotation— reference lines drawn on top of chartsChartAnnotation.horizontal(value:)— y-axis reference lineChartAnnotation.vertical(index:)— x-axis reference line- Optional label with background pill styling
- Configurable dash pattern, stroke width, color, label position
- Three label positions:
start,center,end
AnnotationPainter— internal utility for drawing annotationsAnnotationAxis— enum for horizontal/vertical axisAnnotationLabelPosition— enum for label placement- Annotations supported on:
FlBarChartviaannotationsparameterFlLineChartviaannotationsparameterFlAreaChartviaannotationsparameter
- Annotations animate in with the chart reveal
- Solid or dashed lines via
dashPatternconfig
Use Cases Solved #
- Mark target values ("Target: 80")
- Show averages ("Avg: 55")
- Mark thresholds ("Max capacity")
- Mark events ("Product launch", "Sale started")
2.0.0 — Live Charts 🔴 #
Added #
- 🔴
FlLiveBarChart— real-time bar chart with smooth tween transitions- Tweens from old values to new values on each data update
- Supports
LiveDataController<List<BarData>> - Full
BarStyle,AxisStyle,ChartThemesupport
- 📡
FlLiveLineChart— scrolling live line chart with rolling window- Single-series via
FlLiveLineChart(controller:...) - Multi-series via
FlLiveLineChart.multi(controller:...) - Rolling window — keeps last N points, slides old ones out
- "Waiting for data..." placeholder before first emission
- Single-series via
- 📉
FlLiveAreaChart— real-time area chart with rolling window- Single-series via
FlLiveAreaChart(controller:...) - Multi-series via
FlLiveAreaChart.multi(controller:...) - Rolling window with smooth bezier curve updates
- Single-series via
- 🎛️
LiveDataController<T>— generic data controlleradd(data)/update(data)— push new datapause()/resume()/togglePause()— playback controlstreamsetter — attach externalStream<T>as data sourcelastValue— seed new listeners with latest data- Auto-disposes cleanly
- ⏱️
LiveTicker— periodic timer helper for demos and testing - 🔀
LiveChartMixin— reusable stream subscription lifecycle mixin - Example app updated with Live Charts tab
- Play/pause controls
- Speed selector (slow/normal/fast)
- Reset button
- Single line, multi-line, area, and bar live demos
Breaking Changes #
- None — all existing chart widgets unchanged
1.3.0 #
Added #
- 📉
FlAreaChart— animated area chart widget AreaChartData— main data model with series and style configAreaSeries— single area series with points, label, and styleAreaPoint— individual data point with x, y, and labelAreaSeriesStyle— stroke, fill opacity, gradient, dots, smooth toggleAreaAxisStyle— grid and axis configurationAreaTooltipStyle— tooltip appearance configuration- Stacked mode — areas stack on top of each other via
stacked: true - Smooth bezier curves between data points
- Gradient area fill — top-to-bottom per series color
- Custom fill gradient via
AreaSeriesStyle.fillGradient - Animated left-to-right reveal
- Dot indicators at each data point with tap highlight
- Multi-series support with tap-to-highlight
- Legend shown automatically for multi-series charts
ChartThemesupport viathemeparameter- Full dartdoc on all public APIs
1.2.1 #
Added #
- 🌐 Live demo deployed at fl-pretty-charts.netlify.app
- Added live demo link to README
Fixed #
- Added
netlify.tomlto prevent Dart files being treated as serverless functions
1.2.0 #
Added #
- 📊
FlStackedBarChart— animated stacked bar chart widget StackedBarChartData— main data model with groups and seriesStackedBarSeries— single series with label, color, and valuesStackedBarStyle— border radius and bar width fractionStackedAxisStyle— grid lines, y-axis divisions, label styleStackedTooltipStyle— tooltip appearance configuration- Percentage mode — normalize each bar to 100% via
percentageMode: true - Tap-to-highlight individual segments with glow effect
- Tooltip shows series label + value or percentage
ChartThemesupport viathemeparameter- Built-in
LegendWidgetbelow chart viashowLegend: true - Smart rounding — only topmost segment gets rounded corners
- Full dartdoc on all public APIs
1.1.0 #
Added #
- ↔️
FlHorizontalBarChart— animated horizontal bar chart widget - Bars grow left to right with smooth animation
- Reuses all existing
BarChartDatamodels — zero new data classes needed - Gradient support via
BarStyle.gradient(usecenterLeft→centerRight) - Per-bar color override via
BarData.color - Tap-to-tooltip interaction on each bar
ChartThemesupport viathemeparameter- Y-axis category labels on the left
- Vertical grid lines with configurable divisions and opacity
- 📸 Added chart screenshots to README
1.0.0 — Stable Release 🎉 #
Added #
- 🎨
ChartThemeintegration across all 4 chart widgetsFlBarChart(theme: ChartTheme.ocean())— overrides bar colorFlLineChart(theme: ChartTheme.sunset())— overrides line series colorsFlPieChart(theme: ChartTheme.forest())— overrides segment colorsFlRadarChart(theme: ChartTheme.defaultTheme())— overrides dataset colors
- 🏷️
LegendWidget— standalone reusable legend widgetLegendItem— single color + label item- Configurable dot size, spacing, alignment, shape
- Per-item text style override
- All 4 chart types stable and production ready
- Full backward compatibility — no breaking changes
Charts Included #
- ✅
FlBarChart— animated bar chart with tap tooltips - ✅
FlLineChart— smooth bezier line chart, multi-line - ✅
FlPieChart— animated pie and donut chart - ✅
FlRadarChart— radar/spider chart, multi-dataset
0.9.0 #
Added #
- 🕸️
FlRadarChart— animated radar/spider chart widget RadarChartData— main data model with labels, datasets, and style configRadarDataset— single data series with values, label, and styleRadarDatasetStyle— stroke, fill opacity, dot radius configurationRadarGridStyle— concentric polygon grid, spoke lines, axis labelsRadarLegendStyle— legend with dot size and spacing config- Multi-dataset support — overlay multiple series on one chart
- Animated polygon reveal from center outward
- Concentric polygon grid rings with configurable levels
- Axis spoke lines from center to each label
- Axis labels with smart quadrant-based nudging
- Tap-to-highlight datasets with opacity fade on others
- Legend tap to highlight/deselect datasets
- Dot indicators at each data point
- Full dartdoc on all public APIs
0.5.0 #
Added #
- 🥧
FlPieChart— animated pie and donut chart widget PieChartData— main data model with full style configurationPieSegment— single segment with value, label, color, optional gradientLegendStyle— configurable legend with position, dot size, spacingCenterLabelStyle— title + value label for donut centerPieTooltipStyle— tooltip appearance configuration- Donut variant via
PieChartData.donut = true - Configurable inner radius via
donutRadius - Tap-to-expand segments with glow highlight effect
- Legend tap to highlight/deselect segments
- Animated opacity on unselected legend items
- Percentage display in legend labels
- Configurable segment gap and start angle
- Full dartdoc on all public APIs
0.1.2 #
Fixed #
- Replaced
withOpacity()withwithValues()for Flutter 3.27+ compatibility - Switched CI analyze flag from
--fatal-infosto--fatal-warnings - Bumped Flutter version in all CI/CD workflows to 3.27.0
0.1.1 #
Fixed #
- Improved CI/CD pipeline with pub-credentials.json based publishing
- Updated publish workflow for more reliable pub.dev deployment
0.1.0 #
Added #
- 📈
FlLineChart— animated line chart widget with left-to-right draw LineChartData— main data model for line chartsLineData— single line series with points and style configLinePoint— individual data point with x, y, and labelLineStyle— stroke width, color, gradient, fill, dots, smooth toggleAxisLineStyle— grid and axis config for line chartsLineTooltipStyle— tooltip appearance for line charts- Smooth bezier curves between data points
- Gradient area fill below each line
- Animated left-to-right line draw
- Dot indicators at each data point with tap highlight
- Multi-line support — render multiple series on one chart
- Tap-to-tooltip interaction on data points
0.0.1 #
Added #
- 📊
FlBarChart— animated bar chart widget BarChartData— main data model with full style configurationBarData— single bar model with value, label, optional color overrideBarStyle— border radius, width fraction, gradient supportAxisStyle— grid lines, y-axis divisions, label text styleTooltipStyle— tap tooltip appearance configurationChartAnimation— animation config with 4 presets:elegant()— 1200ms easeOutCubicsnappy()— 400ms easeOutBackbouncy()— 800ms elasticOutnone()— instant render
ChartTheme— 4 built-in color palettes:defaultTheme()— indigo, teal, amber, orange, purpleocean()— cool blue-green palettesunset()— warm reds and orangesforest()— nature-inspired greens
ChartUtils— shared drawing utilities (niceMax, valueToY, formatValue)ChartAnimationMixin— reusable animation lifecycle mixin- Zero external dependencies — pure Flutter CustomPainter
- Full dartdoc documentation on all public APIs
- Full test suite — 27 tests passing
- Example app demonstrating all bar chart configurations