当我执行onHover: function(context)
时,它会给我错误
但CCD_ 2工作良好。
有什么区别?onHover是否应该始终有一个变量(PointerHoverEvent(?
function(context);
可能会返回onHover
参数不想要的东西,onHover
参数想要一个函数,在这里onHover: (event) => function(context)
中,你给它的是参数想要的函数,
给你一个想法
//this is a function
Function functionWhichReturnsInt = (){return 1;};
//this is function which needs function
void feedMeAFunction(Function food){
food();
}
//this is a function which needs int
void feedMeAnInt(int food){
print(food);
}
//we can call the functions like this
//passing a function
feedMeAFunction(functionWhichReturnsInt);
//passing an int
feedMeAnInt(functionWhichReturnsInt());