flutter定义statefulwidget如果必须接收关键字但具体值不确定的情况下,可以使用required
classMyCustomWidgetextendsStatefulWidget{finalintsortid;constMyCustomWidget({Key?key,requiredthis.sortid,//其他参数}):super(key:key);@override_MyCustomWidgetStatecreateState()=>_MyCustomWidgetState();}就像这