跳到主要内容

诊断消息

本页面列出了 Dart 分析器生成的诊断消息,并详细说明了这些消息的含义以及如何修改代码。有关分析器的更多信息,请参阅 自定义静态分析

诊断索引

#

分析器会为不符合语言规范或可能以意外方式工作的代码生成以下诊断信息。

如果诊断信息有额外的文档和指导,请点击 了解更多 查看。

abi_specific_integer_invalid

扩展 'AbiSpecificInteger' 的类必须恰好有一个 const 构造函数,没有其他成员,并且没有类型参数。

了解详情
abi_specific_integer_mapping_extra

扩展 'AbiSpecificInteger' 的类必须恰好有一个 'AbiSpecificIntegerMapping' 注解,指定从 ABI 到固定大小的 'NativeType' 整数的映射。

了解详情
abi_specific_integer_mapping_missing

扩展 'AbiSpecificInteger' 的类必须恰好有一个 'AbiSpecificIntegerMapping' 注解,指定从 ABI 到固定大小的 'NativeType' 整数的映射。

了解详情
abi_specific_integer_mapping_unsupported

无效映射到 '{0}';仅支持映射到 'Int8', 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'UInt32', and 'Uint64'。

了解详情
abstract_class_member

类的成员不能声明为 'abstract'。

abstract_external_field

字段不能同时声明为 'abstract' 和 'external'。

abstract_field_initializer

抽象字段不能有初始化器。

了解详情
abstract_final_base_class

'abstract' 类不能同时声明为 'final' 和 'base'。

abstract_final_interface_class

'abstract' 类不能同时声明为 'final' 和 'interface'。

abstract_late_field

抽象字段不能是 late。

abstract_sealed_class

'sealed' 类不能标记为 'abstract',因为它已经隐式抽象。

了解详情
abstract_static_field

静态字段不能声明为 'abstract'。

abstract_static_method

静态方法不能声明为 'abstract'。

abstract_super_member_reference

在超类型中,{0} '{1}' 始终是抽象的。

了解详情
address_position

'.address' 表达式只能用作叶子本地外部调用的参数。

了解详情
address_receiver

'.address' 的接收器必须是具体的 'TypedData',具体的 'TypedData' '[]','Array','Array' '[]',Struct 字段或 Union 字段。

了解详情
ambiguous_export

名称 '{0}' 在库 '{1}' 和 '{2}' 中定义。

了解详情
ambiguous_extension_member_access

名称 '{0}' 在 '{1}' 和 '{2}' 中定义,且没有更具体的。

名称 '{0}' 在 {1} 中定义,且没有更具体的。

了解详情
ambiguous_import

名称 '{0}' 在库 {1} 中定义。

了解详情
ambiguous_set_or_map_literal_both

字面量不能是 map 也不能是 set,因为它包含至少一个字面量 map 条目或展开操作符展开 'Map',以及至少一个既非上述两者之一的元素。

了解详情
ambiguous_set_or_map_literal_either

此字面量必须是 map 或 set,但元素没有足够的信息进行类型推断。

了解详情
analysis_option_deprecated

选项 '{0}' 已不再支持。

annotation_on_pointer_field

类型为 'Pointer' 的结构类字段不应有任何注解。

了解详情
annotation_on_type_argument

类型参数不能有注解,因为它们不是声明。

annotation_space_before_parenthesis

注解在括号前不能有空格或注释。

annotation_with_type_arguments

注解不能使用类型参数。

annotation_with_type_arguments_uninstantiated

带类型参数的注解后面必须跟参数列表。

argument_must_be_a_constant

参数 '{0}' 必须是常量。

了解详情
argument_must_be_native

'Native.addressOf' 的参数必须用 @Native 注解

了解详情
argument_type_not_assignable

参数类型 '{0}' 不能赋值给参数类型 '{1}'。{2}

了解详情
argument_type_not_assignable_to_error_handler

参数类型 '{0}' 不能赋值给参数类型 '{1} Function(Object)' 或 '{1} Function(Object, StackTrace)'。

了解详情
assert_in_redirecting_constructor

重定向构造函数不能有 'assert' 初始化器。

了解详情
asset_directory_does_not_exist

资源目录 '{0}' 不存在。

了解详情
asset_does_not_exist

资源文件 '{0}' 不存在。

了解详情
asset_field_not_list

'assets' 字段的值应为相对文件路径列表。

了解详情
asset_missing_path

资产 map 条目必须包含 'path' 字段。

了解详情
asset_not_string

资产要求是文件路径(字符串)。

了解详情
asset_not_string_or_map

资产值要求是文件路径(字符串)或 map。

了解详情
asset_path_not_string

资产路径要求是文件路径(字符串)。

了解详情
assignment_of_do_not_store

'{0}' 被标记为 'doNotStore',不应赋值给字段或顶级变量。

了解详情
assignment_to_const

常量变量初始化后不能再赋值。

了解详情
assignment_to_final

'{0}' 不能用作 setter,因为它是 final 的。

了解详情
assignment_to_final_local

final 变量 '{0}' 只能设置一次。

了解详情
assignment_to_final_no_setter

类 '{1}' 中没有名为 '{0}' 的 setter。

了解详情
assignment_to_function

函数不能赋值。

了解详情
assignment_to_method

方法不能赋值。

了解详情
assignment_to_type

类型不能赋值。

了解详情
async_for_in_wrong_context

异步 for-in 循环只能在异步函数中使用。

了解详情
async_keyword_used_as_identifier

关键字 'await' 和 'yield' 不能在异步或生成器函数中用作标识符。

augmentation_extends_clause_already_present

增强具有 'extends' 子句,但增强目标已包含 'extends' 子句,不允许重复或更改。

augmentation_modifier_extra

增强具有声明没有的 '{0}' 修饰符。

augmentation_modifier_missing

增强缺少声明具有的 '{0}' 修饰符。

augmentation_of_different_declaration_kind

无法使用 {1} 增强 {0}。

augmentation_type_parameter_bound

增强类型参数必须与声明的相应类型参数具有相同的边界。

augmentation_type_parameter_count

增强必须具有与声明相同数量的类型参数。

augmentation_type_parameter_name

增强类型参数必须与声明的相应类型参数具有相同的名称。

augmentation_without_declaration

要增强的声明不存在。

augmented_expression_is_not_setter

增强的声明不是 setter,不能用于写入值。

augmented_expression_is_setter

增强的声明是 setter,不能用于读取值。

augmented_expression_not_operator

包含的增强不增强操作符 '{0}'。

await_in_late_local_variable_initializer

'await' 表达式不能在 'late' 局部变量的初始化器中使用。

了解详情
await_in_wrong_context

await 表达式只能在 async 函数中使用。

await_of_incompatible_type

'await' 表达式不能用于扩展类型不是 'Future' 子类型的表达式。

了解详情
base_enum

枚举不能声明为 'base'。

binary_operator_written_out

二元运算符 '{0}' 写为 '{1}' 而不是写出的单词。

body_might_complete_normally

函数体可能正常完成,导致返回 'null',但返回类型 '{0}' 是一个潜在的非 null 类型。

了解详情
body_might_complete_normally_catch_error

此 'onError' 处理器必须返回一个可赋值给 '{0}' 的值,但其末尾没有返回值。

了解详情
body_might_complete_normally_nullable

此函数的返回类型是可空类型 '{0}',但其末尾没有返回值。

了解详情
break_label_on_switch_member

break 标签解析为 'case' 或 'default' 语句。

了解详情
break_outside_of_loop

break 语句不能在循环或 switch 语句之外使用。

built_in_identifier_as_type

内置标识符 '{0}' 不能用作类型。

了解详情
built_in_identifier_in_declaration

内置标识符 '{0}' 不能用作前缀名。

内置标识符 '{0}' 不能用作类型名。

内置标识符 '{0}' 不能用作类型参数名。

内置标识符 '{0}' 不能用作 typedef 名。

内置标识符 '{0}' 不能用作扩展名。

内置标识符 '{0}' 不能用作扩展类型名。

了解详情
camera_permissions_incompatible

相机权限使应用与 Chrome OS 不兼容,考虑添加可选功能 "android.hardware.camera" 和 "android.hardware.camera.autofocus"。

case_block_not_terminated

'case' 的最后一条语句应为 'break', 'continue', 'rethrow', 'return' 或 'throw'。

了解详情
case_expression_type_implements_equals

switch case 表达式类型 '{0}' 不能覆盖 '==' 操作符。

了解详情
case_expression_type_is_not_switch_expression_subtype

switch case 表达式类型 '{0}' 必须是 switch 表达式类型 '{1}' 的子类型。

了解详情
cast_from_nullable_always_fails

此转换总是会抛出异常,因为可空局部变量 '{0}' 未赋值。

了解详情
cast_from_null_always_fails

此转换总是会抛出异常,因为表达式总是评估为 'null'。

了解详情
cast_to_non_type

名称 '{0}' 不是类型,因此不能在 'as' 表达式中使用。

了解详情
catch_syntax

'catch' 后面必须是 '(identifier)' 或 '(identifier, identifier)'。

catch_syntax_extra_parameters

'catch' 后面必须是 '(identifier)' 或 '(identifier, identifier)'。

class_instantiation_access_to_member

类 '{0}' 没有名为 '{1}' 的构造函数。

不能通过类实例化访问实例成员 '{0}'。

不能通过类实例化访问静态成员 '{0}'。

class_in_class

类不能在其他类内部声明。

class_used_as_mixin

类 '{0}' 不能用作 mixin,因为它既不是 mixin 类也不是 mixin。

了解详情
collection_element_from_deferred_library

来自延迟加载库的常量值不能用作 'const' map 字面量中的键。

来自延迟加载库的常量值不能用作 'const' 构造函数中的值。

来自延迟加载库的常量值不能用作 'const' list 字面量中的值。

来自延迟加载库的常量值不能用作 'const' map 字面量中的值。

来自延迟加载库的常量值不能用作 'const' set 字面量中的值。

了解详情
colon_in_place_of_in

For-in 循环使用 'in' 而不是冒号。

compound_implements_finalizable

类 '{0}' 不能实现 Finalizable。

了解详情
concrete_class_has_enum_superinterface

具体类不能将 'Enum' 作为超接口。

了解详情
concrete_class_with_abstract_member

'{0}' 必须有方法体,因为 '{1}' 不是抽象的。

了解详情
conflicting_constructor_and_static_member

在此类中,'{0}' 不能同时用作构造函数和静态字段的名称。

在此类中,'{0}' 不能同时用作构造函数和静态 getter 的名称。

在此类中,'{0}' 不能同时用作构造函数和静态方法的名称。

在此类中,'{0}' 不能同时用作构造函数和静态 setter 的名称。

了解详情
conflicting_field_and_method

类 '{0}' 不能定义字段 '{1}' 并拥有同名方法 '{2}.{1}'。

conflicting_generic_interfaces

{0} '{1}' 不能同时实现 '{2}' 和 '{3}',因为类型参数不同。

了解详情
conflicting_inherited_method_and_setter

{0} '{1}' 不能同时继承名为 '{2}' 的方法和 setter。

conflicting_method_and_field

类 '{0}' 不能定义方法 '{1}' 并拥有同名字段 '{2}.{1}'。

conflicting_modifiers

成员不能同时声明为 '{0}' 和 '{1}'。

conflicting_static_and_instance

类 '{0}' 不能定义静态成员 '{1}' 并拥有同名实例成员 '{2}.{1}'。

conflicting_type_variable_and_container

'{0}' 不能同时用作类型参数的名称和定义该类型参数的类的名称。

'{0}' 不能同时用作类型参数的名称和定义该类型参数的枚举的名称。

'{0}' 不能同时用作类型参数的名称和定义该类型参数的扩展的名称。

'{0}' 不能同时用作类型参数的名称和定义该类型参数的扩展类型的名称。

'{0}' 不能同时用作类型参数的名称和定义该类型参数的 mixin 的名称。

了解详情
conflicting_type_variable_and_member

在此类中,'{0}' 不能同时用作类型参数和成员的名称。

在此枚举中,'{0}' 不能同时用作类型参数和成员的名称。

在此扩展类型中,'{0}' 不能同时用作类型参数和成员的名称。

在此扩展中,'{0}' 不能同时用作类型参数和成员的名称。

在此 mixin 中,'{0}' 不能同时用作类型参数和成员的名称。

了解详情
constant_pattern_never_matches_value_type

匹配的值类型 '{0}' 永远不可能等于类型为 '{1}' 的此常量。

了解详情
constant_pattern_with_non_constant_expression

常量模式的表达式必须是有效的常量。

了解详情
constructor_with_return_type

构造函数不能有返回类型。

constructor_with_type_arguments

构造函数调用在构造函数名称后不能有类型参数。

const_and_final

成员不能同时声明为 'const' 和 'final'。

const_class

类不能声明为 'const'。

const_constructor_field_type_mismatch

在 const 构造函数中,类型为 '{0}' 的值不能赋值给类型为 '{2}' 的字段 '{1}'。

const_constructor_param_type_mismatch

在 const 构造函数中,类型为 '{0}' 的值不能赋值给类型为 '{1}' 的参数。

了解详情
const_constructor_throws_exception

Const 构造函数不能抛出异常。

const_constructor_with_body

Const 构造函数不能有函数体。

const_constructor_with_field_initialized_by_non_const

无法定义 'const' 构造函数,因为字段 '{0}' 是用非常量值初始化的。

了解详情
const_constructor_with_mixin_with_field

此构造函数不能声明为 'const',因为 mixin 添加了实例字段:{0}。

此构造函数不能声明为 'const',因为 mixin 添加了实例字段:{0}。

const_constructor_with_non_const_super

常量构造函数不能调用 '{0}' 的非常量超类构造函数。

了解详情
const_constructor_with_non_final_field

不能为具有非 final 字段的类定义 const 构造函数。

了解详情
const_deferred_class

延迟加载的类不能用 'const' 创建。

了解详情
const_eval_assertion_failure

此常量表达式中的断言失败。

const_eval_assertion_failure_with_message

断言失败,消息为 '{0}'。

const_eval_extension_method

扩展方法不能在常量表达式中使用。

const_eval_extension_type_method

扩展类型方法不能在常量表达式中使用。

const_eval_for_element

常量表达式不支持 'for' 元素。

const_eval_method_invocation

方法不能在常量表达式中调用。

const_eval_primitive_equality

在常量表达式中,相等运算符的操作数必须具有基本相等性。

const_eval_property_access

属性 '{0}' 不能在常量表达式中访问类型 '{1}' 的属性。

const_eval_throws_exception

此常量表达式的求值会抛出异常。

const_eval_throws_idbze

此常量表达式的求值会抛出 IntegerDivisionByZeroException。

const_eval_type_bool

在常量表达式中,此运算符的操作数必须是 'bool' 类型。

const_eval_type_bool_int

在常量表达式中,此运算符的操作数必须是 'bool' 或 'int' 类型。

const_eval_type_bool_num_string

在常量表达式中,此运算符的操作数必须是 'bool', 'num', 'String' 或 'null' 类型。

const_eval_type_int

在常量表达式中,此运算符的操作数必须是 'int' 类型。

const_eval_type_num

在常量表达式中,此运算符的操作数必须是 'num' 类型。

const_eval_type_num_string

在常量表达式中,此运算符的操作数必须是 'num' 或 'String' 类型。

const_eval_type_string

在常量表达式中,此运算符的操作数必须是 'String' 类型。

const_eval_type_type

在常量表达式中,此运算符的操作数必须是 'Type' 类型。

const_factory

只有重定向工厂构造函数才能声明为 'const'。

const_initialized_with_non_constant_value

Const 变量必须用常量值初始化。

了解详情
const_initialized_with_non_constant_value_from_deferred_library

来自延迟加载库的常量值不能用于初始化 'const' 变量。

了解详情
const_instance_field

只有静态字段可以声明为 const。

了解详情
const_map_key_not_primitive_equality

常量 map 中键的类型不能覆盖 '==' 运算符或 'hashCode',但类 '{0}' 做了。

了解详情
const_method

Getters, setters 和 methods 不能声明为 'const'。

const_not_initialized

常量 '{0}' 必须初始化。

了解详情
const_set_element_not_primitive_equality

常量 set 中的元素不能覆盖 '==' 操作符或 'hashCode',但类型 '{0}' 做了。

了解详情
const_spread_expected_list_or_set

此展开中需要 list 或 set。

了解详情
const_spread_expected_map

此展开中需要 map。

了解详情
const_type_parameter

类型参数不能在常量表达式中使用。

const_with_non_const

调用的构造函数不是 const 构造函数。

了解详情
const_with_non_constant_argument

常量创建的参数必须是常量表达式。

了解详情
const_with_type_parameters

常量构造函数 tearoff 不能使用类型参数作为类型实参。

常量创建不能使用类型参数作为类型实参。

常量函数 tearoff 不能使用类型参数作为类型实参。

了解详情
const_with_undefined_constructor

类 '{0}' 没有常量构造函数 '{1}'。

const_with_undefined_constructor_default

类 '{0}' 没有未命名的常量构造函数。

continue_label_invalid

'continue' 语句中使用的标签必须定义在循环或 switch 成员上。

了解详情
continue_outside_of_loop

continue 语句不能在循环或 switch 语句之外使用。

continue_without_label_in_case

switch 语句中的 continue 语句必须有标签作为目标。

could_not_infer

无法推断类型参数 '{0}'。{1}

covariant_and_static

成员不能同时声明为 'covariant' 和 'static'。

covariant_constructor

构造函数不能声明为 'covariant'。

covariant_member

Getters, setters 和 methods 不能声明为 'covariant'。

creation_of_struct_or_union

'Struct' 和 'Union' 的子类由本地内存支持,不能通过生成式构造函数实例化。

了解详情
creation_with_non_type

名称 '{0}' 不是类。

了解详情
dead_code

死代码。

死代码:赋值的通配符变量标记为 late,且永远无法引用,因此此初始化器将永远不会被求值。

了解详情
dead_code_catch_following_catch

死代码:'catch (e)' 或 'on Object catch (e)' 之后的 catch 子句永远不会被执行。

了解详情
dead_code_on_catch_subtype

死代码:此 on-catch 块不会执行,因为 '{0}' 是 '{1}' 的子类型,因此已被捕获。

了解详情
dead_null_aware_expression

左操作数不能为 null,因此右操作数永远不会执行。

了解详情
declaration_named_augmented_inside_augmentation

标识符 'augmented' 在增强声明内部具有特殊含义。

default_in_switch_expression

switch 表达式不能使用 default 关键字。

default_list_constructor

启用 null 安全时,默认的 'List' 构造函数不可用。

了解详情
default_value_in_function_type

函数类型中的参数不能有默认值。

了解详情
default_value_in_redirecting_factory_constructor

重定向到另一个构造函数的工厂构造函数中不允许使用默认值。

了解详情
default_value_on_required_parameter

必选命名参数不能有默认值。

了解详情
deferred_after_prefix

延迟加载关键字应紧跟前缀('as' 子句)之前。

deferred_import_of_extension

导入延迟加载库必须隐藏所有扩展。

了解详情
definitely_unassigned_late_local_variable

late 局部变量 '{0}' 在此处肯定未赋值。

了解详情
dependencies_field_not_map

字段 '{0}' 的值应为 map。

了解详情
deprecated_colon_for_default_value

使用冒号作为默认值前的分隔符已弃用,在语言版本 3.0 及更高版本中将不再支持。

了解详情
deprecated_export_use

间接导入 '{0}' 的能力已弃用。

了解详情
deprecated_field

字段 '{0}' 已不再使用,可以移除。

了解详情
deprecated_lint

'{0}' 是已弃用的 linter 规则,不应使用。

deprecated_lint_with_replacement

'{0}' 已弃用,应替换为 '{1}'。

deprecated_member_use

'{0}' 已弃用,不应使用。

'{0}' 已弃用,不应使用。 {1}

了解详情
deprecated_member_use_from_same_package

'{0}' 已弃用,不应使用。

'{0}' 已弃用,不应使用。 {1}

了解详情
deprecated_new_in_comment_reference

在注释引用中使用 'new' 关键字已弃用。

了解详情
deprecated_subtype_of_function

扩展 'Function' 已弃用。

实现 'Function' 无效。

Mixin 'Function' 已弃用。

了解详情
directive_after_declaration

指令必须出现在任何声明之前。

disallowed_type_instantiation_expression

只有泛型类型、泛型函数、泛型实例方法或泛型构造函数才能有类型参数。

了解详情
division_optimization

运算符 x ~/ y 比 (x / y).toInt() 更高效。

了解详情
doc_directive_argument_wrong_format

参数 '{0}' 必须格式化为 {1}。

doc_directive_has_extra_arguments

指令 '{0}' 有 '{1}' 个参数,但预期只有 '{2}' 个。

doc_directive_has_unexpected_named_argument

指令 '{0}' 有意外的命名参数 '{1}'。

doc_directive_missing_argument

指令 '{0}' 缺少 '{1}' 和 '{2}' 参数。

指令 '{0}' 缺少 '{1}' 参数。

指令 '{0}' 缺少 '{1}'、'{2}' 和 '{3}' 参数。

doc_directive_missing_closing_brace

文档指令缺少闭合花括号 ('}')。

doc_directive_missing_closing_tag

文档指令缺少闭合标签。

doc_directive_missing_opening_tag

文档指令缺少起始标签。

doc_directive_unknown

文档指令 '{0}' 未知。

doc_import_cannot_be_deferred

文档导入不能是延迟加载的。

doc_import_cannot_have_combinators

文档导入不能有 show 或 hide 组合子。

doc_import_cannot_have_configurations

文档导入不能有配置。

doc_import_cannot_have_prefix

文档导入不能有前缀。

dot_shorthand_missing_context

在没有上下文类型的地方不能使用点号简写。

dot_shorthand_undefined_member

静态 getter '{0}' 未在上下文类型 '{1}' 中定义。

静态方法或构造函数 '{0}' 未在类型 '{1}' 中定义。

duplicated_modifier

修饰符 '{0}' 已指定。

duplicate_constructor

名称为 '{0}' 的构造函数已定义。

未命名构造函数已定义。

了解详情
duplicate_deferred

导入指令只能有一个 'deferred' 关键字。

duplicate_definition

名称 '{0}' 已定义。

了解详情
duplicate_export

重复导出。

了解详情
duplicate_field_formal_parameter

字段 '{0}' 不能在同一个构造函数中被多个参数初始化。

了解详情
duplicate_field_name

字段名称 '{0}' 在此记录中已使用。

了解详情
duplicate_hidden_name

重复的隐藏名称。

了解详情
duplicate_ignore

此处无需忽略诊断信息 '{0}',因为它已被忽略。

了解详情
duplicate_import

重复导入。

了解详情
duplicate_label_in_switch_statement

标签 '{0}' 在此 switch 语句中已使用。

duplicate_named_argument

命名参数 '{0}' 的实参已指定。

了解详情
duplicate_part

库已包含 URI 为 '{0}' 的部分。

了解详情
duplicate_pattern_assignment_variable

变量 '{0}' 在此模式中已赋值。

了解详情
duplicate_pattern_field

字段 '{0}' 在此模式中已匹配。

了解详情
duplicate_prefix

导入指令只能有一个前缀('as' 子句)。

duplicate_rest_element_in_pattern

列表或 map 模式中最多允许一个 rest 元素。

了解详情
duplicate_rule

规则 {0} 已指定,无需再次指定。

duplicate_shown_name

重复的 shown 名称。

了解详情
duplicate_variable_pattern

变量 '{0}' 在此模式中已定义。

了解详情
empty_enum_body

枚举必须声明至少一个常量名称。

empty_map_pattern

map 模式必须至少有一个条目。

了解详情
empty_record_literal_with_comma

没有字段的记录字面量不能有末尾逗号。

了解详情
empty_record_type_named_fields_list

记录类型中命名字段列表不能为空。

了解详情
empty_record_type_with_comma

没有字段的记录类型不能有末尾逗号。

了解详情
empty_struct

类 '{0}' 不能为空,因为它是 '{1}' 的子类。

了解详情
enum_constant_invokes_factory_constructor

枚举值不能调用工厂构造函数。

enum_constant_same_name_as_enclosing

枚举值的名称不能与枚举的名称相同。

了解详情
enum_constant_with_non_const_constructor

调用的构造函数不是 'const' 构造函数。

了解详情
enum_instantiated_to_bounds_is_not_well_bounded

将枚举实例化到边界的结果不是 well-bounded 的。

enum_in_class

枚举不能在类内部声明。

enum_mixin_with_instance_variable

应用于枚举的 Mixin 不能有实例变量。

了解详情
enum_without_constants

枚举必须至少有一个枚举常量。

enum_with_abstract_member

'{0}' 必须有方法体,因为 '{1}' 是一个枚举。

了解详情
enum_with_name_values

名称 'values' 不是枚举的有效名称。

了解详情
equality_cannot_be_equality_operand

比较表达式不能作为另一个比较表达式的操作数。

equal_elements_in_const_set

常量 set 字面量中的两个元素不能相等。

了解详情
equal_elements_in_set

set 字面量中的两个元素不应相等。

了解详情
equal_keys_in_const_map

常量 map 字面量中的两个键不能相等。

了解详情
equal_keys_in_map

map 字面量中的两个键不应相等。

了解详情
equal_keys_in_map_pattern

map 模式中的两个键不能相等。

了解详情
expected_body

catch 子句必须有函数体,即使它是空的。

类声明必须有函数体,即使它是空的。

finally 子句必须有函数体,即使它是空的。

mixin 声明必须有函数体,即使它是空的。

switch 表达式必须有函数体,即使它是空的。

switch 语句必须有函数体,即使它是空的。

try 语句必须有函数体,即使它是空的。

扩展声明必须有函数体,即使它是空的。

扩展类型声明必须有函数体,即使它是空的。

expected_case_or_default

应为 'case' 或 'default'。

expected_class_member

应为类成员。

expected_else_or_comma

应为 'else' 或逗号。

expected_executable

应为方法、getter、setter 或操作符声明。

expected_identifier_but_got_keyword

'{0}' 不能用作标识符,因为它是一个关键字。

expected_instead

应为 '{0}' 而不是此处内容。

expected_list_or_map_literal

应为 list 或 map 字面量。

expected_named_type

应为类名。

应为 mixin 名。

应为类或 mixin 的名称。

expected_one_list_pattern_type_arguments

列表模式需要一个类型参数或没有,但找到了 {0} 个。

了解详情
expected_one_list_type_arguments

列表字面量需要一个类型参数或没有,但找到了 {0} 个。

了解详情
expected_one_set_type_arguments

Set 字面量需要一个类型参数或没有,但找到了 {0} 个。

了解详情
expected_representation_field

应为 representation 字段。

expected_representation_type

应为 representation 类型。

expected_string_literal

应为字符串字面量。

expected_token

应找到 '{0}'。

expected_two_map_pattern_type_arguments

map 模式需要两个类型参数或没有,但找到了 {0} 个。

了解详情
expected_two_map_type_arguments

map 字面量需要两个类型参数或没有,但找到了 {0} 个。

了解详情
expected_type_name

应为类型名称。

experiment_not_enabled

这需要启用语言特性 '{0}'。

experiment_not_enabled_off_by_default

这需要启用实验性语言特性 '{0}'。

export_directive_after_part_directive

导出指令必须在 part 指令之前。

export_internal_library

库 '{0}' 是内部的,不能导出。

了解详情
export_legacy_symbol

符号 '{0}' 在 legacy 库中定义,不能从启用 null 安全的库中重新导出。

了解详情
export_of_non_library

导出的库 '{0}' 不能有 part-of 指令。

了解详情
expression_in_map

表达式不能在 map 字面量中使用。

了解详情
extends_non_class

类只能扩展其他类。

了解详情
extension_as_expression

扩展 '{0}' 不能用作表达式。

了解详情
extension_augmentation_has_on_clause

扩展增强不能有 'on' 子句。

extension_conflicting_static_and_instance

扩展不能同时定义静态成员 '{0}' 和同名的实例成员。

了解详情
extension_declares_abstract_member

扩展不能声明抽象成员。

了解详情
extension_declares_constructor

扩展不能声明构造函数。

了解详情
extension_declares_instance_field

扩展不能声明实例字段。

了解详情
extension_declares_member_of_object

扩展不能声明与 'Object' 声明的成员同名的成员。

了解详情
extension_override_access_to_static_member

扩展 override 不能用于从扩展访问静态成员。

了解详情
extension_override_argument_not_assignable

扩展 override '{0}' 的参数类型不能赋值给扩展类型 '{1}'。

了解详情
extension_override_without_access

扩展 override 只能用于访问实例成员。

了解详情
extension_override_with_cascade

扩展 override 没有值,因此不能用作级联表达式的接收器。

了解详情
extension_type_constructor_with_super_formal_parameter

扩展类型构造函数不能声明 super 形式参数。

了解详情
extension_type_constructor_with_super_invocation

扩展类型构造函数不能包含 super 初始化器。

了解详情
extension_type_declares_instance_field

扩展类型不能声明实例字段。

了解详情
extension_type_declares_member_of_object

扩展类型不能声明与 'Object' 声明的成员同名的成员。

了解详情
extension_type_extends

扩展类型声明不能有 'extends' 子句。

extension_type_implements_disallowed_type

扩展类型不能实现 '{0}'。

了解详情
extension_type_implements_itself

扩展类型不能实现自身。

了解详情
extension_type_implements_not_supertype

'{0}' 不是表示类型 '{1}' 的超类型。

了解详情
extension_type_implements_representation_not_supertype

'{1}' 的表示类型 '{0}' 不是 '{3}' 的表示类型 '{2}' 的超类型。

了解详情
extension_type_inherited_member_conflict

扩展类型 '{0}' 从实现的类型中继承了多个同名的 '{1}' 成员。

了解详情
extension_type_representation_depends_on_itself

扩展类型表示不能依赖自身。

了解详情
extension_type_representation_type_bottom

表示类型不能是底部类型。

了解详情
extension_type_with

扩展类型声明不能有 'with' 子句。

extension_type_with_abstract_member

'{0}' 必须有方法体,因为 '{1}' 是一个扩展类型。

了解详情
external_class

类不能声明为 'external'。

external_constructor_with_body

External 构造函数不能有函数体。

external_constructor_with_field_initializers

External 构造函数不能初始化字段。

external_constructor_with_initializer

External 构造函数不能有任何初始化器。

external_enum

枚举不能声明为 'external'。

external_factory_redirection

重定向工厂构造函数不能是 external。

external_factory_with_body

External 工厂构造函数不能有函数体。

external_field

字段不能声明为 'external'。

external_getter_with_body

External getter 不能有函数体。

external_late_field

External 字段不能是 late。

external_method_with_body

External 或 native 方法不能有函数体。

external_operator_with_body

External 操作符不能有函数体。

external_setter_with_body

External setter 不能有函数体。

external_typedef

Typedefs 不能声明为 'external'。

external_with_initializer

External 字段不能有初始化器。

External 变量不能有初始化器。

了解详情
extraneous_modifier

此处不能有修饰符 '{0}'。

extraneous_modifier_in_extension_type

在扩展类型中不能有修饰符 '{0}'。

extraneous_modifier_in_primary_constructor

在主构造函数中不能有修饰符 '{0}'。

extra_annotation_on_struct_field

结构类中的字段必须恰好有一个表示 native 类型的注解。

了解详情
extra_positional_arguments

位置参数过多:预期 {0} 个,但找到 {1} 个。

了解详情
extra_positional_arguments_could_be_named

位置参数过多:预期 {0} 个,但找到 {1} 个。

了解详情
extra_size_annotation_carray

'Array' 必须恰好有一个 'Array' 注解。

了解详情
factory_top_level_declaration

顶级声明不能声明为 'factory'。

factory_without_body

非重定向的 'factory' 构造函数必须有函数体。

factory_with_initializers

'factory' 构造函数不能有初始化器。

ffi_native_invalid_duplicate_default_asset

一个库最多只能有一个 @DefaultAsset 注解。

了解详情
ffi_native_invalid_multiple_annotations

Native 函数和字段必须恰好有一个 @Native 注解。

了解详情
ffi_native_must_be_external

Native 函数必须声明为 external。

了解详情
ffi_native_only_classes_extending_nativefieldwrapperclass1_can_be_pointer

只有扩展 NativeFieldWrapperClass1 的类才能作为 Pointer 传递。

了解详情
ffi_native_unexpected_number_of_parameters

Native 注解参数数量意外。预期 {0} 个,但有 {1} 个。

了解详情
ffi_native_unexpected_number_of_parameters_with_receiver

Native 注解参数数量意外。预期 {0} 个,但有 {1} 个。Native 实例方法注解必须以接收器作为第一个参数。

了解详情
field_initialized_by_multiple_initializers

字段 '{0}' 不能在同一个构造函数中初始化两次。

了解详情
field_initialized_in_initializer_and_declaration

如果字段是 final 且已在声明时初始化,则不能在构造函数中初始化。

了解详情
field_initialized_in_parameter_and_initializer

字段不能同时在参数列表和初始化器中初始化。

了解详情
field_initialized_outside_declaring_class

字段只能在其声明类中初始化。

field_initializer_factory_constructor

初始化形式参数不能在工厂构造函数中使用。

了解详情
field_initializer_in_struct

'Struct' 和 'Union' 子类中的构造函数不能有字段初始化器。

了解详情
field_initializer_not_assignable

在 const 构造函数中,初始化器类型 '{0}' 不能赋值给字段类型 '{1}'。

初始化器类型 '{0}' 不能赋值给字段类型 '{1}'。

了解详情
field_initializer_outside_constructor

字段形式参数只能在构造函数中使用。

初始化形式参数只能在构造函数中使用。

了解详情
field_initializer_redirecting_constructor

重定向构造函数不能有字段初始化器。

了解详情
field_initializing_formal_not_assignable

参数类型 '{0}' 与字段类型 '{1}' 不兼容。

了解详情
field_in_struct_with_initializer

'Struct' 和 'Union' 子类中的字段不能有初始化器。

了解详情
field_must_be_external_in_struct

'Struct' 和 'Union' 子类的字段必须标记为 external。

了解详情
final_and_covariant

成员不能同时声明为 'final' 和 'covariant'。

final_and_covariant_late_with_initializer

标记为 'late' 且带有初始化器的成员不能同时声明为 'final' 和 'covariant'。

final_and_var

成员不能同时声明为 'final' 和 'var'。

final_constructor

构造函数不能声明为 'final'。

final_enum

枚举不能声明为 'final'。

final_initialized_in_declaration_and_constructor

'{0}' 是 final 的,且在声明时已给定值,因此不能设置为新值。

了解详情
final_method

Getters, setters 和 methods 不能声明为 'final'。

final_mixin

Mixin 不能声明为 'final'。

final_mixin_class

Mixin 类不能声明为 'final'。

final_not_initialized

final 变量 '{0}' 必须初始化。

了解详情
final_not_initialized_constructor

所有 final 变量都必须初始化,但 '{0}' 和 '{1}' 没有。

所有 final 变量都必须初始化,但 '{0}' 没有。

所有 final 变量都必须初始化,但 '{0}'、'{1}' 和其他 {2} 个没有。

了解详情
flutter_field_not_map

'flutter' 字段的值应为 map。

了解详情
for_in_of_invalid_element_type

在 'for' 循环中使用的类型 '{0}' 必须实现 '{1}',其类型参数必须可赋值给 '{2}'。

了解详情
for_in_of_invalid_type

在 'for' 循环中使用的类型 '{0}' 必须实现 '{1}'。

了解详情
for_in_with_const_variable

for-in 循环变量不能是 'const'。

了解详情
function_typed_parameter_var

函数类型参数不能用 'const', 'final' 或 'var' 代替返回类型。

generic_function_type_cannot_be_bound

泛型函数类型不能用作类型参数的边界。

generic_function_type_cannot_be_type_argument

泛型函数类型不能是类型参数。

generic_method_type_instantiation_on_dynamic

对类型为 'dynamic' 的接收器的 method tear-off 不能有类型参数。

了解详情
generic_struct_subclass

类 '{0}' 不能扩展 'Struct' 或 'Union',因为 '{0}' 是泛型的。

了解详情
getter_constructor

构造函数不能是 getter。

getter_in_function

Getter 不能在方法或函数内部定义。

getter_not_assignable_setter_types

getter '{0}' 的返回类型 '{1}' 不能赋值给其 setter '{3}' 的类型 '{2}'。

getter_not_subtype_setter_types

getter '{0}' 的返回类型 '{1}' 不是其 setter '{3}' 的类型 '{2}' 的子类型。

了解详情
getter_with_parameters

Getter 必须在声明时没有参数列表。

if_element_condition_from_deferred_library

来自延迟加载库的常量值不能在 const 集合字面量内部的 if 条件中用作值。

illegal_assignment_to_non_assignable

非法赋值给不可赋值的表达式。

illegal_async_generator_return_type

标记为 'async*' 的函数返回类型必须是 'Stream' 的超类型,其中 'T' 是某种类型。

了解详情
illegal_async_return_type

标记为 'async' 的函数返回类型必须是 'Future' 的超类型。

了解详情
illegal_concrete_enum_member

在实现 'Enum' 的类中,不能声明名为 '{0}' 的具体实例成员。

在实现 'Enum' 的类中,不能从 '{1}' 继承名为 '{0}' 的具体实例成员。

了解详情
illegal_enum_values

在实现 'Enum' 的类中,不能声明名为 'values' 的实例成员。

在实现 'Enum' 的类中,不能从 '{0}' 继承名为 'values' 的实例成员。

了解详情
illegal_language_version_override

语言版本必须是 {0}。

illegal_pattern_assignment_variable_name

模式赋值的变量名称不能是 '{0}'。

illegal_pattern_identifier_name

模式不能引用名为 '{0}' 的标识符。

illegal_pattern_variable_name

变量模式声明的变量名称不能是 '{0}'。

illegal_sync_generator_return_type

标记为 'sync*' 的函数返回类型必须是 'Iterable' 的超类型,其中 'T' 是某种类型。

了解详情
implements_before_extends

extends 子句必须在 implements 子句之前。

implements_before_on

on 子句必须在 implements 子句之前。

implements_before_with

with 子句必须在 implements 子句之前。

implements_non_class

类和 mixin 只能实现其他类和 mixin。

了解详情
implements_repeated

'{0}' 只能实现一次。

了解详情
implements_super_class

'{0}' 不能同时在 'extends' 和 'implements' 子句中使用。

'{0}' 不能同时在 'extends' 和 'with' 子句中使用。

了解详情
implicit_super_initializer_missing_arguments

从 '{0}' 隐式调用的未命名构造函数有必选参数。

了解详情
implicit_this_reference_in_initializer

实例成员 '{0}' 不能在初始化器中访问。

了解详情
import_deferred_library_with_load_function

导入的库定义了一个名为 'loadLibrary' 的顶级函数,该函数在延迟加载此库时会被隐藏。

了解详情
import_directive_after_part_directive

导入指令必须在 part 指令之前。

import_internal_library

库 '{0}' 是内部的,不能导入。

了解详情
import_of_legacy_library_into_null_safe

库 '{0}' 是 legacy 库,不应导入到 null 安全库中。

了解详情
import_of_non_library

导入的库 '{0}' 不能有 part-of 指令。

了解详情
included_file_parse_error

{3} 在 {0}({1}..{2}) 中

included_file_warning

包含的选项文件 {0}({1}..{2}) 中警告:{3}

include_file_not_found

分析 '{2}' 时,在 '{1}' 中的包含文件 '{0}' 未找到。

incompatible_lint

规则 '{0}' 与规则 '{1}' 不兼容。

inconsistent_case_expression_types

case 表达式必须具有相同的类型,'{0}' 不是 '{1}'。

inconsistent_inheritance

超接口没有 '{0}' 的有效覆盖:{1}。

了解详情
inconsistent_inheritance_getter_and_method

'{0}' 从 '{1}' 继承为 getter,也从 '{2}' 继承为 method。

inconsistent_language_version_override

part 的语言版本 override 必须与库完全相同。

了解详情
inconsistent_pattern_variable_logical_or

变量 '{0}' 在此逻辑或模式分支中具有不同的类型和/或终结性。

了解详情
inference_failure_on_collection_literal

无法推断 '{0}' 的类型参数。

inference_failure_on_function_invocation

无法推断函数 '{0}' 的类型参数。

inference_failure_on_function_return_type

无法推断 '{0}' 的返回类型。

inference_failure_on_generic_invocation

无法推断泛型函数类型 '{0}' 的类型参数。

inference_failure_on_instance_creation

无法推断构造函数 '{0}' 的类型参数。

inference_failure_on_uninitialized_variable

没有类型或初始化器,无法推断 {0} 的类型。

inference_failure_on_untyped_parameter

无法推断 {0} 的类型;必须显式提供类型。

initialized_variable_in_for_each

for-each 循环中的循环变量不能初始化。

initializer_for_non_existent_field

'{0}' 不是包含类中的字段。

了解详情
initializer_for_static_field

'{0}' 是包含类中的静态字段。构造函数中初始化的字段不能是静态的。

了解详情
initializing_formal_for_non_existent_field

'{0}' 不是包含类中的字段。

了解详情
instance_access_to_static_member

不能通过实例访问静态 {1} '{0}'。

了解详情
instance_member_access_from_factory

不能从工厂构造函数访问实例成员。

了解详情
instance_member_access_from_static

不能从静态方法访问实例成员。

了解详情
instantiate_abstract_class

抽象类不能实例化。

了解详情
instantiate_enum

枚举不能实例化。

了解详情
instantiate_type_alias_expands_to_type_parameter

展开为类型参数的类型别名不能实例化。

了解详情
integer_literal_imprecise_as_double

整数文字被用作双精度浮点数,但在表示为 64 位双精度浮点数时会溢出或精度丢失:'{0}'。

了解详情
integer_literal_out_of_range

整数文字 {0} 不能用 64 位表示。

了解详情
interface_enum

枚举不能声明为 'interface'。

interface_mixin

Mixin 不能声明为 'interface'。

interface_mixin_class

Mixin 类不能声明为 'interface'。

invalid_annotation

注解必须是 const 变量引用或 const 构造函数调用。

了解详情
invalid_annotation_constant_value_from_deferred_library

来自延迟加载库的常量值不能在注解中使用。

了解详情
invalid_annotation_from_deferred_library

来自延迟加载库的常量值不能用作注解。

了解详情
invalid_annotation_target

注解 '{0}' 只能用于 {1}。

了解详情
invalid_assignment

类型为 '{0}' 的值不能赋值给类型为 '{1}' 的变量。

了解详情
invalid_await_in_for

关键字 'await' 不允许用于普通 'for' 语句。

invalid_await_not_required_annotation

注解 'awaitNotRequired' 只能应用于返回 Future 的函数或 Future 类型的字段。

了解详情
invalid_cast_function

函数 '{0}' 的类型 '{1}' 不是预期的类型 '{2}'。这意味着其参数或返回类型与预期不匹配。

invalid_cast_function_expr

函数表达式类型 '{0}' 不是类型 '{1}'。这意味着其参数或返回类型与预期不匹配。考虑更改参数类型或返回类型。

invalid_cast_literal

字面量 '{0}' 的类型 '{1}' 不是预期的类型 '{2}'。

invalid_cast_literal_list

列表字面量类型 '{0}' 不是预期的类型 '{1}'。可以通过显式泛型类型参数或更改元素类型来更改列表的类型。

invalid_cast_literal_map

map 字面量类型 '{0}' 不是预期的类型 '{1}'。可以通过显式泛型类型参数或更改键和值类型来更改 map 的类型。

invalid_cast_literal_set

Set 字面量类型 '{0}' 不是预期的类型 '{1}'。可以通过显式泛型类型参数或更改元素类型来更改 Set 的类型。

invalid_cast_method

方法 tear-off '{0}' 的类型 '{1}' 不是预期的类型 '{2}'。这意味着其参数或返回类型与预期不匹配。

invalid_cast_new_expr

构造函数返回的类型“{0}”不是期望的类型“{1}”。

invalid_code_point

转义序列“{0}”不是有效的码点。

invalid_comment_reference

注释引用应包含一个可能带有前缀的标识符,可以以“new”开头,但不应包含其他任何内容。

invalid_constant

无效的常量值。

invalid_constant_const_prefix

表达式不能以“const”为前缀来形成常量模式。

invalid_constant_pattern_binary

二元运算符 {0} 不支持作为常量模式。

invalid_constant_pattern_duplicate_const

常量表达式中重复的“const”关键字。

invalid_constant_pattern_empty_record_literal

空记录字面量不支持作为常量模式。

invalid_constant_pattern_generic

此表达式不支持作为常量模式。

invalid_constant_pattern_negation

只有数字字面量的取反支持作为常量模式。

invalid_constant_pattern_unary

一元运算符 {0} 不支持作为常量模式。

invalid_constructor_name

构造函数的名称必须与封闭类的名称匹配。

invalid_dependency

可发布的包不能有“{0}”依赖项。

了解详情
invalid_exception_value

当函数的返回类型是“void”、“Handle”或“Pointer”时,方法 {0} 不能有异常返回值(第二个参数)。

了解详情
invalid_export_of_internal_element

成员“{0}”不能作为包的公共 API 的一部分导出。

了解详情
invalid_export_of_internal_element_indirectly

成员“{0}”不能作为包的公共 API 的一部分导出,但作为“{1}”签名的一部分被间接导出。

了解详情
invalid_extension_argument_count

扩展覆盖必须恰好有一个参数:扩展方法中的“this”值。

了解详情
invalid_factory_method_decl

工厂方法“{0}”必须有返回类型。

了解详情
invalid_factory_method_impl

工厂方法“{0}”没有返回新分配的对象。

了解详情
invalid_factory_name_not_a_class

工厂构造函数的名称必须与直接封闭类的名称相同。

了解详情
invalid_field_name

当整数是位置字段的索引时,记录字段名称不能是后跟整数的美元符号。

记录字段名称不能是私有的。

记录字段名称不能与“Object”中的成员名称相同。

了解详情
invalid_field_type_in_struct

结构体类中的字段不能是类型“{0}”。它们只能声明为“int”、“double”、“Array”、“Pointer”或“Struct”或“Union”的子类型。

了解详情
invalid_generic_function_type

无效的泛型函数类型。

invalid_hex_escape

以“\x”开头的转义序列必须后跟 2 个十六进制数字。

invalid_implementation_override

“{1}.{0}”(“{2}”)不是“{3}.{0}”(“{4}”)的有效具体实现。

设置器“{1}.{0}”(“{2}”)不是“{3}.{0}”(“{4}”)的有效具体实现。

了解详情
invalid_initializer

不是有效的初始化器。

invalid_inline_function_type

内联函数类型不能用于泛型函数类型的参数。

了解详情
invalid_inside_unary_pattern

此模式不能不带括号出现在一元模式(cast模式、null检查模式或null断言模式)内部。

invalid_internal_annotation

只有包的私有 API 中的公共元素才能被标注为内部。

了解详情
invalid_language_version_override

Dart 语言版本覆盖注释后面不能跟任何非空白字符。

Dart 语言版本覆盖注释必须在“=”字符后指定版本号,例如“2.0”。

Dart 语言版本覆盖注释必须指定“=”字符。

Dart 语言版本覆盖注释必须指定恰好两个斜杠。

Dart 语言版本覆盖注释必须指定全小写的单词“dart”。

Dart 语言版本覆盖数字不能以字母为前缀。

Dart 语言版本覆盖数字必须以“@dart”开头。

语言版本覆盖不能指定大于最新已知语言版本:{0}.{1} 的版本。

语言版本覆盖必须在任何声明或指令之前指定。

了解详情
invalid_literal_annotation

只有 const 构造函数可以有 @literal 注解。

了解详情
invalid_literal_in_configuration

配置中的字面量不能包含插值。

invalid_modifier_on_constructor

修饰符“{0}”不能应用于构造函数的主体。

了解详情
invalid_modifier_on_setter

Setter 不能使用“async”、“async*”或“sync*”。

了解详情
invalid_non_virtual_annotation

注解“@nonVirtual”只能应用于具体的实例成员。

了解详情
invalid_null_aware_operator

元素不能为 null,因此 null 安全运算符“?”是不必要的。

map 条目的键不能为 null,因此 null 安全运算符“?”是不必要的。

map 条目的值不能为 null,因此 null 安全运算符“?”是不必要的。

由于短路,接收器不能为“null”,因此不能使用 null 安全运算符“{0}”。

接收器不能为 null,因此 null 安全运算符“{0}”是不必要的。

了解详情
invalid_operator

字符串“{0}”不是用户可定义的运算符。

invalid_operator_for_super

运算符“{0}”不能与“super”一起使用。

invalid_operator_questionmark_period_for_super

运算符“?.”不能与“super”一起使用,因为“super”不能为 null。

invalid_option

为“{0}”指定的选项无效:{1}

invalid_override

“{1}.{0}”(“{2}”)不是对“{3}.{0}”(“{4}”)的有效覆盖。

Setter “{1}.{0}”(“{2}”)不是对“{3}.{0}”(“{4}”)的有效覆盖。

了解详情
invalid_override_of_non_virtual_member

成员“{0}”在“{1}”中声明为非虚成员,不能在子类中覆盖。

了解详情
invalid_pattern_variable_in_shared_case_scope

变量“{0}”在所有共享此主体的 case 中没有相同的类型和/或 finality。

变量“{0}”在一些共享此主体的 case 中可用,但不是全部。

变量“{0}”不可用,因为存在标签或“default”case。

了解详情
invalid_platforms_field

“platforms”字段必须是一个以平台为键的 map。

了解详情
invalid_reference_to_generative_enum_constructor

生成枚举构造函数只能用作重定向的目标。

了解详情
invalid_reference_to_this

对“this”表达式的无效引用。

了解详情
invalid_reopen_annotation

注解“@reopen”只能应用于重新开放超类型故意不允许的能力的类。

invalid_required_named_param

类型参数“{0}”已使用 @required 进行标注,但只有没有默认值的命名参数才能使用此标注。

invalid_required_optional_positional_param

在可选位置参数“{0}”上错误地使用了 @required 注解。可选位置参数不能是必需的。

invalid_required_positional_param

在必需的位置参数“{0}”上冗余使用了 @required 注解。

invalid_return_type_for_catch_error

'onError' 处理器不能返回类型为“{0}”的值,因为它必须可赋值给“{1}”。

返回类型“{0}”不可赋值给“{1}”,这与“Future.catchError”的要求不符。

了解详情
invalid_sealed_annotation

注解“@sealed”只能应用于类。

了解详情
invalid_section_format

“{0}”节的格式无效。

invalid_star_after_async

修饰符“async*”不允许用于表达式函数体。

invalid_super_formal_parameter_location

超参数只能用于非重定向的生成构造函数。

了解详情
invalid_super_in_initializer

只能在初始化器中使用“super”调用超类构造函数(例如“super()”或“super.namedConstructor()”)。

invalid_sync

修饰符“sync”不允许用于表达式函数体。

invalid_this_in_initializer

只能在初始化器中使用“this”进行字段初始化(例如“this.x = something”)和构造函数重定向(例如“this()”或“this.namedConstructor()”)。

invalid_type_argument_in_const_literal

常量列表字面量不能在类型参数中使用类型参数,例如“{0}”。

常量 map 字面量不能在类型参数中使用类型参数,例如“{0}”。

常量 set 字面量不能在类型参数中使用类型参数,例如“{0}”。

了解详情
invalid_unicode_escape_started

字符串“”不能单独存在。

invalid_unicode_escape_u_bracket

以“\u{”开头的转义序列后面必须跟 1 到 6 个十六进制数字,然后是“}”。

invalid_unicode_escape_u_no_bracket

以“\u”开头的转义序列后面必须跟 4 个十六进制数字。

invalid_unicode_escape_u_started

以“\u”开头的转义序列后面必须跟 4 个十六进制数字,或者在“{”和“}”之间跟 1 到 6 个数字。

invalid_uri

无效的 URI 语法:“{0}”。

了解详情
invalid_use_of_covariant

“covariant”关键字只能用于实例方法中的参数或非 final 实例字段之前。

invalid_use_of_covariant_in_extension

扩展中不能有修饰符“{0}”。

了解详情
invalid_use_of_do_not_submit_member

对“{0}”的使用不应提交到源代码管理。

了解详情
invalid_use_of_identifier_augmented

标识符“augmented”只能用于在增补声明内部引用被增补的声明。

invalid_use_of_internal_member

成员“{0}”只能在其包内使用。

了解详情
invalid_use_of_null_value

值始终为“null”的表达式不能被解引用。

了解详情
invalid_use_of_protected_member

成员“{0}”只能在“{1}”的子类的实例成员中使用。

invalid_use_of_type_outside_library

类“{0}”不能在其库外部被扩展,因为它是一个 final 类。

类“{0}”不能在其库外部被扩展,因为它是一个 interface 类。

类“{0}”不能在其库外部被扩展、实现或 mixed in,因为它是一个 sealed 类。

类“{0}”不能在其库外部被实现,因为它是一个 base 类。

类“{0}”不能在其库外部被实现,因为它是一个 final 类。

类“{0}”不能在其库外部用作 mixin 超类约束,因为它是一个 final 类。

mixin “{0}”不能在其库外部被实现,因为它是一个 base mixin。

了解详情
invalid_use_of_visible_for_overriding_member

成员“{0}”只能用于覆盖。

了解详情
invalid_use_of_visible_for_template_member

成员“{0}”只能在“{1}”或模板库中使用。

invalid_use_of_visible_for_testing_member

成员“{0}”只能在“{1}”或测试中使用。

了解详情
invalid_visibility_annotation

成员“{0}”已使用“{1}”进行标注,但此标注仅对公共成员的声明有意义。

了解详情
invalid_visible_for_overriding_annotation

注解“visibleForOverriding”只能应用于可被覆盖的公共实例成员。

了解详情
invalid_visible_outside_template_annotation

注解“visibleOutsideTemplate”只能应用于被“visibleForTemplate”注解的类、枚举或 mixin 的成员。

了解详情
invalid_widget_preview_application

注解“@Preview(...)”只能应用于公共的、静态可访问的构造函数和函数。

了解详情
invalid_widget_preview_private_argument

'@Preview(...)' 只能接受由字面量和公共符号组成的参数。

了解详情
invocation_of_extension_without_call

扩展“{0}”没有定义“call”方法,因此覆盖不能在调用中使用。

了解详情
invocation_of_non_function

“{0}”不是函数。

了解详情
invocation_of_non_function_expression

表达式计算结果不是函数,因此无法调用。

了解详情
label_in_outer_scope

不能引用在外部方法中声明的标签“{0}”。

了解详情
label_undefined

不能引用未定义的标签“{0}”。

了解详情
late_final_field_with_const_constructor

在具有生成 const 构造函数的类中不能有 late final 字段。

了解详情
late_final_local_already_assigned

late final 局部变量已被赋值。

了解详情
late_pattern_variable_declaration

模式变量声明不能使用 late 关键字。

leaf_call_must_not_return_handle

FFI leaf 调用不能返回“Handle”。

了解详情
leaf_call_must_not_take_handle

FFI leaf 调用不能接受类型为“Handle”的参数。

了解详情
library_directive_not_first

库指令必须出现在所有其他指令之前。

list_element_type_not_assignable

元素类型“{0}”不能赋值给列表类型“{1}”。

了解详情
literal_with_class

{0} 字面量不能以“{1}”为前缀。

literal_with_class_and_new

{0} 字面量不能以“new {1}”为前缀。

literal_with_new

字面量不能以“new”为前缀。

local_function_declaration_modifier

局部函数声明不能指定任何修饰符。

main_first_positional_parameter_type

“main”函数的第一个位置参数的类型必须是“List”的超类型。'.

了解详情
main_has_required_named_parameters

函数“main”不能有任何必需的命名参数。

了解详情
main_has_too_many_required_positional_parameters

函数“main”不能有两个以上的必需位置参数。

了解详情
main_is_not_function

名为“main”的声明必须是函数。

了解详情
map_entry_not_in_map

map entry 只能用于 map 字面量。

了解详情
map_key_type_not_assignable

元素类型“{0}”不能赋值给 map key 类型“{1}”。

了解详情
map_value_type_not_assignable

元素类型“{0}”不能赋值给 map value 类型“{1}”。

了解详情
member_with_class_name

类成员不能与封闭类同名。

mismatched_annotation_on_struct_field

注解与字段的声明类型不匹配。

了解详情
missing_annotation_on_struct_field

“{1}”的子类中类型为“{0}”的字段必须具有指示原生类型的注解。

了解详情
missing_assignable_selector

缺少选择器,例如“.identifier”或“[0]”。

missing_assignment_in_initializer

字段名后应有赋值。

missing_catch_or_finally

try 块后面必须跟着一个“on”、“catch”或“finally”子句。

missing_closing_parenthesis

缺少右括号。

missing_const_final_var_or_type

变量必须使用关键字“const”、“final”、“var”或类型名声明。

missing_const_in_list_literal

看到此消息表示存在错误。请报告。

missing_const_in_map_literal

看到此消息表示存在错误。请报告。

missing_const_in_set_literal

看到此消息表示存在错误。请报告。

missing_dart_library

必需的库“{0}”缺失。

了解详情
missing_default_value_for_parameter

参数“{0}”的类型决定其不能为“null”,但隐式默认值为“null”。

在 null safety 中,使用“required”关键字,而不是“@required”注解。

了解详情
missing_dependency

缺少对导入包“{0}”的依赖。

了解详情
missing_enum_body

枚举定义必须有一个主体,且至少包含一个常量名。

missing_enum_constant_in_switch

缺少“{0}”的 case 子句。

了解详情
missing_exception_value

当函数的返回类型既不是“void”、“Handle”也不是“Pointer”时,方法 {0} 必须有一个异常返回值(第二个参数)。

了解详情
missing_expression_in_initializer

赋值运算符后应有一个表达式。

missing_expression_in_throw

“throw”后缺少表达式。

missing_field_type_in_struct

结构体类中的字段必须具有明确声明的类型“int”、“double”或“Pointer”。

了解详情
missing_function_body

必须提供函数体。

missing_function_keyword

函数类型在参数列表前必须有关键字“Function”。

missing_function_parameters

函数必须有一个显式的参数列表。

missing_get

Getter 名称前必须有关键字“get”。

missing_identifier

应有一个标识符。

missing_initializer

应有一个初始化器。

missing_keyword_operator

运算符声明必须以关键字“operator”开头。

missing_method_parameters

方法必须有一个显式的参数列表。

missing_name

“name”字段是必需的,但缺失。

了解详情
missing_named_pattern_field_name

getter 名称未明确指定,并且模式不是变量。

了解详情
missing_name_for_named_parameter

函数类型中的命名参数必须有名称。

missing_name_in_library_directive

库指令必须包含库名称。

missing_name_in_part_of_directive

Part-of 指令必须包含库名称。

missing_override_of_must_be_overridden

缺少“{0}”的具体实现。

缺少“{0}”和“{1}”的具体实现。

缺少“{0}”、“{1}”以及另外 {2} 个的具体实现。

了解详情
missing_prefix_in_deferred_import

延迟导入应该有前缀。

missing_primary_constructor

扩展类型声明必须有一个主要构造函数声明。

missing_primary_constructor_parameters

主要构造函数声明必须有形式参数。

missing_required_argument

命名参数“{0}”是必需的,但没有对应的参数。

了解详情
missing_required_param

参数“{0}”是必需的。

参数“{0}”是必需的。{1}。

了解详情
missing_return

此函数的返回类型为“{0}”,但没有以 return 语句结束。

了解详情
missing_size_annotation_carray

类型为“Array”的字段必须恰好有一个“Array”注解。

了解详情
missing_star_after_sync

修饰符“sync”后面必须跟着一个星号(“*”)。

missing_statement

应有一个语句。

missing_terminator_for_parameter_group

没有“{0}”来关闭参数组。

missing_typedef_parameters

Typedef 必须有一个显式的参数列表。

missing_variable_in_for_each

在 for-each 循环的“in”之前必须声明一个循环变量,但未找到。

missing_variable_pattern

在此逻辑或模式的分支中缺少变量模式“{0}”。

了解详情
mixed_parameter_groups

在一个参数列表中不能同时包含位置参数和命名参数。

mixin_application_concrete_super_invoked_member_type

超类调用的成员“{0}”的类型是“{1}”,而类中的具体成员类型是“{2}”。

了解详情
mixin_application_not_implemented_interface

“{0}”不能混合到“{1}”上,因为“{1}”没有实现“{2}”。

了解详情
mixin_application_no_concrete_super_invoked_member

类没有超类调用的成员“{0}”的具体实现。

类没有超类调用的 setter “{0}”的具体实现。

了解详情
mixin_class_declaration_extends_not_object

类“{0}”不能声明为 mixin,因为它扩展了“Object”以外的类。

了解详情
mixin_class_declares_constructor

类“{0}”不能用作 mixin,因为它声明了构造函数。

了解详情
mixin_declares_constructor

Mixins 不能声明构造函数。

mixin_inherits_from_not_object

类“{0}”不能用作 mixin,因为它扩展了“Object”以外的类。

了解详情
mixin_instantiate

Mixins 不能被实例化。

了解详情
mixin_of_non_class

类只能 mixin mixin 和类。

了解详情
mixin_on_sealed_class

类“{0}”不应被用作 mixin 约束,因为它已密封,并且任何混入此 mixin 的类都必须将“{0}”作为超类。

了解详情
mixin_super_class_constraint_deferred_class

延迟类不能用作超类约束。

了解详情
mixin_super_class_constraint_non_interface

只有类和 mixin 可以用作超类约束。

了解详情
mixin_with_clause

Mixin 不能有 with 子句。

mixin_with_non_class_superclass

Mixin 只能应用于类。

modifier_out_of_order

修饰符“{0}”应在修饰符“{1}”之前。

multiple_clauses

每个“{0}”定义最多可以有一个“{1}”子句。

multiple_combinators

使用多个“hide”或“show”组合子绝不是必需的,并且通常会产生令人惊讶的结果。

了解详情
multiple_extends_clauses

每个类定义最多可以有一个 extends 子句。

multiple_implements_clauses

每个类或 mixin 定义最多可以有一个 implements 子句。

multiple_library_directives

一个文件中只能声明一个库指令。

multiple_named_parameter_groups

在一个参数列表中不能有多个命名参数组。

multiple_on_clauses

每个 mixin 定义最多可以有一个 on 子句。

multiple_part_of_directives

一个文件中只能声明一个 part-of 指令。

multiple_plugins

不能启用多个插件。

multiple_positional_parameter_groups

在一个参数列表中不能有多个位置参数组。

multiple_redirecting_constructor_invocations

构造函数最多只能有一个“this”重定向。

了解详情
multiple_representation_fields

每个扩展类型应恰好有一个表示字段。

multiple_super_initializers

构造函数最多可以有一个“super”初始化器。

了解详情
multiple_variables_in_for_each

在 for-each 循环的“in”之前必须声明一个循环变量,但找到了 {0} 个。

multiple_variance_modifiers

每个类型参数最多可以有一个 variance 修饰符。

multiple_with_clauses

每个类定义最多可以有一个 with 子句。

must_be_a_native_function_type

提供给“{1}”的类型“{0}”必须是有效的“dart:ffi”原生函数类型。

了解详情
must_be_a_subtype

类型“{0}”必须是“{2}”的“{1}”的子类型。

了解详情
must_be_immutable

此类(或此类继承的类)被标记为“@immutable”,但其一个或多个实例字段不是 final:{0}

了解详情
must_call_super

此方法覆盖了在“{0}”中被标注为“@mustCallSuper”的方法,但没有调用被覆盖的方法。

了解详情
must_return_void

传递给“NativeCallable.listener”的函数的返回类型必须是“void”,而不是“{0}”。

了解详情
named_function_expression

函数表达式不能命名。

named_function_type

函数类型不能命名。

named_parameter_outside_group

命名参数必须包含在花括号中(“{”和“}”)。

name_not_string

“name”字段的值必须是字符串。

了解详情
native_clause_in_non_sdk_code

原生子句只能在 SDK 和通过原生扩展加载的代码中使用。

native_clause_should_be_annotation

这种形式的原生子句已弃用。

native_field_invalid_type

“{0}”是原生字段不支持的类型。原生字段只支持指针、数组或数字和复合类型。

了解详情
native_field_missing_type

无法推断此字段的原生类型,必须在注解中指定。

了解详情
native_field_not_static

原生字段必须是静态的。

了解详情
native_function_body_in_non_sdk_code

原生函数只能在 SDK 和通过原生扩展加载的代码中声明。

native_function_missing_type

无法推断此函数的原生类型,因此必须在注解中指定。

了解详情
negative_variable_dimension

可变长度数组的可变维度必须是非负数。

了解详情
new_with_undefined_constructor

类 '{0}' 没有名为 '{1}' 的构造函数。

new_with_undefined_constructor_default

类“{0}”没有未命名构造函数。

了解详情
non_abstract_class_inherits_abstract_member

缺少“{0}”的具体实现。

缺少“{0}”和“{1}”的具体实现。

缺少“{0}”、“{1}”、“{2}”、“{3}”以及另外 {4} 个的具体实现。

缺少“{0}”、“{1}”、“{2}”和“{3}”的具体实现。

缺少“{0}”、“{1}”和“{2}”的具体实现。

了解详情
non_bool_condition

条件的静态类型必须是“bool”。

了解详情
non_bool_expression

assert 中的表达式类型必须是“bool”。

了解详情
non_bool_negation_expression

取反操作数的静态类型必须是“bool”。

了解详情
non_bool_operand

运算符“{0}”的操作数必须可赋值给“bool”。

了解详情
non_constant_annotation_constructor

注解创建只能调用 const 构造函数。

了解详情
non_constant_case_expression

case 表达式必须是常量。

了解详情
non_constant_case_expression_from_deferred_library

延迟库中的常量值不能用作 case 表达式。

了解详情
non_constant_default_value

可选参数的默认值必须是常量。

了解详情
non_constant_default_value_from_deferred_library

延迟库中的常量值不能用作默认参数值。

了解详情
non_constant_list_element

const 列表字面量中的值必须是常量。

了解详情
non_constant_map_element

const map 字面量中的元素必须是常量。

了解详情
non_constant_map_key

const map 字面量中的键必须是常量。

了解详情
non_constant_map_pattern_key

map 模式中的键表达式必须是常量。

了解详情
non_constant_map_value

const map 字面量中的值必须是常量。

了解详情
non_constant_record_field

const record 字面量中的字段必须是常量。

non_constant_record_field_from_deferred_library

延迟库中的常量值不能在“const”记录字面量中用作字段。

non_constant_relational_pattern_expression

关系模式表达式必须是常量。

了解详情
non_constant_set_element

const set 字面量中的值必须是常量。

了解详情
non_constant_type_argument

“{0}”的类型参数必须在编译时已知,因此不能是类型参数。

了解详情
non_constructor_factory

只有构造函数可以声明为 factory。

non_const_argument_for_const_parameter

参数 '{0}' 必须是常量。

了解详情
non_const_call_to_literal_constructor

此实例创建必须是“const”,因为 {0} 构造函数被标记为“@literal”。

了解详情
non_const_generative_enum_constructor

生成枚举构造函数必须是“const”。

了解详情
non_const_map_as_expression_statement

没有类型参数的非常量 map 或 set 字面量不能用作表达式语句。

non_covariant_type_parameter_position_in_representation_type

扩展类型参数不能在其表示类型的非协变位置使用。

了解详情
non_exhaustive_switch_expression

类型“{0}”没有被 switch case 完全匹配,因为它不匹配“{1}”。

了解详情
non_exhaustive_switch_statement

类型“{0}”没有被 switch case 完全匹配,因为它不匹配“{1}”。

了解详情
non_final_field_in_enum

枚举只能声明 final 字段。

了解详情
non_generative_constructor

期望找到生成构造函数“{0}”,但找到了 factory。

了解详情
non_generative_implicit_constructor

超类“{0}”的未命名构造函数(由“{1}”的默认构造函数调用)必须是生成构造函数,但找到了 factory。

了解详情
non_identifier_library_name

库名称必须是标识符。

non_native_function_type_argument_to_pointer

不能调用“asFunction”,因为指针的函数签名“{0}”不是有效的 C 函数签名。

了解详情
non_nullable_equals_parameter

'==' 运算符的参数类型应为非可空。

non_part_of_directive_in_part

part-of 指令必须是一个 part 中唯一的指令。

non_positive_array_dimension

数组维度必须是正数。

了解详情
non_resizable_activity

<activity> 元素应允许调整大小,以便用户可以利用 Chrome OS 上的多窗口环境。

non_sized_type_argument

类型“{1}”不是“{0}”的有效类型参数。类型参数必须是原生整数、“Float”、“Double”、“Pointer”或“Struct”、“Union”或“AbiSpecificInteger”的子类型。

了解详情
non_string_literal_as_uri

URI 必须是字符串字面量。

non_sync_factory

Factory 主体不能使用“async”、“async*”或“sync*”。

了解详情
non_type_as_type_argument

名称“{0}”不是类型,因此不能用作类型参数。

了解详情
non_type_in_catch_clause

名称“{0}”不是类型,不能用于 on-catch 子句。

了解详情
non_user_definable_operator

运算符“{0}”不是用户可定义的。

non_void_return_for_operator

运算符 []= 的返回类型必须是“void”。

了解详情
non_void_return_for_setter

setter 的返回类型必须是“void”或省略。

了解详情
normal_before_optional_parameters

普通参数必须出现在可选参数之前。

not_assigned_potentially_non_nullable_local_variable

非可空局部变量“{0}”在使用前必须被赋值。

了解详情
not_a_type

{0} 不是类型。

了解详情
not_binary_operator

“{0}”不是二元运算符。

了解详情
not_enough_positional_arguments

“{0}” 期望 1 个位置参数,但找到 0 个。

期望 1 个位置参数,但找到 0 个。

“{2}” 期望 {0} 个位置参数,但找到 {1} 个。

期望 {0} 个位置参数,但找到 {1} 个。

了解详情
not_initialized_non_nullable_instance_field

非可空实例字段“{0}”必须被初始化。

了解详情
not_initialized_non_nullable_variable

非可空变量“{0}”必须被初始化。

了解详情
not_instantiated_bound

类型参数的边界类型必须被实例化。

not_iterable_spread

List 或 set 字面量中的展开元素必须实现“Iterable”。

了解详情
not_map_spread

Map 字面量中的展开元素必须实现“Map”。

了解详情
not_null_aware_null_spread

Null 类型的表达式不能与非 null 感知展开一起使用。

no_annotation_constructor_arguments

注解创建必须有参数。

了解详情
no_combined_super_signature

无法从覆盖的方法中推断“{0}”中的缺失类型:{1}。

了解详情
no_default_super_constructor

超类“{0}”没有零参数构造函数。

no_generative_constructors_in_superclass

类“{0}”不能继承“{1}”,因为“{1}”只有 factory 构造函数(没有生成构造函数),而“{0}”至少有一个生成构造函数。

了解详情
no_touchscreen_feature

默认的“android.hardware.touchscreen”对于 Chrome OS 来说需要是可选的。

nullable_type_in_catch_clause

潜在可空类型不能在“on”子句中使用,因为抛出可空表达式是无效的。

了解详情
nullable_type_in_extends_clause

类不能继承可空类型。

了解详情
nullable_type_in_implements_clause

类、mixin 或扩展类型不能实现可空类型。

了解详情
nullable_type_in_on_clause

Mixin 不能将可空类型作为超类约束。

了解详情
nullable_type_in_with_clause

类或 mixin 不能 mix in 可空类型。

了解详情
null_argument_to_non_null_type

“{0}” 不应为非可空类型参数“{1}”传递“null”参数进行调用。

了解详情
null_aware_cascade_out_of_order

“?..” 级联运算符必须是级联序列中的第一个。

null_check_always_fails

此 null 检查将始终抛出异常,因为表达式将始终评估为“null”。

了解详情
object_cannot_extend_another_class

类“Object”不能扩展任何其他类。

obsolete_colon_for_default_value

使用冒号作为默认值前的分隔符不再支持。

了解详情
on_repeated

类型“{0}”只能包含在超类约束中一次。

了解详情
optional_parameter_in_operator

定义运算符时不允许可选参数。

了解详情
out_of_order_clauses

“{0}”子句必须出现在“{1}”子句之前。

override_on_non_overriding_member

该字段没有覆盖继承的 getter 或 setter。

该 getter 没有覆盖继承的 getter。

该方法没有覆盖继承的方法。

该 setter 没有覆盖继承的 setter。

了解详情
packed_annotation

Struct 必须最多包含一个“Packed”注解。

了解详情
packed_annotation_alignment

只支持打包到 1、2、4、8 和 16 字节对齐。

了解详情
parse_error

{0}

part_of_different_library

期望此库是“{0}”的一部分,而不是“{1}”。

了解详情
part_of_name

“part of”指令不能使用增强 part 特性中的名称。

part_of_non_part

包含的 part “{0}”必须有一个 part-of 指令。

了解详情
part_of_unnamed_library

库未命名。在 part-of 指令中,期望的是 URI,而不是库名称“{0}”。

了解详情
path_does_not_exist

路径“{0}”不存在。

了解详情
path_not_posix

路径“{0}”不是 POSIX 风格的路径。

了解详情
path_pubspec_does_not_exist

目录“{0}”不包含 pubspec。

了解详情
pattern_assignment_declares_variable

变量“{0}”不能在模式赋值中声明。

pattern_assignment_not_local_variable

模式赋值中只能赋值给局部变量。

了解详情
pattern_constant_from_deferred_library

延迟库中的常量值不能用于模式。

了解详情
pattern_never_matches_value_type

匹配值类型“{0}”永远不能匹配必需的类型“{1}”。

pattern_type_mismatch_in_irrefutable_context

类型为“{0}”的匹配值不可赋值给必需的类型“{1}”。

了解详情
pattern_variable_assignment_inside_guard

模式变量不能在封闭的 guarded 模式的 guard 内部赋值。

了解详情
pattern_variable_declaration_outside_function_or_method

模式变量声明不能出现在函数或方法之外。

permission_implies_unsupported_hardware

权限导致应用与 Chrome OS 不兼容,考虑添加可选的 {0} 功能标记。

platform_value_disallowed

platforms 字段中的键不能有值。

了解详情
positional_after_named_argument

位置参数必须出现在命名参数之前。

positional_field_in_object_pattern

对象模式只能使用命名字段。

了解详情
positional_parameter_outside_group

位置参数必须包含在方括号中(“[”和“]”)。

positional_super_formal_parameter_with_positional_argument

当 super 构造函数调用有位置参数时,不能使用位置 super 参数。

了解详情
prefix_after_combinator

前缀(“as”子句)应出现在任何 show/hide 组合子之前。

prefix_collides_with_top_level_member

名称“{0}”已用作导入前缀,不能用于命名顶级元素。

了解详情
prefix_identifier_not_followed_by_dot

名称“{0}”引用了导入前缀,因此后面必须跟着“.”。

了解详情
prefix_shadowed_by_local_declaration

前缀“{0}”不能在此处使用,因为它被局部声明遮蔽了。

了解详情
private_collision_in_mixin_application

私有名称“{0}”(由“{1}”定义)与由“{2}”定义的同名名称冲突。

了解详情
private_optional_parameter

命名参数不能以下划线开头。

了解详情
private_setter

setter “{0}”是私有的,不能在其声明库之外访问。

了解详情
read_potentially_unassigned_final

final 变量“{0}”不能在此处读取,因为它可能尚未赋值。

了解详情
receiver_of_type_never

接收器的类型是“Never”,并且永远不会完成并返回值。

record_literal_one_positional_no_trailing_comma

仅包含一个位置字段的记录字面量需要后置逗号。

了解详情
record_type_one_positional_no_trailing_comma

仅包含一个位置字段的记录类型需要后置逗号。

了解详情
recursive_compile_time_constant

编译时常量表达式依赖于自身。

了解详情
recursive_constant_constructor

常量构造函数依赖于自身。

recursive_constructor_redirect

构造函数不能直接或间接重定向到自身。

了解详情
recursive_include_file

“{1}”中的包含文件“{0}”递归包含自身。

recursive_interface_inheritance

“{0}”不能是自身的 superinterface:{1}。

“{0}”不能扩展自身。

“{0}”不能实现自身。

“{0}”不能使用自身作为 mixin。

“{0}”不能使用自身作为超类约束。

了解详情
redeclare_on_non_redeclaring_member

该 {0} 没有重声明在 superinterface 中声明的 {0}。

了解详情
redirecting_constructor_with_body

重定向构造函数不能有主体。

redirection_in_non_factory_constructor

只有 factory 构造函数可以指定“=”重定向。

redirect_generative_to_missing_constructor

在“{1}”中找不到构造函数“{0}”。

了解详情
redirect_generative_to_non_generative_constructor

生成构造函数不能重定向到 factory 构造函数。

了解详情
redirect_to_abstract_class_constructor

转发构造函数“{0}”无法转发到抽象类“{1}”的构造函数。

了解详情
redirect_to_invalid_function_type

转发的构造函数“{0}”与“{1}”具有不兼容的参数。

了解详情
redirect_to_invalid_return_type

转发的构造函数的返回类型“{0}”不是“{1}”的子类型。

了解详情
redirect_to_missing_constructor

在“{1}”中找不到构造函数“{0}”。

了解详情
redirect_to_non_class

名称“{0}”不是类型,不能用于转发构造函数。

了解详情
redirect_to_non_const_constructor

常量转发构造函数不能转发到非常量构造函数。

了解详情
redirect_to_type_alias_expands_to_type_parameter

转发构造函数不能转发到扩展为类型参数的类型别名。

了解详情
referenced_before_declaration

局部变量“{0}”不能在其声明之前被引用。

了解详情
refutable_pattern_in_irrefutable_context

可驳斥模式不能在不可驳斥上下文中使用。

了解详情
relational_pattern_operand_type_not_assignable

常量表达式类型“{0}”不可赋值给运算符“{2}”的参数类型“{1}”。

了解详情
relational_pattern_operator_return_type_not_assignable_to_bool

关系模式中使用的运算符的返回类型必须可赋值给“bool”。

了解详情
removed_lint

“{0}”已在 Dart “{1}” 中移除。

removed_lint_use

“{0}”已在 Dart “{1}” 中移除。

replaced_lint

“{0}”已在 Dart “{1}” 中被“{2}”替换。

replaced_lint_use

“{0}”已在 Dart “{1}” 中被“{2}”替换。

representation_field_modifier

表示字段不能有修饰符。

representation_field_trailing_comma

表示字段不能有尾随逗号。

rest_element_in_map_pattern

map 模式不能包含 rest 模式。

了解详情
rethrow_outside_catch

rethrow 必须在 catch 子句内。

了解详情
return_in_generative_constructor

构造函数不能返回值。

了解详情
return_in_generator

不能从使用 'async*' 或 'sync*' 修饰符的生成器函数返回值。

了解详情
return_of_do_not_store

“{0}”被注解为“doNotStore”,除非“{1}”也被注解,否则不应返回。

了解详情
return_of_invalid_type

类型为“{0}”的值不能从构造函数“{2}”返回,因为它具有返回类型“{1}”。

类型为“{0}”的值不能从函数“{2}”返回,因为它具有返回类型“{1}”。

类型为“{0}”的值不能从方法“{2}”返回,因为它具有返回类型“{1}”。

了解详情
return_of_invalid_type_from_closure

返回的类型“{0}”不能从“{1}”函数返回,这是闭包上下文所要求的。

了解详情
return_without_value

“return” 后缺少返回值。

了解详情
sdk_version_async_exported_from_core

类“{0}”直到版本 2.1 才从“dart:core”导出,但此代码需要在早期版本上运行。

了解详情
sdk_version_as_expression_in_const_context

常量表达式中使用 as 表达式直到版本 2.3.2 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_bool_operator_in_const_context

常量上下文中使用运算符“{0}”用于“bool”操作数直到版本 2.3.2 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_constructor_tearoffs

拆分构造函数需要“constructor-tearoffs”语言特性。

了解详情
sdk_version_eq_eq_operator_in_const_context

常量上下文中使用运算符“==”用于非原始类型直到版本 2.3.2 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_extension_methods

扩展方法直到版本 2.6.0 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_gt_gt_gt_operator

运算符“>>>”直到版本 2.14.0 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_is_expression_in_const_context

常量上下文中使用 is 表达式直到版本 2.3.2 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_never

类型“Never”直到版本 2.12.0 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_set_literal

Set 字面量直到版本 2.2 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_since

此 API 自 SDK {0} 起可用,但约束条件“{1}”不保证其可用性。

sdk_version_ui_as_code

for、if 和 spread 元素直到版本 2.3.0 才受支持,但此代码需要在早期版本上运行。

了解详情
sdk_version_ui_as_code_in_const_context

if 和 spread 元素在常量表达式中直到版本 2.5.0 才受支持,但此代码需要在早期版本上运行。

了解详情
sealed_enum

枚举不能声明为“sealed”。

sealed_mixin

Mixin 不能声明为“sealed”。

sealed_mixin_class

Mixin class 不能声明为“sealed”。

setter_constructor

构造函数不能是 setter。

setter_in_function

Setter 不能在方法或函数内定义。

setting_orientation_on_activity

<activity> 元素不应锁定到任何方向,以便用户可以利用 Chrome OS 上的多窗口环境和更大屏幕。

set_element_type_not_assignable

元素类型“{0}”不能赋值给 set 类型“{1}”。

了解详情
shared_deferred_prefix

deferred import 的前缀不能用于其他 import 指令。

了解详情
size_annotation_dimensions

'Array' 必须有一个与其维度匹配的 'Array' 注解。

了解详情
spread_expression_from_deferred_library

deferred library 中的常量值不能展开到 const 字面量中。

stack_overflow

文件中有太多嵌套表达式或语句。

static_access_to_instance_member

实例成员“{0}”不能使用静态访问来访问。

了解详情
static_constructor

构造函数不能是 static。

static_getter_without_body

一个 'static' getter 必须有一个主体。

static_operator

运算符不能是 static。

static_setter_without_body

一个 'static' setter 必须有一个主体。

strict_raw_type

泛型类型“{0}”应该有显式类型参数但没有。

subtype_of_base_or_final_is_not_base_final_or_sealed

mixin “{0}”必须是“base”,因为超类型“{1}”是“base”。

mixin “{0}”必须是“base”,因为超类型“{1}”是“final”。

类型“{0}”必须是“base”、“final”或“sealed”,因为超类型“{1}”是“base”。

类型“{0}”必须是“base”、“final”或“sealed”,因为超类型“{1}”是“final”。

了解详情
subtype_of_deferred_class

类和 mixin 不能实现 deferred class。

类不能继承 deferred class。

类不能 mixin deferred class。

了解详情
subtype_of_disallowed_type

“{0}”不能用作超类约束。

类和 mixin 不能实现“{0}”。

类不能继承“{0}”。

类不能 mixin “{0}”。

了解详情
subtype_of_ffi_class

类“{0}”不能继承“{1}”。

类“{0}”不能实现“{1}”。

类“{0}”不能 mixin “{1}”。

了解详情
subtype_of_sealed_class

类“{0}”不应被继承、mixin 或实现,因为它已被 sealed。

了解详情
subtype_of_struct_class

类“{0}”不能继承“{1}”,因为“{1}”是“Struct”、“Union”或“AbiSpecificInteger”的子类型。

类“{0}”不能实现“{1}”,因为“{1}”是“Struct”、“Union”或“AbiSpecificInteger”的子类型。

类“{0}”不能 mixin “{1}”,因为“{1}”是“Struct”、“Union”或“AbiSpecificInteger”的子类型。

了解详情
supertype_expands_to_type_parameter

扩展为类型参数的类型别名不能实现。

扩展为类型参数的类型别名不能 mixin。

扩展为类型参数的类型别名不能用作超类约束。

扩展为类型参数的类型别名不能用作超类。

了解详情
super_formal_parameter_type_is_not_subtype_of_associated

此参数的类型“{0}”不是关联的超构造函数参数类型“{1}”的子类型。

了解详情
super_formal_parameter_without_associated_named

没有关联的命名超构造函数参数。

了解详情
super_formal_parameter_without_associated_positional

没有关联的位置超构造函数参数。

了解详情
super_initializer_in_object

类“Object”不能调用超类的构造函数。

super_invocation_not_last

superconstructor 调用必须是初始化列表中的最后一个:“{0}”。

了解详情
super_in_enum_constructor

枚举构造函数不能有“super”初始化。

了解详情
super_in_extension

“super”关键字不能在扩展中使用,因为扩展没有超类。

了解详情
super_in_extension_type

“super”关键字不能在扩展类型中使用,因为扩展类型没有超类。

了解详情
super_in_invalid_context

“super”调用的无效上下文。

了解详情
super_in_redirecting_constructor

转发构造函数不能有“super”初始化。

了解详情
switch_case_completes_normally

“case”不应正常完成。

了解详情
switch_expression_not_assignable

switch 表达式的类型“{0}”不可赋值给 case 表达式的类型“{1}”。

了解详情
switch_has_case_after_default_case

default case 应该是 switch 语句中的最后一个 case。

switch_has_multiple_default_cases

“default” case 只能声明一次。

tearoff_of_generative_constructor_of_abstract_class

抽象类的 generative 构造函数不能被拆分。

了解详情
text_direction_code_point_in_comment

Unicode 码点“U+{0}”改变了文本的外观,使其与编译器解释的方式不同。

了解详情
text_direction_code_point_in_literal

Unicode 码点“U+{0}”改变了文本的外观,使其与编译器解释的方式不同。

了解详情
throw_of_invalid_type

抛出表达式的类型“{0}”必须可赋值给“Object”。

了解详情
top_level_cycle

无法推断“{0}”的类型,因为它通过循环 {1} 依赖自身。

了解详情
top_level_operator

运算符必须在类中声明。

typedef_in_class

Typedef 不能在类内声明。

type_alias_cannot_reference_itself

Typedef 不能直接或通过另一个 typedef 递归引用自身。

了解详情
type_annotation_deferred_class

deferred 类型“{0}”不能在声明、转换或类型测试中使用。

了解详情
type_arguments_on_type_variable

不能将类型参数与类型变量“{0}”一起使用。

type_argument_not_matching_bounds

“{0}”不符合类型参数“{1}”的界限“{2}”。

了解详情
type_before_factory

Factory 构造函数不能有返回类型。

type_check_with_null

非 null 测试应该使用“!= null”来完成。

null 测试应该使用“== null”来完成。

了解详情
type_parameter_on_constructor

构造函数不能有类型参数。

type_parameter_on_operator

定义运算符时不允许有类型参数。

type_parameter_referenced_by_static

Static 成员不能引用类的类型参数。

了解详情
type_parameter_supertype_of_its_bound

“{0}”不能是其上界的超类型。

了解详情
type_test_with_non_type

名称“{0}”不是类型,不能在“is”表达式中使用。

了解详情
type_test_with_undefined_name

名称“{0}”未定义,因此不能在“is”表达式中使用。

了解详情
unchecked_use_of_nullable_value

可为 null 的表达式不能用作条件。

可为 null 的表达式不能在 for-in 循环中用作迭代器。

可为 null 的表达式不能在 spread 中使用。

可为 null 的表达式不能在 yield-each 语句中使用。

该函数不能无条件调用,因为它可能为“null”。

方法“{0}”不能无条件调用,因为接收者可能为“null”。

运算符“{0}”不能无条件调用,因为接收者可能为“null”。

属性“{0}”不能无条件访问,因为接收者可能为“null”。

了解详情
undefined_annotation

未定义的名称“{0}”用作注解。

了解详情
undefined_class

未定义的类“{0}”。

了解详情
undefined_constructor_in_initializer

类 '{0}' 没有名为 '{1}' 的构造函数。

类“{0}”没有未命名构造函数。

了解详情
undefined_enum_constant

“{1}”中没有名为“{0}”的常量。

了解详情
undefined_enum_constructor

枚举没有名为“{0}”的构造函数。

枚举没有未命名的构造函数。

了解详情
undefined_extension_getter

getter “{0}”未在扩展“{1}”中定义。

了解详情
undefined_extension_method

方法“{0}”未在扩展“{1}”中定义。

了解详情
undefined_extension_operator

运算符“{0}”未在扩展“{1}”中定义。

了解详情
undefined_extension_setter

setter “{0}”未在扩展“{1}”中定义。

了解详情
undefined_function

函数“{0}”未定义。

了解详情
undefined_getter

getter “{0}”未在“{1}”函数类型中定义。

getter “{0}”未在类型“{1}”中定义。

了解详情
undefined_hidden_name

library “{0}”未导出具有隐藏名称“{1}”的成员。

了解详情
undefined_identifier

未定义的名称“{0}”。

了解详情
undefined_identifier_await

函数体中未用“async”标记的“await”未定义。

了解详情
undefined_lint

“{0}”不是一个已识别的 lint 规则。

undefined_method

方法“{0}”未在“{1}”函数类型中定义。

方法“{0}”未在类型“{1}”中定义。

了解详情
undefined_named_parameter

命名参数“{0}”未定义。

了解详情
undefined_operator

运算符“{0}”未在类型“{1}”中定义。

了解详情
undefined_prefixed_name

名称“{0}”通过前缀“{1}”被引用,但在使用该前缀导入的任何 library 中均未定义。

了解详情
undefined_referenced_parameter

参数“{0}”未由“{1}”定义。

了解详情
undefined_setter

setter “{0}”未在“{1}”函数类型中定义。

setter “{0}”未在类型“{1}”中定义。

了解详情
undefined_shown_name

library “{0}”未导出具有所示名称“{1}”的成员。

了解详情
undefined_super_member

getter “{0}”未在“{1}”的超类中定义。

方法“{0}”未在“{1}”的超类中定义。

运算符“{0}”未在“{1}”的超类中定义。

setter “{0}”未在“{1}”的超类中定义。

了解详情
unexpected_terminator_for_parameter_group

没有“{0}”来打开参数组。

unexpected_token

意外文本“{0}”。

unexpected_tokens

意外的 token。

unignorable_ignore

诊断“{0}”不能被忽略。

unknown_platform

平台“{0}”不是一个已识别的平台。

了解详情
unnecessary_cast

不必要的 cast。

了解详情
unnecessary_cast_pattern

不必要的 cast pattern。

unnecessary_dev_dependency

dev dependency on {0} 是不必要的,因为该 package 也有一个 normal dependency。

了解详情
unnecessary_final

关键字“final”不是必需的,因为参数隐式为“final”。

了解详情
unnecessary_import

import '{0}' 是不必要的,因为所有使用的元素也都由 import '{1}' 提供。

了解详情
unnecessary_nan_comparison

double 不能等于“double.nan”,因此条件始终为“false”。

double 不能等于“double.nan”,因此条件始终为“true”。

了解详情
unnecessary_non_null_assertion

“!” 将不起作用,因为接收者不能为 null。

了解详情
unnecessary_no_such_method

不必要的“noSuchMethod”声明。

了解详情
unnecessary_null_assert_pattern

null-assert pattern 将不起作用,因为匹配的类型不可为 null。

了解详情
unnecessary_null_check_pattern

null-check pattern 将不起作用,因为匹配的类型不可为 null。

了解详情
unnecessary_null_comparison

操作数不能为“null”,因此条件始终为“false”。

操作数不能为“null”,因此条件始终为“true”。

操作数必须为“null”,因此条件始终为“false”。

操作数必须为“null”,因此条件始终为“true”。

了解详情
unnecessary_question_mark

“?” 是不必要的,因为没有它“{0}”也是可为 null 的。

了解详情
unnecessary_set_literal

大括号不必要地将此表达式包装在 set 字面量中。

了解详情
unnecessary_type_check

不必要的类型检查;结果始终为“false”。

不必要的类型检查;结果始终为“true”。

了解详情
unnecessary_wildcard_pattern

不必要的 wildcard pattern。

unqualified_reference_to_non_local_static_member

超类的 static 成员必须通过定义类型的名称来限定。

了解详情
unqualified_reference_to_static_member_of_extended_type

扩展类型或其超类之一的 static 成员必须通过定义类型的名称来限定。

了解详情
unreachable_switch_case

此 case 已被前面的 case 覆盖。

了解详情
unreachable_switch_default

此 default 子句已被前面的 case 覆盖。

了解详情
unrecognized_error_code

“{0}”不是一个已识别的错误代码。

unsupported_chrome_os_feature

功能 {0} 在 Chrome OS 上不受支持,请考虑将其设为可选。

unsupported_chrome_os_hardware

功能 {0} 在 Chrome OS 上不受支持,请考虑将其设为可选。

unsupported_option_without_values

选项“{1}”不受“{0}”支持。

unsupported_value

值“{1}”不受“{0}”支持。

unused_catch_clause

异常变量“{0}”未使用,因此可以移除“catch”子句。

了解详情
unused_catch_stack

堆栈跟踪变量“{0}”未使用,可以移除。

了解详情
unused_element

声明“{0}”未被引用。

了解详情
unused_element_parameter

可选参数“{0}”的值从未给定。

了解详情
unused_field

字段“{0}”的值未使用。

了解详情
unused_import

未使用的 import:“{0}”。

了解详情
unused_label

标签“{0}”未使用。

了解详情
unused_local_variable

局部变量“{0}”的值未使用。

了解详情
unused_result

应该使用“{0}”。{1}。

“{0}”的值应该被使用。

了解详情
unused_shown_name

名称 {0} 已显示,但未使用。

了解详情
uri_does_not_exist

URI 的目标不存在:“{0}”。

了解详情
uri_does_not_exist_in_doc_import

URI 的目标不存在:“{0}”。

了解详情
uri_has_not_been_generated

URI 的目标尚未生成:“{0}”。

了解详情
uri_with_interpolation

URI 不能使用字符串插值。

了解详情
use_of_native_extension

Dart native extensions 已弃用,在 Dart 2.15 中不可用。

了解详情
use_of_void_result

此表达式的类型为“void”,因此其值不能使用。

了解详情
values_declaration_in_enum

枚举中不能声明名为“values”的成员。

了解详情
variable_length_array_not_last

可变长度的“Array”只能作为 Struct 的最后一个字段出现。

了解详情
variable_pattern_keyword_in_declaration_context

声明上下文中的 variable pattern 不能指定“var”或“final”关键字。

了解详情
variable_type_mismatch

类型为“{0}”的值不能赋值给 const 变量(类型为“{1}”)。

了解详情
var_and_type

不能同时使用“var”和类型名称声明变量。

var_as_type_name

关键字“var”不能用作类型名称。

var_class

类不能声明为“var”。

var_enum

枚举不能声明为“var”。

var_return_type

返回类型不能是“var”。

var_typedef

Typedef 不能声明为“var”。

void_with_type_arguments

类型“void”不能有类型参数。

with_before_extends

extends 子句必须在 with 子句之前。

workspace_field_not_list

“workspace”字段的值必须是相对文件路径列表。

了解详情
workspace_value_not_string

workspace entry 必须是目录路径(字符串)。

了解详情
workspace_value_not_subdirectory

workspace 值必须是“{0}”子目录的相对路径。

了解详情
wrong_explicit_type_parameter_variance_in_superinterface

“{0}”是一个“{1}”类型参数,不能在“{3}”的“{2}”位置使用。

wrong_number_of_parameters_for_operator

运算符“-”应声明 0 或 1 个参数,但找到 {0} 个。

运算符“{0}”应恰好声明 {1} 个参数,但找到 {2} 个。

了解详情
wrong_number_of_parameters_for_setter

Setter 必须恰好声明一个必需的位置参数。

了解详情
wrong_number_of_type_arguments

类型“{0}”声明了 {1} 个类型参数,但给定了 {2} 个类型参数。

了解详情
wrong_number_of_type_arguments_constructor

构造函数“{0}.{1}”没有类型参数。

构造函数“{0}.{1}”没有类型参数。

了解详情
wrong_number_of_type_arguments_enum

枚举声明了 {0} 个类型参数,但给定了 {1} 个类型参数。

了解详情
wrong_number_of_type_arguments_extension

扩展“{0}”声明了 {1} 个类型参数,但给定了 {2} 个类型参数。

了解详情
wrong_number_of_type_arguments_function

函数“{0}”声明了 {1} 个类型参数,但给定了 {2} 个类型参数。

此函数声明了 {0} 个类型参数,但给定了 {1} 个类型参数。

wrong_number_of_type_arguments_method

方法“{0}”声明了 {1} 个类型参数,但给定了 {2} 个类型参数。

了解详情
wrong_separator_for_positional_parameter

位置参数的默认值前应加上“=”。

wrong_terminator_for_parameter_group

预期“{0}”关闭参数组。

wrong_type_parameter_variance_in_superinterface

“{0}”不能在“{1}”中逆变或不变使用。

wrong_type_parameter_variance_position

“{0}”类型参数“{1}”不能在“{2}”位置使用。

yield_in_non_generator

yield 语句必须在生成器函数中(标记为“async*”或“sync*”的函数)。

yield-each 语句必须在生成器函数中(标记为“async*”或“sync*”的函数)。

了解详情
yield_of_invalid_type

yield 的值(类型为“{0}”)必须可赋值给“{1}”。

“yield*”表达式隐含的类型“{0}”必须可赋值给“{1}”。

了解详情
always_declare_return_types

函数“{0}”应该有返回类型但没有。

方法“{0}”应该有返回类型但没有。

toggle_on
了解详情
always_put_control_body_on_new_line

语句应位于单独一行。

toggle_on
了解详情
always_put_required_named_parameters_first

必需的命名参数应在可选命名参数之前。

toggle_on
了解详情
always_require_non_null_named_parameters
toggle_on
always_specify_types

缺少类型注解。

toggle_on
always_use_package_imports

对于“lib”目录中的文件,使用“package:”导入。

toggle_on
了解详情
annotate_overrides

成员“{0}”覆盖了继承的成员,但未用“@override”注解。

toggle_on
了解详情
annotate_redeclares

成员“{0}”正在重新声明,但未用“@redeclare”注解。

toggle_on
avoid_annotating_with_dynamic

不必要的“dynamic”类型注解。

toggle_on
avoid_as
toggle_on
avoid_bool_literals_in_conditional_expressions

包含“bool”字面量的条件表达式可以简化。

toggle_on
avoid_catches_without_on_clauses

Catch 子句应使用“on”来指定捕获的异常类型。

toggle_on
avoid_catching_errors

不应捕获类型“Error”。

不应捕获类型“{0}”,因为它是“Error”的子类。

toggle_on
avoid_classes_with_only_static_members

类应定义实例成员。

toggle_on
avoid_double_and_int_checks

显式检查 double 或 int。

toggle_on
avoid_dynamic_calls

在“dynamic”目标上进行方法调用或属性访问。

toggle_on
了解详情
avoid_empty_else

'else' 子句中不允许空语句。

toggle_on
了解详情
avoid_equals_and_hash_code_on_mutable_classes

在未用“@immutable”注解的类中不应覆盖方法“{0}”。

toggle_on
avoid_escaping_inner_quotes

不必要的转义“{0}”。

toggle_on
avoid_field_initializers_in_const_classes

'const' 类中的字段不应有初始化器。

toggle_on
avoid_final_parameters

参数不应标记为“final”。

toggle_on
avoid_function_literals_in_foreach_calls

不应将函数字面量传递给“forEach”。

toggle_on
了解详情
avoid_futureor_void

不要使用类型 'FutureOr'。'.

toggle_on
了解详情
avoid_implementing_value_types

不应实现覆盖“==”的类。

toggle_on
avoid_init_to_null

重复的初始化为“null”。

toggle_on
了解详情
avoid_js_rounded_ints

编译为 JavaScript 时,整数文字不能精确表示。

toggle_on
avoid_multiple_declarations_per_line

单行声明多个变量。

toggle_on
avoid_null_checks_in_equality_operators

在实现“==”时不必要的 null 比较。

toggle_on
avoid_positional_boolean_parameters

“bool”参数应该是命名参数。

toggle_on
avoid_print

不要在生产代码中调用“print”。

toggle_on
了解详情
avoid_private_typedef_functions

typedef 是不必要的,因为它只在一个地方使用。

toggle_on
avoid_redundant_argument_values

参数的值是冗余的,因为它与默认值匹配。

toggle_on
avoid_relative_lib_imports

不能使用相对路径导入“lib”中的 library。

toggle_on
了解详情
avoid_renaming_method_parameters

参数名“{0}”与被覆盖方法中的名称“{1}”不匹配。

toggle_on
了解详情
avoid_return_types_on_setters

Setter 上不必要的返回类型。

toggle_on
了解详情
avoid_returning_null
toggle_on
avoid_returning_null_for_future
toggle_on
avoid_returning_null_for_void

不要从返回类型为“void”的函数返回“null”。

不要从返回类型为“void”的方法返回“null”。

toggle_on
了解详情
avoid_returning_this

不要从方法返回“this”。

toggle_on
avoid_setters_without_getters

Setter 没有对应的 getter。

toggle_on
avoid_shadowing_type_parameters

类型参数“{0}”遮蔽了封闭的 {1} 中的类型参数。

toggle_on
了解详情
avoid_single_cascade_in_expression_statements

不必要的 cascade 表达式。

toggle_on
了解详情
avoid_slow_async_io

使用 async 'dart:io' 方法。

toggle_on
了解详情
avoid_type_to_string

在生产代码中对“Type”使用“toString”是不安全的。

toggle_on
了解详情
avoid_types_as_parameter_names

参数名“{0}”与可见的类型名匹配。

类型参数名“{0}”与可见的类型名匹配。

toggle_on
了解详情
avoid_types_on_closure_parameters

函数表达式参数上不必要的类型注解。

toggle_on
avoid_unnecessary_containers

不必要的“Container”实例。

toggle_on
了解详情
avoid_unstable_final_fields
toggle_on
avoid_unused_constructor_parameters

参数“{0}”未在构造函数中使用。

toggle_on
avoid_void_async

当 'async' 函数不返回值时,其返回类型应为“Future”。

toggle_on
avoid_web_libraries_in_flutter

不要在 Flutter web plugin 之外使用仅限 web 的 library。

toggle_on
了解详情
await_only_futures

在“{0}”的实例上使用“await”,而它不是“Future”的子类型。

toggle_on
了解详情
camel_case_extensions

扩展名“{0}”不是 UpperCamelCase 标识符。

toggle_on
了解详情
camel_case_types

类型名“{0}”不是 UpperCamelCase 标识符。

toggle_on
了解详情
cancel_subscriptions

未取消的“StreamSubscription”实例。

toggle_on
了解详情
cascade_invocations

接收者不必要的重复。

toggle_on
cast_nullable_to_non_nullable

不要将可为 null 的值强制转换为不可为 null 的类型。

toggle_on
close_sinks

未关闭的“Sink”实例。

toggle_on
了解详情
collection_methods_unrelated_type

参数类型“{0}”与“{1}”不相关。

toggle_on
了解详情
combinators_ordering

按字母顺序排序 combinator 名称。

toggle_on
comment_references

引用的名称在作用域中不可见。

toggle_on
conditional_uri_does_not_exist

条件 URI “{0}” 的目标不存在。

toggle_on
constant_identifier_names

常量名“{0}”不是 lowerCamelCase 标识符。

toggle_on
了解详情
control_flow_in_finally

在“finally”子句中使用“{0}”。

toggle_on
了解详情
curly_braces_in_flow_control_structures

{0} 中的语句应包含在块中。

toggle_on
了解详情
dangling_library_doc_comments

悬空 library doc 注释。

toggle_on
了解详情
depend_on_referenced_packages

导入的 package “{0}”不是导入 package 的依赖项。

toggle_on
了解详情
deprecated_consistency

弃用类中的构造函数应标记为弃用。

由弃用参数初始化的字段应标记为弃用。

初始化弃用字段的参数应标记为弃用。

toggle_on
deprecated_member_use_from_same_package

'{0}' 已弃用,不应使用。

'{0}' 已弃用,不应使用。 {1}

toggle_on
diagnostic_describe_all_properties

公共属性未由“debugFillProperties”或“debugDescribeChildren”描述。

toggle_on
了解详情
directives_ordering

将“dart:”{0} 放在其他 {0} 之前。

将“package:”{0} 放在相对 {0} 之前。

按字母顺序排序 directive 部分。

在所有 imports 之后,在一个单独的部分中指定 exports。

toggle_on
discarded_futures

非“async”函数中返回“Future”的调用。

toggle_on
do_not_use_environment

无效使用 environment 声明。

toggle_on
document_ignores

缺少解释为何忽略此诊断的文档。

toggle_on
empty_catches

空 catch 块。

toggle_on
了解详情
empty_constructor_bodies

空构造函数体应使用“;”而不是“{}”来编写。

toggle_on
了解详情
empty_statements

不必要的空语句。

toggle_on
了解详情
enable_null_safety
toggle_on
eol_at_end_of_file

文件末尾缺少换行符。

toggle_on
erase_dart_type_extension_types

在“is”检查中不安全地使用“DartType”。

exhaustive_cases

“{0}”中缺少某些常量的 case 子句。

toggle_on
file_names

文件名“{0}”不是 lower_case_with_underscores 标识符。

toggle_on
了解详情
flutter_style_todos

To-do 注释不符合 Flutter 风格。

toggle_on
hash_and_equals

缺少对应的“{0}”覆盖。

toggle_on
了解详情
implementation_imports

导入另一个 package 的“lib/src”目录中的 library。

toggle_on
了解详情
implicit_call_tearoffs

隐式拆分“call”方法。

toggle_on
了解详情
implicit_reopen

{0} “{1}”重新打开了“{2}”,因为它没有标记为“{3}”。

toggle_on
invalid_case_patterns

此表达式在 Dart 3.0 的“case”子句中无效。

toggle_on
invalid_runtime_check_with_js_interop_types

将“{0}”强制转换为“{1}”是将 Dart 值强制转换为 JS 互操作类型,这可能不与平台一致。

将“{0}”强制转换为“{1}”是将 JS 互操作值强制转换为 Dart 类型,这可能不与平台一致。

将“{0}”强制转换为“{1}”是将 JS 互操作值强制转换为不兼容的 JS 互操作类型,这可能不与平台一致。

在“{0}”和“{1}”之间的运行时检查会检查 Dart 值是否为 JS 互操作类型,这可能不与平台一致。

在“{0}”和“{1}”之间的运行时检查会检查 JS 互操作值是否为 Dart 类型,这可能不与平台一致。

在“{0}”和“{1}”之间的运行时检查涉及两个 JS 互操作类型之间的非平凡运行时检查,这可能不与平台一致。

在“{0}”和“{1}”之间的运行时检查涉及 JS 互操作值与不相关的 JS 互操作类型之间的运行时检查,此检查始终为 true,并且不会检查底层类型。

toggle_on
了解详情
invariant_booleans
toggle_on
iterable_contains_unrelated_type
toggle_on
join_return_with_assignment

赋值可以在“return”语句中内联。

toggle_on
leading_newlines_in_multiline_strings

多行字符串开头缺少换行符。

toggle_on
library_annotations

此注解应附加到 library directive。

toggle_on
了解详情
library_names

library 名称“{0}”不是 lower_case_with_underscores 标识符。

toggle_on
了解详情
library_prefixes

前缀“{0}”不是 lower_case_with_underscores 标识符。

toggle_on
了解详情
library_private_types_in_public_api

在公共 API 中无效使用私有类型。

toggle_on
了解详情
lines_longer_than_80_chars

行长度超过 80 个字符的限制。

toggle_on
list_remove_unrelated_type
toggle_on
literal_only_boolean_expressions

布尔表达式具有常量值。

toggle_on
了解详情
matching_super_parameters

名为“{0}”的 super parameter 与 super constructor 中的对应参数“{1}”名称不同。

toggle_on
missing_code_block_language_in_doc_comment

代码块缺少指定的语言。

toggle_on
missing_whitespace_between_adjacent_strings

相邻字符串之间缺少空格。

toggle_on
了解详情
no_adjacent_strings_in_list

不要在 list 字面量中使用相邻字符串。

toggle_on
了解详情
no_default_cases

在 switch 中无效使用“default”成员。

toggle_on
no_duplicate_case_values

case 子句的值(“{0}”)等于前面 case 子句的值(“{1}”)。

toggle_on
了解详情
no_leading_underscores_for_library_prefixes

library 前缀“{0}”以下划线开头。

toggle_on
了解详情
no_leading_underscores_for_local_identifiers

局部变量“{0}”以下划线开头。

toggle_on
了解详情
no_literal_bool_comparisons

与布尔字面量不必要的比较。

toggle_on
no_logic_in_create_state

不要在“createState”中放置任何逻辑。

toggle_on
了解详情
no_runtimetype_tostring

在生产代码中对“Type”使用“toString”是不安全的。

toggle_on
no_self_assignments

变量或属性被赋值给自己。

toggle_on
no_wildcard_variable_uses

引用的标识符是 wildcard。

toggle_on
了解详情
non_constant_identifier_names

变量名“{0}”不是 lowerCamelCase 标识符。

toggle_on
了解详情
noop_primitive_operations

表达式没有效果,可以移除。

toggle_on
null_check_on_nullable_type_parameter

不应在类型为潜在可为 null 类型参数的变量上使用 null check operator。

toggle_on
了解详情
null_closures

Closure 不能为“null”,因为它可能会被调用。

toggle_on
omit_local_variable_types

局部变量上不必要的类型注解。

toggle_on
omit_obvious_local_variable_types

当局部变量的类型明显时,省略类型注解。

toggle_on
omit_obvious_property_types

不需要类型注解,因为它很明显。

toggle_on
one_member_abstracts

不必要的 abstract class 使用。

toggle_on
only_throw_errors

不要抛出不继承“Exception”或“Error”的类的实例。

toggle_on
了解详情
overridden_fields

字段覆盖了从“{0}”继承的字段。

toggle_on
了解详情
package_api_docs

缺少公共 API 的文档。

toggle_on
package_names

package 名称“{0}”不是 lower_case_with_underscores 标识符。

toggle_on
了解详情
package_prefixed_library_names

library 名称不是以 package 名称为前缀的点分隔路径。

toggle_on
了解详情
parameter_assignments

参数“{0}”的无效赋值。

toggle_on
prefer_adjacent_string_concatenation

字符串字面量不应通过“+”运算符连接。

toggle_on
了解详情
prefer_asserts_in_initializer_lists

Assert 应该在初始化列表中。

toggle_on
了解详情
prefer_asserts_with_message

assert 中缺少消息。

toggle_on
了解详情
prefer_bool_in_asserts
toggle_on
prefer_collection_literals

不必要的构造函数调用。

toggle_on
了解详情
prefer_conditional_assignment

“if”语句可以用 null-aware 赋值替换。

toggle_on
了解详情
prefer_const_constructors

构造函数使用“const”以提高性能。

toggle_on
了解详情
prefer_const_constructors_in_immutables

‘@immutable’ 类中的构造函数应声明为“const”。

toggle_on
了解详情
prefer_const_declarations

对于初始化为常量值的 final 变量,使用“const”。

toggle_on
了解详情
prefer_const_literals_to_create_immutables

使用“const”字面量作为‘@immutable’ 类构造函数的参数。

toggle_on
了解详情
prefer_constructors_over_static_methods

Static 方法应该是一个构造函数。

toggle_on
了解详情
prefer_contains

始终为“false”,因为“indexOf”始终大于或等于 -1。

始终为“true”,因为“indexOf”始终大于或等于 -1。

不必要地使用“indexOf”来测试是否包含。

toggle_on
了解详情
prefer_double_quotes

不必要地使用单引号。

toggle_on
了解详情
prefer_equal_for_default_values
toggle_on
prefer_expression_function_bodies

不必要地使用 block 函数体。

toggle_on
了解详情
prefer_final_fields

私有字段 {0} 可以是“final”。

toggle_on
了解详情
prefer_final_in_for_each

pattern 应该是 final 的。

变量“{0}”应该是 final 的。

toggle_on
了解详情
prefer_final_locals

局部变量应该是 final 的。

toggle_on
了解详情
prefer_final_parameters

参数“{0}”应该是 final 的。

toggle_on
了解详情
prefer_for_elements_to_map_fromiterable

从 iterables 构建 map 时使用“for”元素。

toggle_on
了解详情
prefer_foreach

使用“forEach”和 tear-off 而不是“for”循环将函数应用于每个元素。

toggle_on
了解详情
prefer_function_declarations_over_variables

使用函数声明而不是变量赋值来将函数绑定到名称。

toggle_on
了解详情
prefer_generic_function_type_aliases

在“typedef”中使用泛型函数类型语法。

toggle_on
了解详情
prefer_if_elements_to_conditional_expressions

使用“if”元素来有条件地添加元素。

toggle_on
prefer_if_null_operators

在测试“null”时使用“??” 运算符而不是“?:”。

toggle_on
了解详情
prefer_initializing_formals

使用 initializing formal 将参数赋值给字段。

toggle_on
了解详情
prefer_inlined_adds

可以内联添加列表项。

可以内联添加多个列表项。

toggle_on
了解详情
prefer_int_literals

不必要地使用“double”字面量。

toggle_on
prefer_interpolation_to_compose_strings

使用插值来组合字符串和值。

toggle_on
了解详情
prefer_is_empty

比较始终为“false”,因为长度始终大于或等于 0。

比较始终为“true”,因为长度始终大于或等于 0。

使用“isEmpty”而不是“length”来测试集合是否为空。

使用“isNotEmpty”而不是“length”来测试集合是否为空。

toggle_on
了解详情
prefer_is_not_empty

使用“isNotEmpty”而不是对“isEmpty”的结果取反。

toggle_on
了解详情
prefer_is_not_operator

使用“is!” 运算符而不是对“is”运算符的值取反。

toggle_on
了解详情
prefer_iterable_wheretype

使用“whereType”来选择给定类型的元素。

toggle_on
了解详情
prefer_mixin

只有 mixin 才应被混入。

toggle_on
prefer_null_aware_method_calls

使用 null-aware 调用“call”方法,而不是显式测试“null”。

toggle_on
prefer_null_aware_operators

使用 null-aware 运算符“?.” 而不是显式“null”比较。

toggle_on
了解详情
prefer_relative_imports

对于“lib”目录中的文件,使用相对导入。

toggle_on
了解详情
prefer_single_quotes

不必要地使用双引号。

toggle_on
了解详情
prefer_spread_collections

可以内联添加多个元素。

toggle_on
prefer_typing_uninitialized_variables

未初始化的字段应具有显式类型注解。

未初始化的变量应具有显式类型注解。

toggle_on
了解详情
prefer_void_to_null

不必要地使用类型“Null”。

toggle_on
了解详情
provide_deprecation_message

缺少弃用消息。

toggle_on
了解详情
public_member_api_docs

缺少公共成员的文档。

toggle_on
了解详情
recursive_getters

getter “{0}”递归返回自身。

toggle_on
了解详情
require_trailing_commas

缺少必需的尾随逗号。

toggle_on
secure_pubspec_urls

不应使用“{0}”协议,因为它不安全。

toggle_on
了解详情
sized_box_for_whitespace

使用“SizedBox”向布局添加空白。

toggle_on
了解详情
sized_box_shrink_expand

使用“SizedBox.{0}”避免需要指定“height”和“width”。

toggle_on
了解详情
slash_for_doc_comments

对 doc 注释使用行尾形式(“///”)。

toggle_on
了解详情
sort_child_properties_last

参数“{0}”应在 widget 构造函数调用中排在最后。

toggle_on
了解详情
sort_constructors_first

构造函数声明应在非构造函数声明之前。

toggle_on
了解详情
sort_pub_dependencies

依赖项未按字母顺序排序。

toggle_on
了解详情
sort_unnamed_constructors_first

未命名构造函数的无效位置。

toggle_on
了解详情
specify_nonobvious_local_variable_types

当局部变量的类型不明显时,指定其类型。

toggle_on
specify_nonobvious_property_types

需要类型注解,因为它不明显。

toggle_on
strict_top_level_inference

缺少类型注解。

toggle_on
super_goes_last
toggle_on
switch_on_type

避免在“Type”上使用 switch 语句。

toggle_on
了解详情
test_types_in_equals

在“==”中缺少对“{0}”的类型测试。

toggle_on
了解详情
throw_in_finally

在“finally”块中使用“{0}”。

toggle_on
了解详情
tighten_type_of_initializing_formals

使用类型注解而不是“assert”来强制非 null 性。

toggle_on
了解详情
type_annotate_public_apis

公共 API 上缺少类型注解。

toggle_on
了解详情
type_init_formals

不要不必要地对 initializing formals 进行类型注解。

toggle_on
了解详情
type_literal_in_constant_pattern

使用“TypeName _”而不是类型字面量。

toggle_on
了解详情
unawaited_futures

此表达式计算的“Future”缺少“await”。

toggle_on
了解详情
unintended_html_in_doc_comment

尖括号将被解释为 HTML。

toggle_on
了解详情
unnecessary_async

如果函数不使用“await”,则不要将其设为“async”。

toggle_on
unnecessary_await_in_return

不必要的“await”。

toggle_on
unnecessary_brace_in_string_interps

字符串插值中不必要的大括号。

toggle_on
了解详情
unnecessary_breaks

不必要的“break”语句。

toggle_on
unnecessary_const

不必要的“const”关键字。

toggle_on
了解详情
unnecessary_constructor_name

不必要的“.new”构造函数名称。

toggle_on
了解详情
unnecessary_final

局部变量不应标记为“final”。

toggle_on
了解详情
unnecessary_getters_setters

不必要地使用 getter 和 setter 来包装字段。

toggle_on
了解详情
unnecessary_ignore

诊断“{0}”未在此位置生成,因此无需忽略。

诊断“{0}”未在此文件中生成,因此无需忽略。

toggle_on
了解详情
unnecessary_lambdas

Closure 应该是一个 tearoff。

toggle_on
了解详情
unnecessary_late

不必要的“late”修饰符。

toggle_on
了解详情
unnecessary_library_directive

应避免没有注释或注解的 library directive。

toggle_on
unnecessary_library_name

Library 名称不是必需的。

toggle_on
了解详情
unnecessary_new

不必要的“new”关键字。

toggle_on
了解详情
unnecessary_null_aware_assignments

不必要的“null”赋值。

toggle_on
了解详情
unnecessary_null_aware_operator_on_extension_on_nullable

不必要地使用 null-aware 运算符在可为 null 类型上调用扩展方法。

toggle_on
了解详情
unnecessary_null_checks

不必要地使用 null check(“!”)。

toggle_on
了解详情
unnecessary_null_in_if_null_operators

不必要地将“??” 与“null”一起使用。

toggle_on
了解详情
unnecessary_nullable_for_final_variable_declarations

类型可以不可为 null。

toggle_on
了解详情
unnecessary_overrides

不必要的 override。

toggle_on
了解详情
unnecessary_parenthesis

不必要地使用括号。

toggle_on
了解详情
unnecessary_raw_strings

不必要地使用 raw string。

toggle_on
了解详情
unnecessary_statements

不必要的语句。

toggle_on
了解详情
unnecessary_string_escapes

字符串字面量中不必要的转义。

toggle_on
了解详情
unnecessary_string_interpolations

不必要地使用字符串插值。

toggle_on
了解详情
unnecessary_this

不必要的“this.”限定符。

toggle_on
了解详情
unnecessary_to_list_in_spreads

在 spread 中不必要地使用“toList”。

toggle_on
了解详情
unnecessary_unawaited

不必要地使用“unawaited”。

toggle_on
了解详情
unnecessary_underscores

不必要地使用多个下划线。

toggle_on
了解详情
unreachable_from_main

可执行 library 中不可到达的成员“{0}”。

toggle_on
unrelated_type_equality_checks

操作数类型(“{0}”)不是被匹配值(“{1}”)的子类型或超类型。

右操作数类型(“{0}”)不是左操作数(“{1}”)的子类型或超类型。

toggle_on
了解详情
unsafe_html

将值赋给属性“{0}”是不安全的。

调用构造函数“{0}”是不安全的。

调用方法“{0}”是不安全的。

toggle_on
unsafe_variance

此类型不安全:类型参数出现在非协变位置。

toggle_on
了解详情
use_build_context_synchronously

不要在异步间隙中跨越使用“BuildContext”,并且使用不相关的“mounted”检查保护。

不要在异步间隙中跨越使用“BuildContext”。

toggle_on
了解详情
use_colored_box

使用“ColoredBox”而不是仅有“Color”的“Container”。

toggle_on
了解详情
use_decorated_box

使用“DecoratedBox”而不是仅有“Decoration”的“Container”。

toggle_on
了解详情
use_enums

类应该是一个枚举。

toggle_on
use_full_hex_values_for_flutter_colors

“Color”的实例应使用 8 位十六进制整数创建(例如“0xFFFFFFFF”)。

toggle_on
了解详情
use_function_type_syntax_for_parameters

使用泛型函数类型语法声明参数“{0}”。

toggle_on
了解详情
use_if_null_to_convert_nulls_to_bools

使用 if-null 运算符将“null”转换为“bool”。

toggle_on
了解详情
use_is_even_rather_than_modulo

使用“{0}”而不是“% 2”。

toggle_on
use_key_in_widget_constructors

公共 widget 的构造函数应具有命名参数“key”。

toggle_on
了解详情
use_late_for_private_fields_and_variables

对不可为 null 类型的私有成员使用“late”。

toggle_on
了解详情
use_named_constants

使用常量“{0}”而不是返回相同对象的构造函数。

toggle_on
了解详情
use_null_aware_elements

使用 null-aware 标记“?” 而不是通过“if”进行 null 检查。

toggle_on
了解详情
use_raw_strings

使用 raw string 避免使用转义。

toggle_on
了解详情
use_rethrow_when_possible

使用“rethrow”重新抛出捕获的异常。

toggle_on
了解详情
use_setters_to_change_properties

该方法用于更改属性。

toggle_on
了解详情
use_string_buffers

使用 string buffer 而不是“+”来组合字符串。

toggle_on
了解详情
use_string_in_part_of_directives

part-of directive 使用 library 名称。

toggle_on
了解详情
use_super_parameters

参数“{0}”可以是一个 super parameter。

参数“{0}”可以是一系列 super parameter。

toggle_on
了解详情
use_test_throws_matchers

在没有抛出异常时,使用“throwsA”matcher 而不是“fail”。

toggle_on
use_to_and_as_if_applicable

方法名称应以“to”或“as”开头。

toggle_on
use_truncating_division

使用截断除法。

toggle_on
了解详情
valid_regexps

无效的正则表达式语法。

toggle_on
了解详情
void_checks

将值赋给类型为“void”的变量。

toggle_on
了解详情