Runtime type errors from Range.integers in pie_layout.dart
gian opened this issue · 3 comments
gian commented
Hi there,
I've hit a type error when running the examples (and my own code...):
Exception: type 'List<num>' is not a subtype of type 'List<int>' of 'index' where
List is from dart:core
num is from dart:core
List is from dart:core
int is from dart:core
PieLayout.layout | @ | package:charted/layout/src/pie_layout.dart:53
-- | -- | --
PieChartRenderer.layout | @ | package:charted/charts/layout_renderers/pie_chart_renderer.dart:108
DefaultLayoutAreaImpl.draw | @ | package:charted/charts/src/layout_area_impl.dart:250
drawSimplePieChart | @ | demo_pie_charts.dart:25
main | @ | demo_pie_charts.dart:50
The offending line is:
List<int> index = new Range.integers(values.length).toList();
Which appears to relate to the inferred bound on Range.integers
being List<num>
.
This isn't insurmountable because it only occurs in Dartium, and this works as expected when using dartdevc in regular ol' Chrome instead --- it's just slightly frustrating given my workflow.
I encountered this issue using charted 0.5.0 and dart 1.24.3.
Thanks for the release of charted!
midoringo8823 commented
Will get this fixed soon
gian commented
Thanks, really appreciate the fix!