Dart @operator的意义是什么?
我注意到在一些类中有一个@operator 比如说,Dart @operator的意义是什么?,dart,Dart,我注意到在一些类中有一个@operator 比如说, @TestOn("!vm") ..... 当我进一步挖掘时,TestOn是一个类 class TestOn { /// The expression specifying the platform. final String expression; const TestOn(this.expression); } 谁能告诉我@operator的意义是什么吗?@TestOn(“!vm”)是一个很好的例子。它们用于提供有关Dar
@TestOn("!vm")
.....
当我进一步挖掘时,TestOn是一个类
class TestOn {
/// The expression specifying the platform.
final String expression;
const TestOn(this.expression);
}
谁能告诉我@operator的意义是什么吗?@TestOn(“!vm”)
是一个很好的例子。它们用于提供有关Dart程序中元素的额外信息。@TestOn(“!vm”)
是一个。它们用于提供有关Dart程序中元素的额外信息。想想你的答案:。我也很好奇。看起来您可以用另一个类来装饰一个类,如TS或ES6中的注释。您似乎正在将const TestOn应用于上面的任何内容,当(可能)测试/运行该函数时,它可能被用作元数据。或者类似的。类似于在TypeScript中的函数上方添加“@Component”,这将为其提供组件(类)的属性。Google确实喜欢他们的注释/装饰器。请相信下面是您的答案:。我也很好奇。看起来您可以用另一个类来装饰一个类,如TS或ES6中的注释。您似乎正在将const TestOn应用于上面的任何内容,当(可能)测试/运行该函数时,它可能被用作元数据。或者类似的。类似于在TypeScript中的函数上方添加“@Component”,这将为其提供组件(类)的属性。谷歌确实喜欢他们的注释/装饰。