终端中的@
指的是什么?
class NumberTriviaLocalDataSourceImpl implements NumberTriviaLocalDataSource {
final SharedPreferences sharedPreferences; // use ? for solving the error
NumberTriviaLocalDataSourceImpl({@required this.sharedPreferences});
// With null safety, use the 'required' keyword, not the '@required' annotation. Try removing the '@'.
1条答案
按热度按时间8mmmxcuj1#
在Dart和Flutter中,“@”符号是元数据的语法。当声明类、方法和变量时,元数据可以用来为Dart编译器提供额外的信息或指令。这里是dart文档https://dart.dev/language/metadata的链接