Hi I am writing a Dart app and I am getting the error:
type 'Screen' is not a subtype of type 'Screen' of 'function result'.
I have literally no idea what the actual error is?
My code is as follows:
class CanvasManager {
Map<String, Screen> _canvases = new Map<String, Screen>();
CanvasManager (Map<String, CanvasElement> reqCanvas, int sizeX, int sizeY, bool fullscreen) {
reqCanvas.forEach((k,v) {
_canvases[k] = new Screen.create(v, sizeX, sizeY, fullscreen);
});
}
Screen getCanvas(String c) {
if (_canvases.containsKey(c)) {
return _canvases[c];
}
else throw "No such canvas with key ${c}";
}
}
For some reason when I instance that class I get the error.
Just to note Screen
is a class I have also created. As I'm completely baffeled I don't know if it will help you by giving you that class as well. It's somewhat long so I will paste-bin it: http://pastebin.com/KvZ54yPe