1

我的main.dart文件如下所示:

import 'dart:html';
import 'package:stagexl/stagexl.dart' as stageXL;

void main() {
  CanvasElement canvas = querySelector("#canvas");
  stageXL.Stage stage = new stageXL.Stage(canvas, width: 300, height: 400);
  stageXL.RenderLoop renderLoop = new stageXL.RenderLoop();
  renderLoop.addStage(stage);
}

但是pub serve在 dartium 中运行 index.html 之后,我得到了

Internal error: 'package:stagexl/src/events/event_dispatcher.dart': error: 
line 43 pos 20: unexpected token '<'
EventStream<T> on<T extends Event>(String eventType) {
                 ^

错误。我究竟做错了什么?

4

0 回答 0