简体   繁体   English

运算符“=”在 Dart 的类声明中是什么意思?

[英]What does the operator "=" means in class declaration in Dart?

In my studies of Dart languages, I found some packaged using this kind of class declaration:在我对 Dart 语言的研究中,我发现了一些使用这种类声明的封装:


class _Base = Authentication with Utilities, Validators;

I don't understand what the operator = is doing here, is it a kind of alias?我不明白运算符=在这里做什么,它是一种别名吗?

Is a shortcut to create inherit classes with mixins.是使用 mixins 创建继承类的快捷方式。

The example is same to:该示例与以下内容相同:

class _Base extends Authentication with Utilities, Validators{
  _Base(): super(); // or with args
}

Utilities and validators are mixins.实用程序和验证器是 mixin。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM