Javascript Dart:错误:参数';拉赫扎';can';t的值为';空';因为它的类型';int';,但隐式默认值为';空';
你为什么给我这种错误? 错误:参数“larghezza”的值不能为“null”,因为其类型为“int”,但隐式默认值为“null”Javascript Dart:错误:参数';拉赫扎';can';t的值为';空';因为它的类型';int';,但隐式默认值为';空';,javascript,Javascript,你为什么给我这种错误? 错误:参数“larghezza”的值不能为“null”,因为其类型为“int”,但隐式默认值为“null” import 'dart:math'; String genera_bottone({String id, int codice_colore, int larghezza}) { String html = "<button id='"; //il resto in base ai parametri return ht
import 'dart:math';
String genera_bottone({String id, int codice_colore, int larghezza}) {
String html = "<button id='";
//il resto in base ai parametri
return html;
}
main(List<String> args) {
genera_bottone(codice_colore: 65);
var codici = ["ABC123", "XVW667", "GTU200", "MWQ003"];
String prefissi = ""; //vogliamo ABCXVWGTUMWQ
codici.forEach((ele) {
prefissi += ele.substring(0, 3);
});
print(prefissi);
var funzioni = [(n) => n * n, (n) => n * n * n, (b, e) => pow(b, e)];
print(funzioni[0](6));
print(funzioni[1](6));
print(funzioni[2](2, 5));
}
import'dart:math';
字符串类型({String id,int codice_colore,int larghezza}){
String html=“如果为null,则转换为0