google / charts

https://pub.dev/packages/charts_flutter
Apache License 2.0
2.8k stars 1.2k forks source link

ArcRendererElement type casting issue. #713

Open anilkumarmeena opened 2 years ago

anilkumarmeena commented 2 years ago

Error comming ==> type 'List<ArcRendererElement>' is not a subtype of type 'List<ArcRendererElement>?' in type cast

Please update the type or typecasting. solution1. (/lib/src/chart/pie/arcrenderer.dart line 31). const arcElementsKey = AttributeKey<List<ArcRendererElement>>('ArcRenderer.elements'); can change Object to dynamic will solve it

solution 2. we can change where typecasting is present.

MartinCastellon commented 2 years ago

Is there going to be a fix soon for the upcoming versions?

raphael-bmec-co commented 2 years ago

incase anyone else ends up here: https://github.com/google/charts/issues/651

Innocentkonan93 commented 2 years ago

you must to set the type like this charts.PieChart(...);

amirVirtuenetz commented 2 years ago

Error comming ==> type 'List' is not a subtype of type 'List?' in type cast

Please update the type or typecasting. solution1. (/lib/src/chart/pie/arcrenderer.dart line 31). const arcElementsKey = AttributeKey<List>('ArcRenderer.elements'); can change Object to dynamic will solve it

solution 2. we can change where typecasting is present.

its gives me another errors while i set it up according to your solutions type 'ArcRenderer' is not a subtype of type 'SeriesRenderer?' in type cast

rufw91 commented 2 years ago

Error comming ==> type 'List' is not a subtype of type 'List?' in type cast Please update the type or typecasting. solution1. (/lib/src/chart/pie/arcrenderer.dart line 31). const arcElementsKey = AttributeKey('ArcRenderer.elements'); can change Object to dynamic will solve it solution 2. we can change where typecasting is present.

its gives me another errors while i set it up according to your solutions type 'ArcRenderer' is not a subtype of type 'SeriesRenderer?' in type cast

Post your PieChart Code so.