Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Abstract class error #26

Open
danielmcquillen opened this issue Aug 7, 2018 · 8 comments
Open

Abstract class error #26

danielmcquillen opened this issue Aug 7, 2018 · 8 comments

Comments

@danielmcquillen
Copy link

danielmcquillen commented Aug 7, 2018

I was using chartjs successfully in my AngularDart project up until this morning when I started upgrading to the 2.0.0 official public release (I was using the 2.0.65 dev release).

The compiler now complains about code like this

ChartXAxe xAxe = new ChartXAxe();

with an error of:

error: Abstract classes can't be created with a 'new' expression.

Am I using the library wrong when I try to instantiate things like ChartXAxe when building up my chart in the component .dart class?

@danielmcquillen
Copy link
Author

danielmcquillen commented Aug 7, 2018

Sorry, I forgot this is the same issue as the one @portno logged: #22 .

@kasumi21
Copy link

kasumi21 commented Aug 9, 2018

I'm not sure if it's the same error:
I started to upgrade to Dart 2.0.0 (official stable release), I'm using chartjs: ^0.5.0 and in the javascript I imported the Chartjs 2.6.0 (like the example), but still I have this errors:
Error: The class 'ChartAnimationOptions' is abstract and can't be instantiated.
Error: No named parameter with the name 'duration'.
Error: The class 'ChartTooltipCallback' is abstract and can't be instantiated.
Error: No named parameter with the name 'title'.
Code:
ChartConfiguration config = new ChartConfiguration( type: 'doughnut', data: data, options: new ChartOptions( animation: new ChartAnimationOptions(duration: 0), tooltips: new ChartTooltipOptions( callbacks: new ChartTooltipCallback( title: allowInterop((tooltipItems, data) { return data.labels[tooltipItems[0].index] + ": " + "${data.datasets[tooltipItems[0].datasetIndex].data[tooltipItems[0].index]}%"; }), label: allowInterop((tooltipItem, data) { return; })))));

With the previous version of dart worked.

@enyo
Copy link

enyo commented Aug 9, 2018

Yup, just ran into the same issue. Seems as if the external factory constructors for some classes are missing.

@enyo
Copy link

enyo commented Aug 27, 2018

Is there any update on this?

@romanoffs
Copy link

I have the same problem.
When I try to inherit an abstract class, I get the error: Uncaught TypeError: Class extends value undefined is not a constructor or null

@kevmoo
Copy link
Contributor

kevmoo commented Oct 6, 2018 via email

@romanoffs
Copy link

Pull requests are welcome. I built this sample out as example of Dart-JS interop. I don't have the bandwidth to maintain it actively.

On Sat, Oct 6, 2018 at 2:38 AM Денис @.***> wrote: I have the same problem. When I try to inherit an abstract class, I get the error: Uncaught TypeError: Class extends value undefined is not a constructor or null — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#26 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AABCisFYGMYBZnGTwlBGnf41a9PMuWLgks5uiHodgaJpZM4Vy-GI .

Thank you! I have already added the factories I need

@Timmmm
Copy link

Timmmm commented Oct 1, 2019

ChartAnimationOptions is still missing its options. I'd add it but I'm not sure how to handle the callbacks. :-/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants