I have a function that accepts CanvasRenderingContext2D as a parameter and does the drawing. Whenever I try to pass it, I get this:
CanvasRenderingContext2D is not assignable to CanvasRenderingContext2D
That function looks like this:
void draw(CanvasRenderingContext2D context) {
...
}
I thought everything is passed as a reference in Dart (just like JS), which shouldn't cause such problems. Is there a way to say I want a reference to the object and not the object it self? Or is there something else I should know?
EDIT:
The problem was that in one file I imported dart:html and in another I had dart:dom. The names for corresponding interfaces are the same but they are different.