import 'package:meta/meta.dart';
void func({int a=0,@required int b}){ print("hello"); }
void main(){ void Function({int,int}) disp=func; disp(b: 1); }发布于 2021-01-19 08:31:52
简短答覆:
import 'package:meta/meta.dart';
void func({int a = 0, @required int b}) {
print("hello");
}
void main() {
void Function({int a, int b}) disp = func;
disp(b: 1);
}这就是:
void Function({int a, int b})
因为应该在(Function)类型声明中指定命名参数。
https://stackoverflow.com/questions/65786519
复制相似问题