i have form with three dropdown buttons and these were declared at top of the class,
String _currentItemSelected1 = 'low'; String _currentItemSelected2 = 'low'; String _currentItemSelected3 = 'low';
then I have RisedButton with onPressed property with this body
onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => new SuggestionResult(_currentItemSelected1, _currentItemSelected2, _currentItemSelected3 ), ), ); },
in SuggestionResult class I was override the constructor as following:
final String temp; final String hum; final String light; SuggestionResult({this.temp, this.hum, this.light});
Now, the PROBLEM is when I calling SuggestionResult class it says "Too many positional arguments: 0 expected, but 3 found. Try removing the extra positional arguments, or specifying the name for named arguments."
https://stackoverflow.com/questions/66072895/navigator-push-with-three-parametars-in-flutter February 06, 2021 at 10:01AM
没有评论:
发表评论