dart Metadata-元数据

相当于java里的注解,C#里的特性, 

Metadate

library todo;

class Todo {
  final String who;
  final String what;

  const Todo(this.who, this.what);
}

 

@Todo('seth', 'make this do something')
void doSomething() {
  print('do something');
}

 

posted @ 2020-09-22 15:49  富坚老贼  阅读(216)  评论(0编辑  收藏  举报