Flutter 颤振中如何传递静态法中的值
我需要在静态方法中传递值Flutter 颤振中如何传递静态法中的值,flutter,dart,static,static-methods,Flutter,Dart,Static,Static Methods,我需要在静态方法中传递值 static Future<void> sendLocation() async { var param = { 'api_key': globals.api_key, 'actionto': 'task', 'customer_id': globals.customer_id, 'user_id': globals.user_id, }; print(globals.user_id); } 这里全局值为静态方法
static Future<void> sendLocation() async {
var param = {
'api_key': globals.api_key,
'actionto': 'task',
'customer_id': globals.customer_id,
'user_id': globals.user_id,
};
print(globals.user_id);
}
这里全局值为静态方法提供空值
static Future<void> sendLocation() async {
var param = {
'api_key': globals.api_key,
'actionto': 'task',
'customer_id': globals.customer_id,
'user_id': globals.user_id,
};
print(globals.user_id);
}
output==227如何定义
globals
?你能告诉全班同学吗?JuleMand 101不考虑全局。即使它是一个简单的变量,也会给出空值。globals
是如何定义的?你能告诉全班同学吗?JuleMand 101不考虑全局。即使它是一个简单的变量,也会给出空值。