gpt4 book ai didi

flutter - 为什么迁移到 flutter 3.3.0 后 Build 失败?

转载 作者:行者123 更新时间:2023-12-05 05:34:47 26 4
gpt4 key购买 nike

lib/src/domain/application/bloc/app/app_bloc.freezed.dart:87:23:

错误:“InitAppUseCase”类不能用作混合,因为它扩展了“Object”以外的类。

类 _$_InitApp 和 InitAppUseCase 实现 _InitApp {

最佳答案

如果你使用抽象类作为mixin:

抽象类 InitAppUseCase 扩展 SomeMixin{...}

然后尝试使用“implements”而不是“extends”。如果你使用 mixin 然后使用 'on':

在 SomClass 上混合 InitAppUseCase{...}

在 flutter 3.3.0 之前,您可以通过以下方式修复它:

analyzer:
strong-mode: true
errors:
mixin_inherits_from_not_object: ignore

但更新后似乎无法使用。更多信息 Dart 2 Mixin Declarations

关于flutter - 为什么迁移到 flutter 3.3.0 后 Build 失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73609693/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com