代码之家  ›  专栏  ›  技术社区  ›  Bram Vanbilsen

无法运行DART 2命令行程序

  •  0
  • Bram Vanbilsen  · 技术社区  · 7 年前

    我正试图用DART 2编写一个简单的命令行程序。我以前用过dart 2,但是在运行我的命令行应用程序时,我不能让它正常工作。
    我收到以下错误:

    NoSuchMethodError: Attempted to use type '_Testtt' as a function. Since types do not define a method 'call', this is not possible. Did you intend to call the _Testtt constructor and forget the 'new' operator?
    Receiver: _Testtt
    

    我相信我的课没有什么问题。另外,在vs代码中,它认识到它实际上是一个构造函数。
    我用的是飞镖版本,随船飘动。

    有人有主意吗?

    DART版本:

    Dart VM version: 2.0.0-dev.59.0.flutter-ff815d05a5 (Tue May 29 20:01:09 2018 +0000) on "windows_x64"
    

    公共规范:

    environment:
      sdk: '>=2.0.0-dev.55.0 <2.0.0'
    
    dependencies:
      http: "^0.11.3+16"
    
    dev_dependencies:
      test: ^0.12.30
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Richard Heap    7 年前

    dev channel

    new --preview-dart-2