diff --git a/community_charts_common/CHANGELOG.md b/community_charts_common/CHANGELOG.md index 8eff34f..7ddcd6b 100644 --- a/community_charts_common/CHANGELOG.md +++ b/community_charts_common/CHANGELOG.md @@ -1,4 +1,4 @@ -# 1.0.3 +# 1.0.4 * Add a PointLabelDecorator to render a label for a point * Enhance LinePointHighlighter to support callbacking the highlight points's info like position, datum and its corresponding seriers id * Update intl package diff --git a/community_charts_common/lib/community_charts_common.dart b/community_charts_common/lib/community_charts_common.dart index 0dbe9c6..8fcde4b 100644 --- a/community_charts_common/lib/community_charts_common.dart +++ b/community_charts_common/lib/community_charts_common.dart @@ -253,7 +253,8 @@ export 'src/chart/scatter_plot/point_renderer_config.dart' show PointRendererConfig; export 'src/chart/scatter_plot/point_renderer_decorator.dart' show PointRendererDecorator; -export 'src/chart/scatter_plot/point_label_decorator.dart'; +export 'src/chart/scatter_plot/point_label_decorator.dart' + show PointLabelDecorator, PointLabelSpec; export 'src/chart/scatter_plot/scatter_plot_chart.dart' show ScatterPlotChart; export 'src/chart/scatter_plot/symbol_annotation_renderer.dart' show SymbolAnnotationRenderer; diff --git a/community_charts_common/lib/src/chart/common/behavior/line_point_highlighter.dart b/community_charts_common/lib/src/chart/common/behavior/line_point_highlighter.dart index f9a6047..fbc4750 100644 --- a/community_charts_common/lib/src/chart/common/behavior/line_point_highlighter.dart +++ b/community_charts_common/lib/src/chart/common/behavior/line_point_highlighter.dart @@ -123,7 +123,8 @@ class LinePointHighlighter implements ChartBehavior { // callback the caller with the selected point // - final void Function(List>? selectedDetails)? onHighLightDatumUpdated; + final void Function(List>? selectedDetails)? + onHighLightDatumUpdated; LinePointHighlighter( {SelectionModelType? selectionModelType, @@ -193,9 +194,10 @@ class LinePointHighlighter implements ChartBehavior { void _updateViewData() { _currentKeys.clear(); - final allSelectedDatumDetails = _chart.getSelectedDatumDetails(selectionModelType); - final selectedDatumDetails = allSelectedDatumDetails - .where((element) => _seriesIds == null || _seriesIds!.contains(element.series?.id)); + final allSelectedDatumDetails = + _chart.getSelectedDatumDetails(selectionModelType); + final selectedDatumDetails = allSelectedDatumDetails.where((element) => + _seriesIds == null || _seriesIds!.contains(element.series?.id)); // Create a new map each time to ensure that we have it sorted in the // selection model order. This preserves the "nearestDetail" ordering, so @@ -285,7 +287,7 @@ class LinePointHighlighter implements ChartBehavior { _seriesPointMap = newSeriesMap; _view.seriesPointMap = _seriesPointMap; - + onHighLightDatumUpdated?.call(allSelectedDatumDetails); } diff --git a/community_charts_common/lib/src/chart/line/line_renderer.dart b/community_charts_common/lib/src/chart/line/line_renderer.dart index 2a49887..706b37f 100644 --- a/community_charts_common/lib/src/chart/line/line_renderer.dart +++ b/community_charts_common/lib/src/chart/line/line_renderer.dart @@ -77,7 +77,11 @@ class LineRenderer extends BaseCartesianRenderer { LineRenderer._internal({required String rendererId, required this.config}) : _pointRenderer = PointRenderer( - config: PointRendererConfig(radiusPx: config.radiusPx, symbolRenderer: config.symbolRenderer, pointRendererDecorators: config.pointRendererDecorators,)), + config: PointRendererConfig( + radiusPx: config.radiusPx, + symbolRenderer: config.symbolRenderer, + pointRendererDecorators: config.pointRendererDecorators, + )), super( rendererId: rendererId, layoutPaintOrder: config.layoutPaintOrder, @@ -927,7 +931,7 @@ class LineRenderer extends BaseCartesianRenderer { // creation time, since chart onInit is called after the chart is created. _chart = chart; } - + @override void set graphicsFactory(GraphicsFactory? graphicsFactory) { super.graphicsFactory = graphicsFactory; diff --git a/community_charts_common/lib/src/chart/scatter_plot/point_label_decorator.dart b/community_charts_common/lib/src/chart/scatter_plot/point_label_decorator.dart index d69724c..ece2bf7 100644 --- a/community_charts_common/lib/src/chart/scatter_plot/point_label_decorator.dart +++ b/community_charts_common/lib/src/chart/scatter_plot/point_label_decorator.dart @@ -23,11 +23,13 @@ import '../common/chart_canvas.dart'; import 'point_renderer.dart'; import 'point_renderer_decorator.dart'; - class PointLabelSpec { final String label; final bool selected; - PointLabelSpec({required this.label, this.selected = false,}); + PointLabelSpec({ + required this.label, + this.selected = false, + }); } typedef LabelCallback = PointLabelSpec Function(Object? datum); @@ -42,14 +44,12 @@ class PointLabelDecorator extends PointRendererDecorator { TextStyle? _labelStyle; TextStyle? _selectedLabelStyle; - - PointLabelDecorator({ - this.labelStyleSpec, - this.selectedLabelStyleSpec, - required this.labelCallback, - this.horizontalPadding = 0, - this.verticalPadding = 0 - }); + PointLabelDecorator( + {this.labelStyleSpec, + this.selectedLabelStyleSpec, + required this.labelCallback, + this.horizontalPadding = 0, + this.verticalPadding = 0}); @override bool get renderAbove => true; @@ -58,14 +58,13 @@ class PointLabelDecorator extends PointRendererDecorator { void decorate(PointRendererElement pointElement, ChartCanvas canvas, GraphicsFactory graphicsFactory, {required Rectangle drawBounds, - required double animationPercent, - bool rtl = false}) { + required double animationPercent, + bool rtl = false}) { // Only decorate the bars when animation is at 100%. if (animationPercent != 1.0) { return; } - if (_labelStyle == null) { _initLabelStyle(graphicsFactory); } @@ -80,21 +79,21 @@ class PointLabelDecorator extends PointRendererDecorator { final labelY = point.y!.toInt() - verticalPadding; canvas.drawText(labelElement, labelX, labelY); - } void _initLabelStyle(GraphicsFactory graphicsFactory) { _labelStyle = _textStyleFromSpec(graphicsFactory, labelStyleSpec); - _selectedLabelStyle = - selectedLabelStyleSpec != null ? _textStyleFromSpec(graphicsFactory, selectedLabelStyleSpec) : _labelStyle; + _selectedLabelStyle = selectedLabelStyleSpec != null + ? _textStyleFromSpec(graphicsFactory, selectedLabelStyleSpec) + : _labelStyle; } - TextStyle? _textStyleFromSpec(GraphicsFactory graphicsFactory, TextStyleSpec? spec) { + TextStyle? _textStyleFromSpec( + GraphicsFactory graphicsFactory, TextStyleSpec? spec) { return graphicsFactory.createTextPaint() ..color = spec?.color ?? const Color(r: 0, g: 0, b: 0) ..fontFamily = spec?.fontFamily ..fontSize = spec?.fontSize ?? 12 ..fontWeight = spec?.fontWeight ?? '400'; } - } diff --git a/community_charts_common/pubspec.yaml b/community_charts_common/pubspec.yaml index ae37075..c162488 100644 --- a/community_charts_common/pubspec.yaml +++ b/community_charts_common/pubspec.yaml @@ -1,5 +1,5 @@ name: community_charts_common -version: 1.0.3 +version: 1.0.4 description: A common library for charting packages. Forked from google/charts. repository: https://github.com/juliansteenbakker/community_charts diff --git a/community_charts_common/test/chart/cartesian/cartesian_renderer_test.dart b/community_charts_common/test/chart/cartesian/cartesian_renderer_test.dart index 60f9ac1..b725fe8 100644 --- a/community_charts_common/test/chart/cartesian/cartesian_renderer_test.dart +++ b/community_charts_common/test/chart/cartesian/cartesian_renderer_test.dart @@ -54,7 +54,6 @@ class FakeCartesianRenderer extends BaseCartesianRenderer { @override DatumDetails addPositionToDetailsForSeriesDatum( DatumDetails details, SeriesDatum seriesDatum) { - assert(details != null); return details; } } diff --git a/community_charts_common/test/chart/common/behavior/selection/lock_selection_test.dart b/community_charts_common/test/chart/common/behavior/selection/lock_selection_test.dart index 63b5045..4db3ff7 100644 --- a/community_charts_common/test/chart/common/behavior/selection/lock_selection_test.dart +++ b/community_charts_common/test/chart/common/behavior/selection/lock_selection_test.dart @@ -62,9 +62,7 @@ void main() { } void _setupChart({Point forPoint, bool isWithinRenderer}) { - if (isWithinRenderer != null) { - when(_chart.pointWithinRenderer(forPoint)).thenReturn(isWithinRenderer); - } + when(_chart.pointWithinRenderer(forPoint)).thenReturn(isWithinRenderer); } setUp(() { diff --git a/community_charts_common/test/chart/common/behavior/selection/select_nearest_test.dart b/community_charts_common/test/chart/common/behavior/selection/select_nearest_test.dart index 9bec456..c975e4a 100644 --- a/community_charts_common/test/chart/common/behavior/selection/select_nearest_test.dart +++ b/community_charts_common/test/chart/common/behavior/selection/select_nearest_test.dart @@ -84,16 +84,10 @@ void main() { bool isWithinRenderer, List> respondWithDetails, List> seriesList}) { - if (isWithinRenderer != null) { - when(_chart.pointWithinRenderer(forPoint)).thenReturn(isWithinRenderer); - } - if (respondWithDetails != null) { - when(_chart.getNearestDatumDetailPerSeries(forPoint, true)) - .thenReturn(respondWithDetails); - } - if (seriesList != null) { - when(_chart.currentSeriesList).thenReturn(seriesList); - } + when(_chart.pointWithinRenderer(forPoint)).thenReturn(isWithinRenderer); + when(_chart.getNearestDatumDetailPerSeries(forPoint, true)) + .thenReturn(respondWithDetails); + when(_chart.currentSeriesList).thenReturn(seriesList); } setUp(() { diff --git a/community_charts_common/test/chart/common/behavior/series_legend_behavior_test.dart b/community_charts_common/test/chart/common/behavior/series_legend_behavior_test.dart index 618c6ea..9569b35 100644 --- a/community_charts_common/test/chart/common/behavior/series_legend_behavior_test.dart +++ b/community_charts_common/test/chart/common/behavior/series_legend_behavior_test.dart @@ -354,9 +354,9 @@ void main() { final seriesList = [series1, series2]; final selectionType = SelectionModelType.info; final measureFormatter = - (num value) => 'measure ${value?.toStringAsFixed(0)}'; + (num value) => 'measure ${value.toStringAsFixed(0)}'; final secondaryMeasureFormatter = - (num value) => 'secondary ${value?.toStringAsFixed(0)}'; + (num value) => 'secondary ${value.toStringAsFixed(0)}'; final legend = SeriesLegend( selectionModelType: selectionType, measureFormatter: measureFormatter, @@ -391,7 +391,7 @@ void main() { test('series legend - show measure sum when there is no selection', () { final seriesList = [series1, series2]; final selectionType = SelectionModelType.info; - final measureFormatter = (num value) => '${value?.toStringAsFixed(0)}'; + final measureFormatter = (num value) => '${value.toStringAsFixed(0)}'; final legend = SeriesLegend( selectionModelType: selectionType, legendDefaultMeasure: LegendDefaultMeasure.sum, @@ -424,7 +424,7 @@ void main() { test('series legend - show measure average when there is no selection', () { final seriesList = [series1, series2]; final selectionType = SelectionModelType.info; - final measureFormatter = (num value) => '${value?.toStringAsFixed(0)}'; + final measureFormatter = (num value) => '${value.toStringAsFixed(0)}'; final legend = SeriesLegend( selectionModelType: selectionType, legendDefaultMeasure: LegendDefaultMeasure.average, @@ -457,7 +457,7 @@ void main() { test('series legend - show first measure when there is no selection', () { final seriesList = [series1, series2]; final selectionType = SelectionModelType.info; - final measureFormatter = (num value) => '${value?.toStringAsFixed(0)}'; + final measureFormatter = (num value) => '${value.toStringAsFixed(0)}'; final legend = SeriesLegend( selectionModelType: selectionType, legendDefaultMeasure: LegendDefaultMeasure.firstValue, @@ -490,7 +490,7 @@ void main() { test('series legend - show last measure when there is no selection', () { final seriesList = [series1, series2]; final selectionType = SelectionModelType.info; - final measureFormatter = (num value) => '${value?.toStringAsFixed(0)}'; + final measureFormatter = (num value) => '${value.toStringAsFixed(0)}'; final legend = SeriesLegend( selectionModelType: selectionType, legendDefaultMeasure: LegendDefaultMeasure.lastValue, diff --git a/community_charts_common/test/chart/common/behavior/slider/slider_test.dart b/community_charts_common/test/chart/common/behavior/slider/slider_test.dart index 3b80f5d..c27c318 100644 --- a/community_charts_common/test/chart/common/behavior/slider/slider_test.dart +++ b/community_charts_common/test/chart/common/behavior/slider/slider_test.dart @@ -119,13 +119,9 @@ void main() { when(_chart.domainAxis).thenReturn(_domainAxis); when(_chart.getMeasureAxis()).thenReturn(_measureAxis); - if (isWithinRenderer != null) { - when(_chart.pointWithinRenderer(forPoint)).thenReturn(isWithinRenderer); - } - if (respondWithDetails != null) { - when(_chart.getNearestDatumDetailPerSeries(forPoint, true)) - .thenReturn(respondWithDetails); - } + when(_chart.pointWithinRenderer(forPoint)).thenReturn(isWithinRenderer); + when(_chart.getNearestDatumDetailPerSeries(forPoint, true)) + .thenReturn(respondWithDetails); } setUp(() { diff --git a/community_charts_flutter/CHANGELOG.md b/community_charts_flutter/CHANGELOG.md index a97ecf6..74f1804 100644 --- a/community_charts_flutter/CHANGELOG.md +++ b/community_charts_flutter/CHANGELOG.md @@ -1,4 +1,4 @@ -# 1.0.3 +# 1.0.4 * Added UserManagedState variable to be passed down into the super constructor on NumericComboChart and OrdinalComboChart * Add FontWeight support diff --git a/community_charts_flutter/example/lib/combo_chart/scatter_plot_line.dart b/community_charts_flutter/example/lib/combo_chart/scatter_plot_line.dart index 34dffbf..f2a1804 100644 --- a/community_charts_flutter/example/lib/combo_chart/scatter_plot_line.dart +++ b/community_charts_flutter/example/lib/combo_chart/scatter_plot_line.dart @@ -25,31 +25,31 @@ import 'package:flutter/material.dart'; class ScatterPlotComboLineChart extends StatelessWidget { final List> seriesList; final bool animate; - List selectedDomains = []; - late charts.PointRendererDecorator pointCustomDecorator; - - ScatterPlotComboLineChart(this.seriesList, {this.animate = false}): pointCustomDecorator = charts.PointLabelDecorator( - horizontalPadding: 6, - verticalPadding: 20, - selectedLabelStyleSpec: charts.TextStyleSpec( - color: charts.Color.fromHex(code: '#FF9560'), - fontWeight: '500', - fontSize: 14, - ), - labelCallback: (domain) { - if (domain is LinearSales?) { - // final selected = selectedDomains.contains(domain); - return charts.PointLabelSpec( - label: domain?.sales.toString() ?? '', - selected: false, - ); - } - return charts.PointLabelSpec( - label: '', - selected: false, - ); - }); - + final List selectedDomains = []; + late final charts.PointRendererDecorator pointCustomDecorator; + + ScatterPlotComboLineChart(this.seriesList, {this.animate = false}) + : pointCustomDecorator = charts.PointLabelDecorator( + horizontalPadding: 6, + verticalPadding: 20, + selectedLabelStyleSpec: charts.TextStyleSpec( + color: charts.Color.fromHex(code: '#FF9560'), + fontWeight: '500', + fontSize: 14, + ), + labelCallback: (domain) { + if (domain is LinearSales?) { + // final selected = selectedDomains.contains(domain); + return charts.PointLabelSpec( + label: domain?.sales.toString() ?? '', + selected: false, + ); + } + return charts.PointLabelSpec( + label: '', + selected: false, + ); + }); /// Creates a [ScatterPlotChart] with sample data and no transition. factory ScatterPlotComboLineChart.withSampleData() { @@ -131,8 +131,6 @@ class ScatterPlotComboLineChart extends StatelessWidget { } // EXCLUDE_FROM_GALLERY_DOCS_END - - @override Widget build(BuildContext context) { return new charts.ScatterPlotChart(seriesList, @@ -142,11 +140,10 @@ class ScatterPlotComboLineChart extends StatelessWidget { // // This is the default configuration, but is shown here for // illustration. - defaultRenderer: new charts.PointRendererConfig( - pointRendererDecorators: [ - pointCustomDecorator, - ] - ), + defaultRenderer: + new charts.PointRendererConfig(pointRendererDecorators: [ + pointCustomDecorator, + ]), // Custom renderer configuration for the line series. customSeriesRenderers: [ new charts.LineRendererConfig( diff --git a/community_charts_flutter/lib/src/behaviors/line_point_highlighter.dart b/community_charts_flutter/lib/src/behaviors/line_point_highlighter.dart index 1cc5c6f..8281ca5 100644 --- a/community_charts_flutter/lib/src/behaviors/line_point_highlighter.dart +++ b/community_charts_flutter/lib/src/behaviors/line_point_highlighter.dart @@ -31,7 +31,11 @@ class HighlighterPointInfo { final T? datum; final String seriesId; - HighlighterPointInfo({this.point, this.datum, required this.seriesId,}); + HighlighterPointInfo({ + this.point, + this.datum, + required this.seriesId, + }); } /// Chart behavior that monitors the specified [SelectionModel] and darkens the @@ -81,7 +85,8 @@ class LinePointHighlighter extends ChartBehavior { final common.SymbolRenderer? symbolRenderer; final List? seriesIds; - final void Function(List>? selectedDetails)? onHighLightDatumUpdated; + final void Function(List>? selectedDetails)? + onHighLightDatumUpdated; LinePointHighlighter( {this.selectionModelType, @@ -107,7 +112,14 @@ class LinePointHighlighter extends ChartBehavior { drawFollowLinesAcrossChart: drawFollowLinesAcrossChart, symbolRenderer: symbolRenderer, seriesIds: seriesIds, - onHighLightDatumUpdated: (selectedDetails) => onHighLightDatumUpdated?.call(selectedDetails?.map((e) => HighlighterPointInfo(seriesId: e.series?.id ?? '', point: e.chartPosition, datum: e.datum,)).toList()), + onHighLightDatumUpdated: (selectedDetails) => + onHighLightDatumUpdated?.call(selectedDetails + ?.map((e) => HighlighterPointInfo( + seriesId: e.series?.id ?? '', + point: e.chartPosition, + datum: e.datum, + )) + .toList()), ); @override diff --git a/community_charts_flutter/lib/src/chart_container.dart b/community_charts_flutter/lib/src/chart_container.dart index 03a2554..a68e786 100644 --- a/community_charts_flutter/lib/src/chart_container.dart +++ b/community_charts_flutter/lib/src/chart_container.dart @@ -62,13 +62,15 @@ class ChartContainer extends CustomPaint { } @override - void updateRenderObject(BuildContext context, ChartContainerRenderObject renderObject) { + void updateRenderObject( + BuildContext context, ChartContainerRenderObject renderObject) { renderObject.reconfigure(this, context); } } /// [RenderCustomPaint] that implements common [ChartContext]. -class ChartContainerRenderObject extends RenderCustomPaint implements common.ChartContext { +class ChartContainerRenderObject extends RenderCustomPaint + implements common.ChartContext { common.BaseChart? _chart; List>? _seriesList; late BaseChartState _chartState; @@ -81,8 +83,9 @@ class ChartContainerRenderObject extends RenderCustomPaint implements common. void reconfigure(ChartContainer config, BuildContext context) { _chartState = config.chartState; - _dateTimeFactory = - (config.chartWidget is TimeSeriesChart) ? (config.chartWidget as TimeSeriesChart).dateTimeFactory : null; + _dateTimeFactory = (config.chartWidget is TimeSeriesChart) + ? (config.chartWidget as TimeSeriesChart).dateTimeFactory + : null; _dateTimeFactory ??= new common.LocalDateTimeFactory(); if (_chart == null) { @@ -92,7 +95,8 @@ class ChartContainerRenderObject extends RenderCustomPaint implements common. common.Performance.timeEnd('chartsCreate'); } common.Performance.time('chartsConfig'); - config.chartWidget.updateCommonChart(_chart!, config.oldChartWidget, _chartState); + config.chartWidget + .updateCommonChart(_chart!, config.oldChartWidget, _chartState); _rtlSpec = config.rtlSpec; _chartContainerIsRtl = config.rtl; @@ -109,7 +113,8 @@ class ChartContainerRenderObject extends RenderCustomPaint implements common. // does not reprocess the series. // // Series list is considered "changed" based on the instance. - if (_seriesList != config.chartWidget.seriesList || _chartState.chartIsDirty) { + if (_seriesList != config.chartWidget.seriesList || + _chartState.chartIsDirty) { _chartState.resetChartDirtyFlag(); _seriesList = config.chartWidget.seriesList; @@ -148,10 +153,12 @@ class ChartContainerRenderObject extends RenderCustomPaint implements common. for (common.SelectionModelType type in newState.selectionModels.keys) { final model = _chart!.getSelectionModel(type); - final userModel = newState.selectionModels[type]!.getModel(_chart!.currentSeriesList); + final userModel = + newState.selectionModels[type]!.getModel(_chart!.currentSeriesList); if (model != userModel) { - model.updateSelection(userModel.selectedDatum, userModel.selectedSeries); + model.updateSelection( + userModel.selectedDatum, userModel.selectedSeries); } } } @@ -159,7 +166,8 @@ class ChartContainerRenderObject extends RenderCustomPaint implements common. @override void performLayout() { common.Performance.time('chartsLayout'); - _chart!.measure(constraints.maxWidth.toInt(), constraints.maxHeight.toInt()); + _chart! + .measure(constraints.maxWidth.toInt(), constraints.maxHeight.toInt()); _chart!.layout(constraints.maxWidth.toInt(), constraints.maxHeight.toInt()); common.Performance.timeEnd('chartsLayout'); size = constraints.biggest; @@ -245,7 +253,9 @@ class ChartContainerRenderObject extends RenderCustomPaint implements common. @override bool get isRtl => - _chartContainerIsRtl && (_rtlSpec == null || _rtlSpec?.axisDirection == common.AxisDirection.reversed); + _chartContainerIsRtl && + (_rtlSpec == null || + _rtlSpec?.axisDirection == common.AxisDirection.reversed); @override bool get isTappable => _chart!.isTappable; @@ -256,10 +266,12 @@ class ChartContainerRenderObject extends RenderCustomPaint implements common. /// Gets the chart's gesture listener. common.ProxyGestureListener get gestureProxy => _chart!.gestureProxy; - TextDirection get textDirection => _chartContainerIsRtl ? TextDirection.rtl : TextDirection.ltr; + TextDirection get textDirection => + _chartContainerIsRtl ? TextDirection.rtl : TextDirection.ltr; @override - void enableA11yExploreMode(List nodes, {String? announcement}) { + void enableA11yExploreMode(List nodes, + {String? announcement}) { _a11yNodes = nodes; _exploreMode = true; _setNewPainter(); @@ -315,12 +327,18 @@ class ChartContainerCustomPaint extends CustomPainter { return oldPainter; } else { return new ChartContainerCustomPaint._internal( - chart: chart, exploreMode: exploreMode, a11yNodes: a11yNodes, textDirection: textDirection); + chart: chart, + exploreMode: exploreMode, + a11yNodes: a11yNodes, + textDirection: textDirection); } } ChartContainerCustomPaint._internal( - {required this.chart, required this.exploreMode, required this.a11yNodes, required this.textDirection}); + {required this.chart, + required this.exploreMode, + required this.a11yNodes, + required this.textDirection}); @override void paint(Canvas canvas, Size size) { @@ -349,12 +367,17 @@ class ChartContainerCustomPaint extends CustomPainter { final nodes = []; for (common.A11yNode node in a11yNodes) { - final rect = new Rect.fromLTWH(node.boundingBox.left.toDouble(), node.boundingBox.top.toDouble(), - node.boundingBox.width.toDouble(), node.boundingBox.height.toDouble()); + final rect = new Rect.fromLTWH( + node.boundingBox.left.toDouble(), + node.boundingBox.top.toDouble(), + node.boundingBox.width.toDouble(), + node.boundingBox.height.toDouble()); nodes.add(new CustomPainterSemantics( rect: rect, properties: new SemanticsProperties( - value: node.label, textDirection: textDirection, onDidGainAccessibilityFocus: node.onFocus))); + value: node.label, + textDirection: textDirection, + onDidGainAccessibilityFocus: node.onFocus))); } return nodes; diff --git a/community_charts_flutter/pubspec.yaml b/community_charts_flutter/pubspec.yaml index f31239d..10338f4 100644 --- a/community_charts_flutter/pubspec.yaml +++ b/community_charts_flutter/pubspec.yaml @@ -1,5 +1,5 @@ name: community_charts_flutter -version: 1.0.3 +version: 1.0.4 description: Material Design charting library for flutter. Forked from google/charts. repository: https://github.com/juliansteenbakker/community_charts @@ -15,7 +15,7 @@ dependencies: # # The pub version of community_charts_flutter will point to the pub version of community_charts_common. # The latest pub version is commented out and shown below as an example. - community_charts_common: ^1.0.3 + community_charts_common: ^1.0.4 # community_charts_common: # path: ../community_charts_common/ flutter: