dart - Dart 忽略依赖性?

标签 dart redstone.dart

如何忽略项目中的依赖关系?

我的项目设置是:

项目A:取决于 Angular2 和取决于基础

项目基础:取决于 Redstone_mapper_mongo

问题是我想在Project A中使用angular2,具体取决于我的Project Foundation。但是,项目基金会使用红石映射器mongo,但是angular2和红石映射器mongo不能一起工作。

问题:

所以在我的基础上是这样的。我可以忽略项目A中的@Field(),@ NotEmpty和导入吗?这样,在Project A中, Angular 操作就可以了吗? 因此,不应在Project A中加载红石映射器mongo。但是我该怎么做?

import 'package:redstone_mapper/mapper.dart';

class Address {
  @Field()
  @NotEmpty()
  String street;

  @Field()
  @NotEmpty()
  String city;
}

[更新]

我的项目A中现在有这些依赖项。我加了
code_transformers:^ 0.5.1

项目A pubspec.yaml
dependencies:
      angular: "^4.0.0+2"
      angular_forms: "^1.0.0"
      foundation:
         path: ../foundation
    dependency_overrides:
        code_transformers: ^0.5.1



    dev_dependencies:
      angular_test: ^1.0.0
      browser: ^0.10.0
      dart_to_js_script_rewriter: ^1.0.1
      test: ^0.12.30

    transformers:
    - angular:
        entry_points:
        - web/main.dart
        - test/**_test.dart
    - test/pub_serve:
        $include: test/**_test.dart
    - dart_to_js_script_rewriter

基金会pubspec.yaml
dependencies:
  intl: "^0.15.2"
  http: "^0.11.3+16"
  great_circle_distance: "^1.0.1"
  redstone_mapper_mongo: "0.2.0-beta.1"
  jaguar_serializer: "^0.5.1"

dev_dependencies:
  browser: "^0.10.0+2"
  dart_to_js_script_rewriter: "^1.0.3"

transformers:
  - dart_to_js_script_rewriter

最佳答案

在Angular项目中添加

dependency_overrides:
  code_transformers: ^0.5.1
  analyzer: 0.30.0+4

应该修复它

关于dart - Dart 忽略依赖性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49129032/

相关文章:

dart - 获取具有用 Redstone 的 @Field() 注释的字段的类

dart - 使用Redstone服务网页

dart - 在红石拦截器中访问当前路线元数据

android - Flutter - json_serializable fromJson : The method '[]' was called on null

dart - 如何在构造函数的主体中初始化final字段?

flutter - 如何在 Flutter 中更改 BLoC 中的事件?

google-maps - 如何使用 Flutter/Dart 在 map 上添加标记点击/单击?

Dart:处理来自另一个包的异常

dart - 用红石批处理URL

json - 使用Redstone Mapper解码Dart中的List <int>