I want to pass parameters onto the 'onpressed'
- :) == official syntax
- :( == get a void error
- : p == is the trick I wrote, which doesn't give me an editor error,
but a console error withsetstate() after dispose()
message
Is there a way to pass parameters to methods in onpressed?
// :) onPressed: (){},
// :) onPressed: _methodName,
// :( onPressed: _methodName(param),
// :p onPressed: (){_methodName(param)},
onPressed: () {
var docId = _dataList[idx].documentID;
setState(() { ... });
print('delete complite');
),
cf. :( error img https://i.stack.imgur.com/DfHpu.png