flutter generate不会注释测试目录的类

时间:2019-05-22 02:19:28

标签: dependency-injection flutter flutter-dependencies flutter-test

因此,我尝试使用flutter generate

inject.dart生成类DI类

它似乎在lib / *下生成类,但不为test / *生成类。它不会引发任何错误。这是我相关的扑扑课。

pubspec.yaml

name: gc_client
description: A gc

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  json_annotation: ^2.0.0
  rxdart: ^0.22.0
  dio: ^2.1.3
  inject:
    path: ./inject.dart/package/inject

builders:
  json_serializable: ^2.0.0
  inject_generator:
    path: ./inject.dart/package/inject_generator

dev_dependencies:
  test: 1.6.1
  flutter_test:
    sdk: flutter
  mockito: ^4.0.0


flutter:

  uses-material-design: true

  fonts:
  - family: Raleway
    fonts:
    - asset: assets/fonts/raleway_regular.ttf
    - asset: assets/fonts/raleway_medium.ttf
      weight: 700

  assets:
  - assets/

组件类

The two injection components

我想念什么吗?让我知道您是否需要更多信息。预先感谢。

1 个答案:

答案 0 :(得分:0)

问题出在构建运行器上。

以下是与此相关的修复程序

https://github.com/flutter/flutter/issues/33266