gpt4 book ai didi

function - Dart:从函数访问调用者实例

转载 作者:行者123 更新时间:2023-12-03 06:31:47 26 4
gpt4 key购买 nike

如何从函数访问“调用者”实例。以下代码引发语法错误:

// Error: Local variables cannot be referenced before they are declared
Function listener = (Event event) {
print(listener);
};

我想从函数内部访问“listener”变量。谢谢。

最佳答案

Function listener;
listener = (Event event) {
print(listener);
}

关于function - Dart:从函数访问调用者实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38441759/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com