如何将动态可选命名参数传递给 flutter 中的数组?
how to pass a dynamic optional named paremeter to an array in flutter?
我正在尝试创建一个动态列表,是否可以像这样在其中传递动态可选命名参数?
List<dynamic> rtnListIndex = [{rtnListVal}];
dynamic rtnListVal(int index, {
String name,
int tenthMin,
int min,
int tenthSec,
int sec,
int reps,
double interval,
int sets,
int rest,
int totalMin,
int totalSec,
int type,
int prep,
}) {
return [index = 0, {name, tenthMin, min, tenthSec, sec, reps, interval, sets, rest, totalMin, totalSec, type, prep}];
}
我正在尝试创建一个动态列表,是否可以像这样在其中传递动态可选命名参数?
List<dynamic> rtnListIndex = [{rtnListVal}];
dynamic rtnListVal(int index, {
String name,
int tenthMin,
int min,
int tenthSec,
int sec,
int reps,
double interval,
int sets,
int rest,
int totalMin,
int totalSec,
int type,
int prep,
}) {
return [index = 0, {name, tenthMin, min, tenthSec, sec, reps, interval, sets, rest, totalMin, totalSec, type, prep}];
}