filament_mobile_charts 0.1.6 copy "filament_mobile_charts: ^0.1.6" to clipboard
filament_mobile_charts: ^0.1.6 copied to clipboard

Draws a Filament panel's published dashboard charts with fl_chart — the opt-in other half of filament_mobile, which ships no charting dependency.

filament_mobile_charts #

Drawn dashboard charts for filament_mobile.

Dashboard charts

The core package publishes a Filament panel's dashboard widgets — stat cards and chart data — but draws no charts itself: its two-dependency promise (flutter, equatable) is load-bearing. This package is the opt-in other half. Add it, pass one builder, and every chart widget the server publishes is drawn with fl_chart.

Usage #

import 'package:filament_mobile_charts/filament_mobile_charts.dart';

DashboardScreen(
  provider: dashboardProvider,
  chartBuilder: flChartBuilder(),
)

That is the whole integration — flChartBuilder() returns the DashboardChartBuilder typedef DashboardScreen already takes.

Optional overrides:

flChartBuilder(
  palette: [Colors.indigo, Colors.teal],   // series/section colours, cycled
  strings: const FilamentChartStrings(      // fallback messages
    noData: 'Geen gegevens.',
    unsupportedChartType: 'Dit grafiektype wordt niet ondersteund.',
  ),
)

Arabic ships with the package, the same convention as the core package's FilamentStrings: FilamentChartStrings.arabic() returns both messages in Modern Standard Arabic, and FilamentChartStrings.forLocale(panel.locale) resolves that for any ar* tag (case-insensitive) and the English defaults otherwise. A host serving another language supplies its own instance, as above.

flChartBuilder(strings: FilamentChartStrings.forLocale(panel.locale))

Supported chart types #

Keyed off the server's chartType — Filament's own ChartWidget::getType():

chartType Rendered as
line LineChart, one line per dataset
bar BarChart, grouped bars when multi-dataset
pie PieChart, one section per label
doughnut PieChart with a centre hole
radar RadarChart
scatter ScatterChart
polarArea, bubble, anything newer unsupported-type note

Degradation rules #

Honest fallbacks, never a blank box and never a crash — the same rule the core package follows:

  • Zero datasets render the noData note. A successful load of nothing is a normal state, not an error.
  • polarArea, bubble, unknown types render the unsupportedChartType note. fl_chart has neither, and hand-rolling a chart engine is exactly what the core package's design rejected.
  • radar needs at least 3 labels, and every dataset at least as long as the label list (fl_chart asserts both). A chart that cannot meet that falls back to the note.
  • Multi-dataset pie/doughnut plots the first dataset only — a second ring has no honest reading in fl_chart.
  • Colours are the renderer's, never the wire's. The server normalises datasets to label + numeric data by contract; series and sections are coloured from the palette (default kDefaultChartPalette), cycled.

Testing #

flutter test — widget tests cover every type branch, both fallbacks, palette cycling, and the DashboardChartBuilder wiring.

0
likes
160
points
316
downloads

Documentation

API reference

Publisher

verified publishergaitco.com

Weekly Downloads

Draws a Filament panel's published dashboard charts with fl_chart — the opt-in other half of filament_mobile, which ships no charting dependency.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

filament_mobile, fl_chart, flutter

More

Packages that depend on filament_mobile_charts